Wrote new replay algorithm but not tested yet