Simple library for paging calculations