modify segment_demo