public synchronized void retrieve() {
    
    while( !mPendingLinks.isEmpty() && (mRetrievedCount < mMaxPages) ) {
      final String url = mPendingLinks.remove(); //Get next url
      
      //Check the repository first. If the Page has been retrieved before, return it; else retrieve the page and store for future.
      if(!mPageRepos.containsKey(url)) { 
        try {
          //Connect to page and create page object
          Document doc = Jsoup.connect(url).userAgent("Mozilla").get();
          String content = doc.html();
          Page page = new Page(url, content);
          mAvailPages.add(page); //add retrieved page to avail queue
          mPageRepos.put(url, page); //add page to repos
          mRetrievedCount++;
          
        } catch( IOException e ) {
        	//System.err.println(e.toString()); Only use for debugging
        } catch( IllegalArgumentException e){}
      }
    }
  }// End retrieve()