rewrote swipe left/right code