Use while loop

Order doesn't matter, so this is okay.