add test for count_frequency