Add an example with foreach