Second while loop keeps breaking.