segmentation routine incorporated