Added "Next" and "Previous" button functionality.