finished the lagrange functions