wrote a test case.
rewrote test case.
added extra bitmask to encoding.