updates while loop