got a basic encoding and decoding scheme going