Update demag.go

Updated to have correct variables.