more work solving undo, still not working tho