completed while loop

completed while loop