while loop reinstated