Implemented paging and sorting.