Counting became unnecessary.
Same result, much simpler.
Stray comments and an inlined check.