Improved swipe detection