def group_and_sort_statements(stmt_list, ev_totals=None):
    def _count(stmt):
        if ev_totals is None:
            return len(stmt.evidence)
        else:
            return ev_totals[stmt.get_hash()]
    stmt_rows = defaultdict(list)
    stmt_counts = defaultdict(lambda: 0)
    arg_counts = defaultdict(lambda: 0)
    for key, s in _get_keyed_stmts(stmt_list):
        stmt_rows[key].append(s)
        stmt_counts[key] += _count(s)
        if key[0] == 'Conversion':
            subj = key[1]
            for obj in key[2] + key[3]:
                arg_counts[(subj, obj)] += _count(s)
        else:
            arg_counts[key[1:]] += _count(s)
    def process_rows(stmt_rows):
        for key, stmts in stmt_rows.items():
            verb = key[0]
            inps = key[1:]
            sub_count = stmt_counts[key]
            arg_count = arg_counts[inps]
            if verb == 'Complex' and sub_count == arg_count and len(inps) <= 2:
                if all([len(set(ag.name for ag in s.agent_list())) > 2
                        for s in stmts]):
                    continue
            new_key = (arg_count, inps, sub_count, verb)
            stmts = sorted(stmts,
                           key=lambda s: _count(s) + 1/(1+len(s.agent_list())),
                           reverse=True)
            yield new_key, verb, stmts
    sorted_groups = sorted(process_rows(stmt_rows),
                           key=lambda tpl: tpl[0], reverse=True)
    return sorted_groups