add swipe function