handles user input correctly now, need to implement backwards input.