anchor.diff:  %% @doc get keys and versions in a range
   get_range_with_version(DB, Interval) ->
       F = fun ({Key, {Value, WriteLock, ReadLock, Version}}, Data) ->
  -                case intervals:in(Key, Interval) andalso Value =/= empty_val of
  -                    true ->
  -                        [{Key, Value, WriteLock, ReadLock, Version} | Data];
  -                    false ->
  -                        Data
  +                case  Value =/= empty_val
  +                    andalso intervals:in(Key, Interval) of
  +                    true -> [{Key, Value, WriteLock, ReadLock, Version} | Data];
  +                    false -> Data
                   end
           end,
       ?ETS:foldl(F, [], DB).
   
   get_range_only_with_version(DB, Interval) ->
       F = fun ({Key, {Value, WLock, _, Version}}, Data) ->
  -                case WLock == false andalso intervals:in(Key, Interval) andalso Value =/= empty_val of
  -                    true ->
  -                        [{Key, Value, Version} | Data];
  -                    false ->
  -                        Data
  +                case WLock == false
  +                    andalso Value =/= empty_val
  +                    andalso intervals:in(Key, Interval) of
  +                    true -> [{Key, Value, Version} | Data];
  +                    false -> Data
                   end
           end,
       ?ETS:foldl(F, [], DB).
  
positive.code:             {DB, ok};
          [{Key, {_Value, _WriteLock, _ReadLock, _Version}}] ->
              {DB, failed};
          [] ->
              {DB, failed}
      end.
  
  %% @doc unsets a read lock on a key
  
negative.code:         [{Key, {Value, WriteLock, ReadLock, Version}}] ->
              ?ETS:insert(DB, {Key, {Value, WriteLock, ReadLock - 1, Version}}),
              {DB, ok};
          [] -> {DB, failed}
      end.
  
  %% @doc get the locks and version of a key
  