reorganized functions in Pagination;