added first attempt for decoding/encoding on bytelevel