def flag_bad_overlaps(overlaps, min_num_matches):
    """
    :param overlaps: Table of overlaps with ref_id, matched_ref_id, pixel and
    matched_pixel columns
    :param min_num_matches: int. Minimum number of peak matches for an overlap to count as well fit.
    :return overlaps: Same is input but each bad overlap has had its entry in the 'good' column
                      set to False.
    """
    bad_overlaps = [idx for idx in range(len(overlaps)) if overlaps[idx]['peaks'] < min_num_matches]
    overlaps['good'][bad_overlaps] = False
    return overlaps