WIP: new constraint generation functions seem to work.