add tests and ReadBit