Cleaned up swipe function.

Made it pretty and good it works I SWEAR!