changed to 2-norm for denominator in resid calc