working program without undo