Adding divergence and gradient-subtraction functions