cleaning up
Added encoding and decoding, getting rid of bugs with the bitarrayoutputstream