binary_search_count
refactoring