Updated for new magnetic field setting.