add a lock term to the goal function in descent to avoid wobble