Completed the getValidUserInput() method