update the math for the average line