Solving Magic Squares