public AccessCache buildCache(String[] detailsURIs, String cacheType) throws IOException{
	    AccessCache cache = new AccessCache();
		ArrayList<String> links = new ArrayList<String>();
		ArrayList<String> filter =  new ArrayList<String>();
		ArrayList<String> magnetLinks =  new ArrayList<String>();
		ArrayList<String> size =  new ArrayList<String>();
		ArrayList<String> seeds =  new ArrayList<String>();
		ArrayList<String> leeches =  new ArrayList<String>();
		String URI;
		String pageHTML;
		if (cacheType.toLowerCase().equals("pirate")){
			int pageNumber = 0;
			while(detailsURIs[pageNumber] != null){
				URI = detailsURIs[pageNumber]; //store the URI in a local variable for convenience
				pageHTML = HTTPConnect.getWebPageHTTP(URI); //pull down the html of the page
				filter.add(filter("bad_words.txt",pageHTML));
				links.add(detailsURIs[pageNumber]);
				magnetLinks.add(katSearch.grepMagnetLink(pageHTML));
				size.add(pirateSearch.grepSize(pageHTML));
				seeds.add(pirateSearch.grepSeeds(pageHTML));
				leeches.add(pirateSearch.grepLeeches(pageHTML));
				pageNumber++;
			}
		}
		else if (cacheType.toLowerCase().equals("kat")){
			int pageNumber = 0;
			while(detailsURIs[pageNumber] != null){
				URI = detailsURIs[pageNumber]; //store the URI in a local variable for convenience
				pageHTML = gzippedHTTPConnect.getWebPageGzipHTTP(URI); //pull down the html of the page
				filter.add(filter("bad_words.txt",pageHTML));
				links.add(detailsURIs[pageNumber]);
				magnetLinks.add(katSearch.grepMagnetLink(pageHTML));
				size.add(katSearch.grepSize(pageHTML));
				seeds.add(katSearch.grepSeeds(pageHTML));
				leeches.add(katSearch.grepLeeches(pageHTML));
				pageNumber++;
			}
			
		}
		else {
			return null;
		}
		
		cache.setFilter(filter);
		cache.setLinks(links);
		cache.setMagnetLinks(magnetLinks);
		cache.setSize(size);
		cache.setSeeds(seeds);
		cache.setLeeches(leeches);
		
		return cache;
	}