fork from corp186's segmenter