Added Memento pattern with undo