Problem 1 remake

change while to for