replace some while loops with for loops