def cluster(data, threshold):
    """A simple numbering clustering algorithm.
    'data' should be a list of numbers, which should get clustered.
    The 'threshold' is the biggest gap which can exist between elements
    before they will be seperated into two clusters.

    Returns a list of lists with the original numbers, clustered.
    """
    # data.sort()
    groups = [[data[0]]]

    for x in data[1:]:
        if abs(x - groups[-1][-1]) <= threshold:
            groups[-1].append(x)
        else:
            groups.append([x])

    return groups