constraint solver working