anchor.diff:  	true -> sets:add_element(Key, Set)
       end.
   
  -get_loopback_arcs_fold(Value, {Set, VisitedNodeSet}) ->
  +get_loopback_arcs_fold(Value, {Set, VisitedNodeSet, Level, VisitedList}) ->
       case sets:is_element(get_arc_to(Value), VisitedNodeSet) of
  -	true -> {sets:add_element(Value, Set), VisitedNodeSet};
  -	false -> {Set, VisitedNodeSet}
  +	true ->
  +	    begin
  +		LoopElements = sets:filter(fun is_usage_dep/1, sets:from_list([Value|lists:takewhile(not_eq(get_arc_to(Value)),VisitedList)])),
  +		{sets:union(LoopElements, Set), VisitedNodeSet, Level, VisitedList}
  +	    end;
  +	false -> {Set, VisitedNodeSet, Level, VisitedList}
       end.
   
   highlight_arcs_set(ArcSet, Drai) ->
  
positive.code: highlight_loops(Drai) ->
      TopNodesSet = sets:from_list(dict:fetch_keys(Drai#drai.dnodes)),
      ArcSet = element(1, sets:fold(fun dfs_loop_detection/2,
  				  {sets:new(), sets:new(), Drai},
  				  TopNodesSet)),
      highlight_arcs_set(ArcSet, Drai).
  
  dfs_loop_detection(Node, {ArcSet, Visited, Drai}) ->
      ThisNodeSet = sets:from_list([Node]),
      NewVisited = sets:add_element(Node, Visited),
      ExpandedNodeSet = expand_nodes_down_wt_arcfilter(fun is_usage_dep/1, ThisNodeSet, Drai),
      NewArcSet = element(1, sets:fold(fun get_loopback_arcs_fold/2,
  				     {ArcSet, NewVisited},
  				     sets:filter(fun is_usage_dep/1, get_arcs_down(ThisNodeSet, Drai)))),
      NewNodeSet = sets:subtract(ExpandedNodeSet, NewVisited),
      {element(1, sets:fold(fun dfs_loop_detection/2,
  			  {NewArcSet, NewVisited, Drai},
  			  NewNodeSet)),
       Visited, Drai}.
  
  get_top_nodes(#drai{dnodes = DNodes,
  		    arcst = ArcsTo}) ->
  
negative.code: 
  is_usage_dep(#diagram_arc{content = this}) -> true;
  is_usage_dep(#diagram_arc{content = {param, _}}) -> true;
  is_usage_dep(_) -> false.
  
  get_node_by_id(NodeId, #drai{dnodes = DNodes}) -> dict:find(NodeId, DNodes).
  get_nodes_by_ids([], _Drai) -> [];
  