def METHOD_NAME(node, seq):
    best = calculate_distance(node, seq)
    best_node = node
    if "children" in node:
        for c in node['children']:
            tmp_best, tmp_best_node = METHOD_NAME(c, seq)
            if tmp_best<best:
                best = tmp_best
                best_node = tmp_best_node
    return best, best_node