added arrow key functionality for input