Why is this a while loop instead of an if? If the while condition is met, the program exits, if not, the while loop terminates. Seems like "if" would do the job here.