Replaced for with for-each
minnor fixes