added code to accept user input