added middle section; simplified initial extent adjustment.