Can you check the actual encoding and decoding code? I remember when I wrote it it seemed a bit sketchy...