use mean instead of sum for interval