added segment tree that allows updating a value and range max queries