A Fast Segmentation Algorithm