add the undo function

input error? do not worry, you can input 'B' to undo it. but now, you
can only undo once.