working on implementing segmentation