Task2B - fixed parsing of user input