anchor.diff:      torrent_pid     :: pid(),
       chunk_size      :: pos_integer(),
       %% Piece state sets
  -    pieces_valid    :: pieceset(),
  -    pieces_begun    :: pieceset(),
  -    pieces_assigned :: pieceset(),
  -    pieces_stored   :: pieceset(),
  +    pieces_valid      :: pieceset(),
  +    pieces_unassigned :: pieceset(),
  +    pieces_begun      :: pieceset(),
  +    pieces_assigned   :: pieceset(),
  +    pieces_stored     :: pieceset(),
       %% Chunk sets for pieces
       chunks_assigned :: array(),
       chunks_stored   :: array(),
  
positive.code:                 gb_trees:insert({Index, Offs}, Len, Acc)
              end, OpenReqs, Chunks),
              NewPeers = etorrent_monitorset:update(PeerPid, NewReqs, Peers),
              %% The piece is in the assigned state if this was the last chunk
              NewAssigned = case etorrent_chunkset:size(NewChunkset) of
                  0 -> etorrent_pieceset:insert(Index, Assigned);
                  _ -> Assigned
              end,
  
              NewState = State#state{
                  pieces_begun=NewBegun,
                  pieces_assigned=NewAssigned,
                  chunks_assigned=NewAssignedChunks,
  
negative.code:         torrent_id=TorrentID,
          torrent_pid=TorrentPid,
          chunk_size=ChunkSize,
          %% All Valid pieces stay Valid
          pieces_valid=PiecesValid,
          %% All Invalid pieces are Unassigned
          pieces_unassigned=PiecesInvalid,
          %% No pieces have are yet Begun, Assigned or Stored
          pieces_begun=PiecesNone,
          pieces_assigned=PiecesNone,
          pieces_stored=PiecesNone,
          %% Initially, the sets of assigned and stored chunks are equal
          chunks_assigned=ChunkSets,
          chunks_stored=ChunkSets,
  