code: function dangle_routing(in_item){
  	    if( in_item.level < max_depth ){
  		in_item.brackets.push({id: in_item.id,
  				       routing_node: true,
  				       level: in_item.level + 1,
  				       parent_id: in_item.id,
  				       brackets: []
  				      });
  		dangle_routing(in_item.brackets[0]);
  	    }
  	    return in_item;
  	}
docs: Pass one: Essentially walk the brackets, find brackets that end early (above max_depth) and add routing nodes down.