Added arrow key functionality