Adding residual search