finishing up commit and undo