I think part of the reason I'm unhappy with this change is that I'm checking the value of `diff` when that is just a side effect of the values of `seq` and `pos`. It would probably be more clear if I write the conditions as checks of the sequence number and position.