added computation of gNorm