end segmentations now works