anchor.diff:      {ok, _} = ?scarcity:start_link(6, 8),
       Main = self(),
       Pid = spawn_link(fun() ->
  -        {ok, _} = ?scarcity:add_peer(6),
  -        {ok, _} = ?scarcity:add_piece(6, 0),
  -        {ok, _} = ?scarcity:add_piece(6, 2),
  +        ok = ?scarcity:add_peer(6, pieces([])),
  +        ok = ?scarcity:add_piece(6, 0, pieces([0])),
  +        ok = ?scarcity:add_piece(6, 2, pieces([0,2])),
           Main ! done,
           receive die -> ok end
       end),
       receive done -> ok end,
       Pieces  = ?pieceset:from_list([0,1,2,3,4,5,6,7], 8),
  -    {ok, O1} = ?scarcity:get_order(6, Pieces),
  +    {ok, O1} = ?scarcity:get_order(6, pieces([0,1,2,3,4,5,6,7])),
       ?assertEqual([1,3,4,5,6,7,0,2], O1),
       Ref = monitor(process, Pid),
       Pid ! die,
  
positive.code: 
  initial_ordering_case() ->
      {ok, _} = ?scarcity:start_link(2, 8),
      Pieces  = ?pieceset:from_list([0,1,2,3,4,5,6,7], 8),
      {ok, Order} = ?scarcity:get_order(2, Pieces),
      ?assertEqual([0,1,2,3,4,5,6,7], Order).
  
  empty_ordering_case() ->
      {ok, _} = ?scarcity:start_link(3, 8),
      Pieces  = ?pieceset:from_list([], 8),
      {ok, Order} = ?scarcity:get_order(3, Pieces),
      ?assertEqual([], Order).
  
  init_pieceset_case() ->
      {ok, _} = ?scarcity:start_link(4, 8),
      {ok, Set} = ?scarcity:add_peer(4),
      ?assertEqual([], ?pieceset:to_list(Set)).
  
  one_available_case() ->
      {ok, _} = ?scarcity:start_link(5, 8),
      {ok, _} = ?scarcity:add_peer(5),
      {ok, _} = ?scarcity:add_piece(5, 0),
      Pieces  = ?pieceset:from_list([0,1,2,3,4,5,6,7], 8),
      {ok, Order} = ?scarcity:get_order(5, Pieces),
      ?assertEqual([1,2,3,4,5,6,7,0], Order).
  
  
negative.code: 
  %% api functions
  -export([start_link/2,
           add_peer/2,
           add_piece/3,
           get_order/2]).
  
  %% gen_server callbacks
  