Completed isMagicSquare