added more comments and updated the result string for bad user input to reflect stopping the loop.