Why does the program produce more output at the end of the cycle?