Changing loop for until