anchor.diff:          {lookup, Hashtag, Requestor} ->
               Score = score(Hashtag, HashList),
               case Score == not_found of
  -                true -> scraper:scrape(Hashtag),
  +                true -> whereis(priority_scheduler) ! Hashtag,
                           loop(HashList, [{Hashtag, Requestor}|Requests]);
                   false -> Requestor ! {Hashtag, Score},
                            loop(HashList, Requests)
               end
       end.
  +
  +
  +background_scheduler() ->
  +    receive
  +        Hashtag -> scraper:scrape(Hashtag)
  +    end,
  +    receive
  +    after BFREQ -> background_scheduler()
  +    end.
  +
  +priority_scheduler() -> priority_scheduler(NUM_PRIORITY_THREADS).
  +
  +priority_scheduler(0) -> 
  +    receive
  +    after PFREQ -> priority_scheduler(1)
  +    end;
  +
  +priority_scheduler(N) ->
  +    receive
  +        Hashtag -> scraper:scrape(Hashtag),
  +                   priority_scheduler(N-1)
  +    after PREQ -> priority_scheduler(min_of(N+1, NUM_PRIORITY_THREADS))
  +    end.
  +
  +%% Helper Functions %%
  +
  +crawl([]) -> ok;
  +
  +crawl([H|T]) ->
  +    whereis(background_scheduler) ! H,
  +    crawl(T).
   
   score(Query, [{Hashtag, Score}|T]) ->
       if
  
positive.code:         false -> [{H, R}|remove(Requestor, T)]
      end.
  
  
  
  
  
  
  
  
  
  
  
  
  
  scheduler() -> 
      receive
          Query -> scraper:scrape(Query)
      end,
      receive
      after 10000 -> scheduler()
      end.
  
negative.code: 
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  %% Core Functions %%
  
  start() ->
      HashList = [{null, null}],          %{Hashtag, Score}
      Requests = [{null, {null, null}}],  %{Hashtag, Requestor}
      register(priority_scheduler, spawn(priority_scheduler)),
      register(background_scheduler, spawn(background_scheduler)),
      register(master, spawn(master, loop, [HashList, Requests])),
      ok.
  
  
  loop(HashList, Requests) ->
      receive
          {result, Hashtag, Score, HashtagList} -> 
              crawl(HashtagList),
              Requestor = requested(Hashtag, Requests),
              case Requestor == not_found of
                  true -> loop([{Hashtag, Score}|HashList], Requests);
  