added a while loop

while loop