added --undo option