added full residual computations