def BillSubtreeIndices2( tree_rep ):
    """
    BillSubtreeIndices2
    ===================
    gives the indexes of nested lists by depth
    original idea from bill at
    python-forum.org
 
    @param tree_rep: a nested list representing a tree
    
    @return: a dictionary representing the indexes of the nested lists by depth
 
    """ 
    q = [ ([],tree_rep) ]
    dict_of_index_lists = {}
    while q != []:
        (indices, sub_tree) = q.pop(0)
        dict_of_index_lists.setdefault(len(indices), []).append(indices)
        for (ordinal, sst) in enumerate( sub_tree[1:] ):
            if isinstance( sst, list ):
                q.append( (indices[:] + [ordinal+1], sst) )
    return dict_of_index_lists