addded a main function to parse the user's input