updated segment tree for range sum