avoided foreach loop.