updated edge map and to add segmentation