Incorrect Lagrange implementation