reference for sorting with pagination