Solver: take more constaints into account.