implemented insertBit
implemented nextBit