added undo with backing states