clean up some for loops to shave off a few bytes