anchor.diff:  
   generate_subgraphs(#drai{dnodes = DNodes} = Drai) ->
       {_ClusterD, BaseClusterNodesSet, DNodes2} = dict:fold(fun get_base_cluster_nodes/3, {dict:new(), sets:new(), DNodes}, DNodes),
  -    {NewDrai,_,_} = sets:fold(fun depth_search_inc_in_clus/2, {Drai#drai{dnodes = DNodes2}, [], no}, BaseClusterNodesSet),
  +    {NewDrai,_,_} = lists:foldl(fun depth_search_inc_in_clus/2, {Drai#drai{dnodes = DNodes2}, [], no},
  +				lists:reverse(sort_topologically(Drai, sets:to_list(BaseClusterNodesSet)))),
       sets:fold(fun find_class/2, NewDrai, BaseClusterNodesSet).
   
   -spec find_class(#diagram_node{}, #drai{}) -> #drai{}.
  
positive.code: expand_nodes_down_wt_arcfilter(Filter, NodeSet, #drai{arcsf = FromTo} = Drai) ->
  	sets:fold(mk_filter_plus_to(Drai, Filter), sets:new(),
  		utils:expand_set_through_idx(NodeSet, FromTo)).
  
  expand_nodes_down(NodeSet, #drai{arcsf = FromTo} = Drai) ->
      utils:sets_map(create_arc_solver(fun get_arc_to/1, Drai),
  
negative.code: % We find children nodes that are not in the set and are in the same cluster as the parent
  -spec expand_cluster_expand_one_aux(#drai{}, string(), sets:set(string()), any()) -> sets:set(string()).
  expand_cluster_expand_one_aux(Drai, Id, Nodes, Cluster) ->
      RawChildrenSet = dia_utils:expand_diamonds_down(Drai, dia_utils:expand_nodes_down(sets:from_list([Id]), Drai)),
      ChildrenSet = sets:subtract(RawChildrenSet, Nodes),
      sets:filter(fun_in_cluster(Drai, Cluster), ChildrenSet).
  
  % Produces a function that takes a node id and returns true iif the node is in the cluster Cluster
  -spec fun_in_cluster(#drai{}, any()) -> fun((string()) -> (boolean())).
  fun_in_cluster(Drai, Cluster) ->
      fun (Id) -> case dict:find(Id, Drai#drai.dnodes) of
  		    {ok, Node} -> get_cluster_id(Node) =:= Cluster;
  		    _ -> false
  		end
      end.
  
  % Adds the set of ValidChildren to the dict of (parent -> set(children)), where both parent and children are nodeIds
  -spec add_to_deps(string(), sets:set(string()), dict:dict(string(), sets:set(string()))) -> dict:dict(string(), sets:set(string())).
  