impurity calculus