Simplified outer loop