update segment trees