version for lagrange