height calculation used pointless var definition