finish recover algorithm sketch

,need to implement detail