Implement the function that take user input and update other stuffs accordingly.