Cleaned up the loop.