added arrow key functionality