Change iterator loop into foreach loop.