finishes reverting code