Fix pagination algorithm and formatting
Merge pull request #98 from box/paginationFix

Fix pagination algorithm and formatting