adding arrow key functionality