next and back functions added to slides