Got basic segmentation working