WIP: mid segment switch

A work-in-progress, don't merge.