Saving and restoration of state finished. Now in debugging stage.