go back to using counters rather than inspecting hash keys