Simplified the loop.