anchor.diff:          infinity ->
               {infinity, fun() -> stop end};
           _ ->
  -            {lists:min([DefaultTimeout, Timeout]), fun() -> stop end}
  +            {lists:min([DefaultTimeout, Timeout]),
  +                fun(UserAcc) -> {stop, UserAcc} end}
           end;
       true ->
  -        {DefaultTimeout, fun() -> Callback(timeout, ResponseType), ok end};
  +        {DefaultTimeout,
  +            fun(UserAcc) -> {ok, Callback(timeout, ResponseType, UserAcc)} end};
       _ ->
           {lists:min([DefaultTimeout, Heartbeat]),
  -            fun() -> Callback(timeout, ResponseType), ok end}
  -    end.
  -
  -start_sending_changes(_Callback, "continuous") ->
  -    ok;
  -start_sending_changes(Callback, ResponseType) ->
  -    Callback(start, ResponseType).
  -
  -send_changes(Args, Callback, Db, StartSeq, Prepend) ->
  +            fun(UserAcc) -> {ok, Callback(timeout, ResponseType, UserAcc)} end}
  +    end.
  +
  +start_sending_changes(_Callback, UserAcc, "continuous") ->
  +    UserAcc;
  +start_sending_changes(Callback, UserAcc, ResponseType) ->
  +    Callback(start, ResponseType, UserAcc).
  +
  +send_changes(Args, Callback, UserAcc, Db, StartSeq, Prepend) ->
       #changes_args{
           style = Style,
           include_docs = IncludeDocs,
  
positive.code: deleted_item(_) -> [].
  
  % waits for a db_updated msg, if there are multiple msgs, collects them.
  wait_db_updated(Timeout, TimeoutFun) ->
      receive db_updated -> get_rest_db_updated()
      after Timeout ->
          case TimeoutFun() of
          ok -> wait_db_updated(Timeout, TimeoutFun);
          stop -> stop
          end
      end.
  
  get_rest_db_updated() ->
      receive db_updated -> get_rest_db_updated()
      after 0 -> updated
      end.
  
negative.code:                 keep_sending_changes(
                      Args#changes_args{limit=NewLimit},
                      Callback,
                      UserAcc3,
                      Db2,
                      EndSeq,
                      Prepend2,
  