implemented left and right swipe