def put_in_bucket(d, l, value):

    """
        If this helper function is called on every gene in our analysis, it will group all 
        genes with the same z-score into the same list. Each of those lists of same-z-score 
        genes is stored in l.

        Args:
            d: Dict, in the context of this file, a dict of genes to z-scores
            l: List of Lists, represents out buckets. Initiate with an empty list, the continually pass in
                l to build up your buckets 
            value: String, the current gene we would like to put into a bucket

        Returns: the list now containing value in its proper bucket within l.

    """

    # dummy list to prevent ['string'] -> ['s','t','r','i','n','g']
    dummy = []

    # if list is empty, init it
    if len(l) == 0:
        dummy.append(value)
        return dummy
    else:

        # else search to see if the value fits into an existing bucket
        for i in range(len(l)):

            # along the way, make sure this is a list of lists
            if type(l[i]) != list:
                dummy.append(l[i])
                l[i] = dummy
                dummy = []

            # aka find a bucket with same z-score as value's
            if d[l[i][0]] == d[value]:
                l[i].append(value)
                return l

        # if our value (gene) doesn't have a bucket to go in, make a new one at the end of the list
        dummy.append(value)
        l.append(dummy)
        return l