Using a while loop