Segmentation script