improve segtree