fixes hash looping
counts occurrences of the pairs of tones