refactored and added more user inputs