Implementing residual scaling to better aproximate adjoint equation.