Added a while loop and exit command