anchor.diff:          _ -> 
               false
       end.
  +    
  +%%--------------------------------------------------------------------
  +%% Func: update_late_list/3
  +%% Description: if status is later add to list.
  +%%--------------------------------------------------------------------
  +update_later_list(SSecs, S, Late) ->
  +    {LatestSecs, _} ,
  +    if
  +        SSecs >= LatestSecs ->
  +            gb_trees:insert(SSecs, S, Late),
  +            gb_trees:take_smallest(Late);
  +        true ->
  +            Late
  +    end.
  
positive.code:             later(S, Late)
          end, 
          {}, 
          qlc:q([S || S <- mnesia:table(laconica_statuses), S#laconica_statuses.site =:= Site])).
  
  %%====================================================================
  
negative.code:     S;
  
  older(S, Old) ->  
      SSecs  = date_to_gregorian_seconds(S),
      OldSecs = date_to_gregorian_seconds(Old),
      if 
           SSecs < OldSecs ->
              S;
          true -> 
              Old
      end.
  
  %%--------------------------------------------------------------------
  %% Func: later/2
  %% Description: return later status
  %%--------------------------------------------------------------------
  later(S, {}) ->  
      S;
  
  later(S, Late) ->  
      SSecs   = date_to_gregorian_seconds(S),
      LateSecs = date_to_gregorian_seconds(Late),
      if 
           SSecs > LateSecs ->
              S;
          true -> 
              Late
      end.
      
  %%--------------------------------------------------------------------
  %% Func: later/3
  %% Description: add status to late list if later than any in list
  %%--------------------------------------------------------------------
  later(S, Late, Count) ->
      SSecs   = date_to_gregorian_seconds(S),  
      LateSize = length(Late),
      if
          LateSize < Count ->
              lists:keysort(1, [{SSecs, S} | Late]);
          true ->
              update_later_list(SSecs, S, Late)
      end.
  
  %%--------------------------------------------------------------------
  