anchor.diff:  on_active({activate_clustering}, State) ->
       State;
       
  -on_active({start_clustering_shuffle},
  -          {Centroids, Epoch, ResetTriggerState, ClusterTriggerState}) ->
  +on_active({start_clustering_shuffle}, #state_active{cluster_trigger_state = C} = State) ->
       % start new clustering shuffle -> gossip communication
  -    %io:format("~p~n", [State]),
  -    NewClusterTriggerState = trigger:next(ClusterTriggerState),
  +    NewClusterTriggerState = trigger:next(C),
       cyclon:get_subset_rand(1),
  -    {Centroids, Epoch, ResetTriggerState, NewClusterTriggerState};
  +    State#state_active{cluster_trigger_state=NewClusterTriggerState}
  +    ;
   
   % ask vivaldi for network coordinate
  -on_active({reset_clustering},
  -          {Centroids, Epoch, ResetTriggerState, ClusterTriggerState}) ->
  +on_active({reset_clustering}
  +          , #state_active{reset_trigger_state = ResetTriggerState} = State) ->
       NewResetTriggerState = trigger:next(ResetTriggerState),
       vivaldi:get_coordinate(),
  -    {Centroids, Epoch, NewResetTriggerState, ClusterTriggerState};
  +    State#state_active{reset_trigger_state=NewResetTriggerState}
  +    ;
   
   % reset the local state and start a new epoche
  -on_active({vivaldi_get_coordinate_response, Coordinate, _Confidence},
  -          {_Centroids, Epoch, ResetTriggerState, ClusterTriggerState}) ->
  -          NewEpoch = Epoch + 1,
  -    {[dc_centroids:new(Coordinate, 1.0)], NewEpoch,ResetTriggerState, ClusterTriggerState};
  +on_active({vivaldi_get_coordinate_response, Coordinate, _Confidence}
  +           , #state_active{local_epoch=Epoch} = State) ->
  +    State#state_active{
  +        local_epoch=Epoch + 1
  +        , centroids=[dc_centroids:new(Coordinate, 1.0)]
  +    }
  +    ;
   
   on_active({cy_cache, []}, State)  ->
       % ignore empty cache from cyclon
       State;
   
   % got random node from cyclon
  -on_active({cy_cache, [Node] = _Cache},
  -          {Centroids, Epoch, _ResetTriggerState, _ClusterTriggerState} = State) ->
  +on_active({cy_cache, [Node] = _Cache}
  +          , #state_active{centroids=C, local_epoch=E} = State) ->
       %io:format("~p~n",[_Cache]),
  -    comm:send(node:pidX(Node), {clustering_shuffle, comm:this(), Centroids, Epoch},
  +    comm:send(node:pidX(Node), {clustering_shuffle, comm:this(), C, E},
                 [{group_member, dc_clustering}]),
       State;
   
  
positive.code:     {cy_cache, [node:node_type()]} |
      {clustering_shuffle, comm:mypid(), dc_centroids:centroids(), non_neg_integer()} |
      {clustering_shuffle_reply, comm:mypid(), dc_centroids:centroids(), non_neg_integer()} |
      {query_clustering, comm:mypid()}).
  
  %% @doc Sends an initialization message to the node's dc_clustering process.
  -spec activate() -> ok | ignore.
  
negative.code:     ;
  
  % return my clusters
  on_active({query_clustering, Pid}, #state_active{centroids=C} = State) ->
      comm:send(Pid, {query_clustering_response, C}),
      State
      ;
  
  on_active({query_epoch, Pid}, #state_active{local_epoch=E} = State) ->
      comm:send(Pid, {query_epoch_response, E}),
      State
      .
  
  