def check_groups(cookie_group, no_cookie_group, leak_method, log):
    """Check if a leak method works.
    
    cookie_group: df, results for the run with cookies (retest=0,1)
    no_cookie_group: df, results for the run without cookies (retest=0,1)
    leak_method: string, leak method in question
    log: bool, whether to display additional information
    
    Returns <Decision>, value_cookies, value_no_cookies
    
    Decision is True, if both groups have only one result that differs
    Decision is False, if both groups share at least one result
    Decision is None, if both groups do not share a value, and at least one has more than one result
    """
    method_cookies = cookie_group[leak_method]
    method_no_cookies = no_cookie_group[leak_method]
    uniques = [method_cookies.nunique(), method_no_cookies.nunique()]
    
    # Both cookies and no-cookies only have one value
    if all(val == 1 for val in uniques):
        # The value is not the same (method works)
        # (This is the equivalent to the old strict check, only that it is one a single method and not a group)
        if method_cookies.iloc[0] != method_no_cookies.iloc[0]:
            if log:
                print(f"{leak_method} works!", method_cookies.values.tolist(), method_no_cookies.values.tolist())
            # Leak works
            return True, method_cookies.iloc[0], method_no_cookies.iloc[0]
        # If it is the same, the method can not work as all results are the same
        else:
            if log:
                print(f"{leak_method} cannot work both cookie and no-cookie have the same single value")
            # Leak cannot work
            return False, method_cookies.iloc[0], method_no_cookies.iloc[0]
    
    # At least one mode has two different values
    else:
        # Cannot work if one value occures in both modes
        for i in [0, 1]:
            for j in [0, 1]:
                if method_cookies.iloc[i] == method_no_cookies.iloc[j]:
                    if log:
                        print(f"{leak_method} cannot work one has only one value and the other one time the same!", method_cookies.values.tolist(), method_no_cookies.values.tolist())
                    # Leak cannot work
                    return False, method_cookies.iloc[0], method_no_cookies.iloc[0]
    
    # Otherwise, a method specific check is necessary
    return None, method_cookies, method_no_cookies