- Initial code for foreach support