amended getting input from user