search_count.R reorganized