fix recursion
add freq_array/count-items