Implemented expand all function and cleaned up the handling of the expandable sections.