Updated for lagrange.