calculating section height for header, other minor changes