Simplified a loop.