Implemented Fast with sorting. BUG: has subsegments.