Trying to account for categories and pagination