add residual