Simplified the for loop.