Split into two loops