saved magnitude and gradient