Added support for soft constraints.