Changed element height calculation function for better collapsing