1.improved the algorithm
2.there are 2 bugs listed in SegmentationTODO.log