made it so that the time restarts every time it goes through the while loop