refactored swiping