improved swipe functionality