own bitstream implementation with bools