Some optimizing

Decreased number of times it solves constrains