move FlattenTermsTwo before AddPredicates