Sequence scan segmentation algorithm implementation