Added foreach support