Added undo with stack