Added the page navigation and initial pagination code