added readUserInput function.