added code to parse user input