removing some debugging and fixing the decoding of the data to match encoding