def _check_length(data, labels, num_seqs_check=None):
    """
    Checks the lengths of the clustal sequences to make
    sure that they are lining up right

    num_seqs_check: The number of sequences to check

    Return True if all of the subsequence lengths are equal
                or if data is empty
    Return False if one of the subsequence lengths differs
    """
    if len(labels) == 0:
        return True
    num_subseqs = len(data[labels[0]])
    if num_seqs_check is None:
        num_seqs_check = num_subseqs
    elif num_seqs_check > num_subseqs:
        num_seqs_check = num_subseqs
    subseq_length = len(data[labels[0]][0])
    end_lengths = set()
    for i in range(num_seqs_check):
        for label in labels:
            seq = data[label][i]
            if len(seq) > subseq_length:
                return False
            elif i + 1 == num_subseqs:
                end_lengths.add(len(seq))
            elif len(seq) < subseq_length:
                return False
    if len(end_lengths) > 1:
        return False
    return True
