anchor.diff:           choose_claim_v1/1, choose_claim_v1/2, choose_claim_v1/3,
            choose_claim_v2/1, choose_claim_v2/2, choose_claim_v2/3,
            choose_claim_v3/1, choose_claim_v3/2, choose_claim_v3/3,
  -         claim_rebalance_n/2,
  +         claim_rebalance_n/2, claim_diversify/3, claim_diagonal/3,
            meets_target_n/2,
            diagonal_stripe/2]).
   
  
positive.code:     TN = proplists:get_value(target_n_val, Params, 4),
      Active = riak_core_ring:active_members(Ring),
      Wants = lists:zip(Active, wants(length(Active), Q)),
      lager:debug("Claim3 started: Q=~p TN = ~p\n", [Q, TN]),
      lager:debug("       wants: ~p\n", [Wants]),
      {Partitions, Owners} = lists:unzip(riak_core_ring:all_owners(Ring)),
  
  
negative.code:                              riak_core_claim_util:gen_complete_len(Q), Claiming, TN),
      {NewOwners, [diversified]}.
  
  %% Claim nodes in seq a,b,c,a,b,c trying to handle the wraparound
  %% case to meet target N
  claim_diagonal(Wants, Owners, Params) ->
      TN = proplists:get_value(target_n_val, Params, 4),
      Claiming = lists:sort([N || {N,W} <- Wants, W > 0]),
      S = length(Claiming),
      Q = length(Owners),
      Reps = Q div S,
      %% Handle the ring wrapround case.  If possible try to pick nodes
      %% that are not within the first TN of Claiming, if enough nodes
      %% are available.
      Tail = Q - Reps * S,
      Last = case S >= TN + Tail of
                 true -> % If number wanted can be filled excluding first TN nodes
                     lists:sublist(lists:nthtail(TN - Tail, Claiming), Tail);
                 _ ->
                     lists:sublist(Claiming, Tail)
             end,
      {lists:flatten([lists:duplicate(Reps, Claiming), Last]), [diagonalized]}.
  
  claim_rebalance_n(Ring0, Node) ->
      Ring = riak_core_ring:upgrade(Ring0),
  