Adding support for foreach