Added folding of elements
updated Sidebar to work better with hidden elements