corrected rounding; using floor for averages