anchor.diff:  
   -include("lasp.hrl").
   
  +%% Macros.
  +-define(IMPRESSION_INTERVAL, 1000).
  +-define(LOG_INTERVAL, 10000).
  +
   %% State record.
  --record(state, {cache}).
  +-record(state, {actor, cache, impressions}).
   
   %%%===================================================================
   %%% API
  
positive.code: %%
  %% -------------------------------------------------------------------
  
  -module(lasp_advertisement_counter_client).
  -author("Christopher Meiklejohn <christopher.meiklejohn@gmail.com>").
  
  
negative.code: 
  %% @private
  -spec handle_info(term(), #state{}) -> {noreply, #state{}}.
  handle_info(log, #state{impressions=Impressions}=State) ->
      lager:info("Impressions: ~p", [Impressions]),
  
      %% Schedule advertisement counter impression.
      schedule_logging(),
  
      {noreply, State};
  handle_info(view, #state{actor=Actor, impressions=Impressions, cache=Cache}=State0) ->
      %% Find list of ads in the cache.
      State = case dict:find({?ADS_WITH_CONTRACTS, ?SET_TYPE}, Cache) of
          {ok, {_Id, Type, _Metadata, Value}} ->
              %% Get value.
              Ads = lasp_type:query(Type, Value),
  
              %% Select random.
              Random = lasp_support:puniform(sets:size(Ads)),
  
              %% @todo Exposes internal details of record.
              {{ad, _, _, Counter},
               _Contract} = lists:nth(Random, sets:to_list(Ads)),
  
              %% Increment counter.
              {ok, _} = lasp:update(Counter, increment, Actor),
  
              %% Increment impressions.
              State0#state{impressions=Impressions+1};
          error ->
              exit(no_ads)
      end,
  
      %% Schedule advertisement counter impression.
      schedule_impression(),
  
      {noreply, State};
  handle_info({Id, _Type, _Metadata, Value}=Result,
              #state{cache=Cache0}=State) ->
      %% Update cache.
      Cache = dict:store(Id, Result, Cache0),
  
      %% Schedule initial state transfer for counters.
      refresh_advertisement_counters(Value),
  
      {noreply, State#state{cache=Cache}};
  handle_info(Msg, State) ->
  