defined pagePosition and refactored
Merge pull request #8 from MissingLabel/swipe_functions

defined pagePosition and refactored