Added a second while loop