Added replace rightmost trailing one's or zero's with the oppsite string of bits.