Slightly more elegant implementation.

Yes, I know I don't need the struct and can get the same option permutations by using bit masks on the counter with negations, but that's a tad too obscure for my taste.