I'd prefer the inner two for loops to be swapped. Or is there a specific reason for this?