Implemented functions to control user input