lTo(0, 0);
                    });
                    paginationContainer.appendChild(nextButton);
                }

                // Add last page button
                if (currentPage < totalPages) {
                    const lastButton = createPaginationButton('»', () => {
                        currentPage = totalPages;
                        displayCurrentPage();
                        updatePagination();
                        window.scrollTo(0, 0);
                    });
                  