Implemented the recovery functionality, and fixed some bugs