forward-port some more of the way height clearance code