public void set(long pos, long val) {
			if (start == end && start == pos) {
				minVal = maxVal = val;
				sumVal = val;
			} else {
				long mid = (start + end) / 2;
				if (pos <= mid)
					left.set(pos, val);
				else
					right.set(pos, val);
				minVal = Math.min(left.minVal, right.minVal);
				maxVal = Math.max(left.maxVal, right.maxVal);
				sumVal = left.sumVal + right.sumVal;
			}
		}