all for loops optimized individually