Cleaned up foreach loop
Merge pull request #1 from tmoitie/master

Cleaned up foreach loop