anchor.diff:      lists:reverse(Res).
   
   replace_comment_cache(Thread, CommentId, NewComment) ->
  -    Thread#thread{last_comments = lists:keyreplace(CommentId, 1, Thread#thread.last_comments, NewComment)}.
  +    [First | Rest] = lists:keyreplace(CommentId, 1, 
  +				      [Thread#thread.first_comment | Thread#thread.last_comments], 
  +				      NewComment),
  +    Thread#thread{first_comment=First, last_comments=Rest}.
   
   sort_threads({_, A, _, _}, {_, B, _, _}) ->
       common:now_to_seconds(A) > common:now_to_seconds(B).
  
positive.code:     mnesia:create_table(thread, [{type, ordered_set}, {disc_copies, [node()]}, {attributes, record_info(fields, thread)}]),
      mnesia:create_table(comment, [{type, ordered_set}, {disc_copies, [node()]}, {attributes, record_info(fields, comment)}]).
  
  %%%%%%%%%%%%%%%%%%%% generic actions
  start(BoardName) -> gen_server:start_link({local, BoardName}, ?MODULE, BoardName, []).
  stop(BoardName) -> gen_server:call(BoardName, stop).
  
negative.code: delete(Board, {image, CommentId}) -> 
      gen_server:call(Board, {delete_comment_image, CommentId});
  delete(Board, Id) -> 
      case find_thread(Id) of
  	false -> gen_server:call(Board, {delete_comment, Id});
  	_ -> gen_server:call(Board, {delete_thread, Id})
      end.
  