added piotr suggestion: purity distance