Redo data handling and add page navigation buttons