anchor.diff:      {noreply, S};
   
   handle_info({tcp, Sock, Data}, S = #state{state=stream, mode=sync, buffer=Buffer}) ->
  -    DataSize = byte_size(Data),
  -    case buffer(DataSize, Data, Buffer) of
  +    case buffer(byte_size(Data), Data, Buffer) of
           {ok, NewBuffer} ->
               ok;
  -        {ok, NewBuffer, Commands} ->
  +        {ok, NewBuffer, Commands, _} ->
               eslaver_utils:callback(S#state.callback, Commands)
       end,
       inet:setopts(Sock, [{active,once}]),
       {noreply, S#state{buffer=NewBuffer}};
   
   handle_info({tcp, Sock, Data}, S = #state{state=stream, mode=psync, buffer=Buffer}) ->
  -    DataSize = byte_size(Data),
  -    NewOffset = (S#state.offset + DataSize),
  -    case buffer(DataSize, Data, Buffer) of
  +    NewOffset = case buffer(byte_size(Data), Data, Buffer) of
           {ok, NewBuffer} ->
  -            ok;
  -        {ok, NewBuffer, Commands} ->
  -            eslaver_utils:callback(S#state.callback, Commands)
  +            S#state.offset;
  +        {ok, NewBuffer, Commands, OffsetSize} ->
  +            eslaver_utils:callback(S#state.callback, Commands),
  +            (S#state.offset + OffsetSize)
       end,
  +    %repl_ack(Sock, NewOffset), % still don't know if putting this here is a good idea
       inet:setopts(Sock, [{active,once}]),
       {noreply, S#state{offset=NewOffset, buffer=NewBuffer}, ?REPL_TIMEOUT};
   
  
positive.code:             {error, Error};
          {tcp, _Sock, <<Bulk/binary>>} ->
              case byte_size(Bulk) of
                  ?BUFF_SIZE ->
                      {ok, load_buffer, Bulk};
                  _ ->
                      {ok, load_stream, Bulk}
  
negative.code:     throw("invalid host or port to connect to").
  
  tcp_connect(Addr, Port) ->
      gen_tcp:connect(Addr, Port, [binary, {active, false}, {buffer, ?BUFFER}]).
  
  rdb_load(Pid) when is_pid(Pid) ->
      RdbFile = config(dbfilename, ?DEFAULT_RDB_FILE),
  