Added toggleCollapse function for better performance.
Merge branch 'wip-1'