added functionality for slide toggling