Utilities - Add pagination function