New pagination functions works perfectly

Ready to roll out to the rest.