fix behavior for long strings of zeros
add test for behavior of long strings of ones