Iteration 3 works for non overlap at last segment.