added swipe function