added functionality of the button (left/right slide)