undo + bug fixes