efficient history saving, though it's incorrect