userInput() function revised.