implement basic toggle functionality for table of contents