now paginating and sorting