Finished magicSquare algo