re-added old grad magnitude functionality