ef73892b1a
place rather than updating the main loop's index variables from within a subroutine and other revolting things like that. Move some more globals into local variables.