def difference(f1_d, f2_d, out_f1_head, out_f2_head):
    """
    Figures out the difference between two dictionaries
    and reports the difference
    Parameters
    ----------
    f1_d : dict
        Dictionary for first fasta, chromosome names as values
    f2_d : dict
        Dictionary for second fasta, chromosome names as values
    out_f1_head : list
        Dictionary of filtered out chromosomes from first fasta
    out_f2_head : list
        List of filtered out chromosomes from second fasta
    Returns
    -------
    The dictionaries of chromosome names found in one fasta and not the other
    nor in the filtered out chromosome names
    """
    f1_not_f2 = [
        f1_d[i]
        for i in set(list(f1_d.keys())).difference(list(f2_d.keys()))
    ]
    f1_not_f2_not_out = list(set(f1_not_f2) - set(list(out_f1_head)))
    f1_not_f2_not_out.sort()

    f2_not_f1 = [
        f2_d[i]
        for i in set(list(f2_d.keys())).difference(list(f1_d.keys()))
    ]
    f2_not_f1_not_out = list(set(f2_not_f1) - set(list(out_f2_head)))
    f2_not_f1_not_out.sort()
    return(f1_not_f2_not_out, f2_not_f1_not_out)