On the Theory of Averaging