added a keydown event for left and right arrows to move forwards and backwards