anchor.diff:                end,
     expire_items(Tail, NewResult).
   
  -calculate_ttl(ItemsCount) when is_integer(ItemsCount) ->
  -  ItemsCount * 120 * 1000.
  +calculate_ttl() ->
  +  os:system_time() + get_songs_count() * 120 * 1000.
   
   get_random_movie() ->
     error_logger:info_msg("mnesia:get_random_movie"),
  
positive.code: 
  handle_call({get_random}, _From, RecentMovies) ->
    RandomMovieId = randomize(RecentMovies),
    NewState = lists:append([{RandomMovieId, os:system_time() + calculate_ttl(length(RecentMovies))}], RecentMovies),
    {reply, {ok, RandomMovieId}, NewState}.
  
  randomize(RecentMovies) ->
  
negative.code:   Key = lists:nth(rand:uniform(length(Keys)), Keys),
    [#song{movie_id = MovieId}] = mnesia:dirty_read({song, Key}),
    {ok, MovieId}.
  
  get_songs_count() ->
    length(mnesia:dirty_all_keys(song)).
  
  handle_info(start_expiring_timer, RecentMovies) ->
    spawn_gc(),
  