adding in pagination and sorting