Replace while() with for().