Added a while loop around user input functions

A while loop has been added which will not be broken out of unless a
valid input is entered.