refactored total_match_count