def METHOD_NAME(k, v, prefix, current_depth=0, max_depth=0, reverse=False, m_prev=""):
    m = "┌" if reverse else "└"
    a = [(f"{prefix}{k}:", v.get("_value", 0), current_depth)]
    # if the value is a dict, recurse
    if isinstance(v, dict) and (max_depth == 0 or current_depth < max_depth):
        # turn the prev char of the prefix from a ├ to a │
        if prefix and prefix[-2] == "├":
            prefix = f"{prefix[:-2]}│ "
        # remove the _value key as it is metadata and not part of the tree.
        v = {k: v for k, v in v.items() if not k.startswith("_")}
        for i, (sk, sv) in enumerate(v.items()):
            p = prefix
            if p and p[-2] == m_prev:
                p = p[::-1]
                p = p.replace(f"─{m_prev}", "  " if m == m_prev else " │", 1)
                p = p[::-1]
            p += "├─" if i != len(v) - 1 else f"{m}─"  # last connection
            if not reverse:
                a = list(METHOD_NAME(sk, sv, p, current_depth + 1, max_depth=max_depth, reverse=False, m_prev=m)) + a
            else:
                a.extend(METHOD_NAME(sk, sv, p, current_depth + 1, max_depth=max_depth, reverse=False, m_prev=m))
    return a