anchor.diff:          {ok, Value} -> Value
       end.
   
  +% add Key to Dict with [] value if Key is not in Dict.  Otherwise
  +% do nothing.
  +dict_init(Key, Dict) ->
  +    dict:update(Key, fun(Value) -> Value end, [], Dict).
  +
   dict_append(Key, Value, Dict) ->
       dict:update(Key, fun(V0) -> [Value | V0] end, [Value], Dict).
   
  
positive.code:             {(BestComm /= NodeComm) or Mods, Weights2, GD#louvain_graphd{communitiesd = dict:store(Node, BestComm, CommunitiesD)}}
          end, {false, Weights0, GD0}, GD0#louvain_graphd.neighborsd),
      % XXX recompute weights and see if they match the new weights
      % compare_weights(NewWeights, weights(NewGD)),
      NewModularity = modularity(NewWeights),
      ?DEBUG("OneLevel Modularity: ~p -> ~p", [Modularity, NewModularity]),
  %   file:write(FD, io_lib:format("m: ~g, weights: ~p~n", [NewWeights#louvain_weights.m, dict:to_list(NewWeights#louvain_weights.weights)])),
  
negative.code: %% In the #louvain_graphd{}, the Communities are updated
  %% to reflect the paritioning.
  one_level(GD0 = #louvain_graphd{}, Weights0 = #louvain_weights{}, Modularity) ->
      % XXX make sure the graph is valid
      validate_graph(GD0),
  %   {ok, FD} = file:open("/tmp/part", [append]),
  %   file:write(FD, io_lib:format("starting communities: ~p~n", [lists:sort(dict:to_list(GD0#louvain_graphd.communitiesd))])),
  %   file:write(FD, io_lib:format("edges: ~p~n", [lists:sort(dict:to_list(GD0#louvain_graphd.edgesd))])),
  