undo

undo removing the last added stmt

also some minor changes