Write methods for the Prev and Next buttons