Made a little write up about this undo system on my blog: https://loganforman.com/writing/implementing-a-simple-undo-system.html