In reply to Alokpati:
Note that the outer foreach iterative constraint is redundant, it can be removed