Calculate heights more intelligently, and lazily