added segment tree