Update: New functions for pagination to handle previous and next page lists.