Add a while loop