begin implementation of bit decoding