finished segmentation module