Added solution to the mag diff problem