Fix the CreateMagicSquare to work with any number of boxSize

and commentary
Fix the CreateMagicSquare to work with any number of boxSize

and commentary