Populate squares by rows and columns instead of modular arithmethic.