Added loop for minimum number of zeroes.