* Iterate using foreach to allow batch indexing of associative arrays

Iterate using foreach to allow batch indexing of associative arrays instead of strictly 0 based increasing key based arrays.