added missing lagrange minusDS term
merged fixes
redid the lagrange multiplier