Changed a for-loop to a for-each loop.