modify SegmentTree with QueryIndex