implement the world segmentation algorithm