Segment writing