added functionality for left and right arrows