Added undo() method