Inverting the loop. ~7.3x speedup