anchor.diff:  % this is a stub just to make the tests runable
   find(Conn, Type, Conditions, Max, Skip, Sort, SortOrder) ->
       Bucket = type_to_bucket_name(Type), % return bucket name into list type
  -    {ok, Keys} = get_keys(Conn, Conditions, Bucket),
  -    Records = find_acc(Conn, atom_to_list(Type), Keys, []),
  -    Sorted = if
  -        is_atom(Sort) ->
  -            lists:sort(fun (A, B) ->
  -                        case SortOrder of
  -                            ascending  -> A:Sort() =< B:Sort();
  -                            descending -> A:Sort() > B:Sort()
  -                        end
  -                end,
  -                Records);
  -        true -> Records
  +    case Max of
  +      all ->
  +        Limit = 10;
  +      Max ->
  +        Limit = Max
       end,
  -    case Max of
  -        all -> lists:nthtail(Skip, Sorted);
  -        Max when Skip < length(Sorted) ->
  -            lists:sublist(Sorted, Skip + 1, Max);
  -        _ ->
  -            []
  -    end.
  +
  +    case Sort of
  +      id -> SortField = "_yz_id desc";
  +      Field -> SortField = atom_to_list(Field)
  +    end,
  +    {ok, Keys} = get_keys(Conn, Conditions, Bucket, Limit, Skip, SortField),
  +    find_acc(Conn, atom_to_list(Type), Keys, []).
   
   get_keys(Conn, [], Bucket) ->
       riakc_pb_socket:list_keys(Conn, Bucket);
  
positive.code:         lists:all(fun({_, _}) -> true;
              (_)      -> false
          end,
          List).
negative.code: 			   proplists:get_value(<<"_yz_rk">>, X)
  		   end, KeysExt)}.
  
  get_keys(Conn, Conditions, Bucket, Max, Skip, Sort) ->
    {ok, {search_results, KeysExt, _, _}} = riakc_pb_socket:search(
      Conn, list_to_binary(Bucket), list_to_binary(build_search_query(Conditions)), [{rows, Max}, {start, Skip}, {sort, Sort}]),
    {ok, lists:map(fun ({_,X}) ->
      proplists:get_value(<<"_yz_rk">>, X)
    end, KeysExt)}.
  
  % this is a stub just to make the tests runable
  count(Conn, Type, Conditions) ->
  