improved recovery patch algo