Added next/previous functionality.