Hello Donald, 4) several times you use advancePtr, which may be replaced with plusPtr in this cases. moreover, i can sell you the following mini-library for all those Ptr operations: infixl 6 +:, -: ptr+:n = ptr `plusPtr` (fromIntegral n) ptr-:buf = fromIntegral (ptr `minusPtr` buf) -- Best regards, Bulat mailto:bulatz at HotPOP.com