added second version of example, using activateConstraints instead of addConstraints