def METHOD_NAME(ntree, arrange=True):
    nodeoutput = outputnode_search(ntree)
    if nodeoutput is None:
        # print ("nodeoutput is None")
        return None
    a = []
    a.append([])
    for i in nodeoutput:
        a[0].append(i)
    level = 0
    while a[level]:
        a.append([])
        for node in a[level]:
            inputlist = [i for i in node.inputs if i.is_linked]
            if inputlist:
                for input in inputlist:
                    for nlinks in input.links:
                        node1 = nlinks.from_node
                        a[level + 1].append(node1)
            else:
                pass
        level += 1
    del a[level]
    level -= 1
    # remove duplicate nodes at the same level, first wins
    for x, nodes in enumerate(a):
        a[x] = list(OrderedDict(zip(a[x], repeat(None))))
    # remove duplicate nodes in all levels, last wins
    top = level
    for row1 in range(top, 1, -1):
        for col1 in a[row1]:
            for row2 in range(row1 - 1, 0, -1):
                for col2 in a[row2]:
                    if col1 == col2:
                        a[row2].remove(col2)
                        break
    """
    for x, i in enumerate(a):
        print (x)
        for j in i:
            print (j)
        #print()
    """
    """
    #add node frames to nodelist
    frames = []
    print ("Frames:")
    print ("level:", level)
    print ("a:",a)
    for row in range(level, 0, -1):
        for i, node in enumerate(a[row]):
            if node.parent:
                print ("Frame found:", node.parent, node)
                #if frame already added to the list ?
                frame = node.parent
                #remove node
                del a[row][i]
                if frame not in frames:
                    frames.append(frame)
                    #add frame to the same place than node was
                    a[row].insert(i, frame)
    pprint.pprint(a)
    """
    # return None
    ########################################
    if not arrange:
        nodelist = [j for i in a for j in i]
        nodes_odd(ntree, nodelist=nodelist)
        return None
    ########################################
    levelmax = level + 1
    level = 0
    values.x_last = 0
    while level < levelmax:
        values.average_y = 0
        nodes = [x for x in a[level]]
        # print ("level, nodes:", level, nodes)
        nodes_arrange(nodes, level)
        level = level + 1
    return None