linearization routine now handles multi-connected segments