updated to accept user input