I see, sorry, I misunderstood what was happening here. I think my confusion arose from the phrase “modify the history” which I (mis)read as “add to the history”. Perhaps something that makes it explicit that “modify” means `#pop` in this context?