Updated height recalc function