Merge pull request #126 from sjopet/simple_pager

added tests, fixed logic issues
fix cs issue
merged upsream changes