added collapsing function for divs