anchor.diff:  %% @doc Return the head of the request queue and the tail of the queue
   %% If the request queue is empty the function will throw a badarg error.
   %% @end
  --spec pop(#requestqueue{}) -> {requestspec(), requestqueue()}.
  +-spec pop(#requestqueue{}) -> {requestspec(), rqueue()}.
   pop(Requestqueue) ->
       #requestqueue{queue=Queue} = Requestqueue,
       case queue:out(Queue) of
  
positive.code: %% The queue returns a new queue including the new request.
  %% @end
  -spec push(pieceindex(), chunkoffset(),
             chunklength(), #requestqueue{}) -> requestqueue().
  push(Pieceindex, Offset, Length, Requestqueue) ->
      #requestqueue{queue=Queue} = Requestqueue,
      NewQueue = queue:in({Pieceindex, Offset, Length}, Queue),
  
negative.code: %% @doc Push a list of requests onto the end of the request queue
  %% The function returns a new queue including the new requests.
  %% @end
  -spec push([requestspec()], #requestqueue{}) -> rqueue().
  push(Requests, Requestqueue) ->
      #requestqueue{queue=Queue} = Requestqueue,
      TmpQueue = queue:from_list(Requests),
  