refine previous function, count_co-occurrence