still struggling encoding and decoding
finished encoding and decoding