adding a divergence calculator