Move this up in the code closer to the assignment of `count_after` so it is easier to follow what is going on.