Undo is mostly working with the exception of a few bugs