Partially finished createSegment