Added Swipe UI functionality

added swipe UI element
refactored code