added text segmentation