public void dumpToFile() throws IOException{
		if(outputPath == null){
			Logger.log("No output path provided to Context");
		}

		if(splits==null){
			PrintWriter writer = new PrintWriter(outputPath);
			for(KeyValuePair kvp:list)
				writer.println(kvp.key + ":" + kvp.value);
			writer.close();
		}
		else{
			Logger.log("dumping2");
			Collections.sort(list);
			ArrayList< KeyValuePair<Key, Value> > tempList = new ArrayList< KeyValuePair<Key, Value> >();
			Iterator<KeyValuePair<Key, Value>> iter = list.iterator();
			
			int splitLocation = 0;
			
			while(iter.hasNext()){
				KeyValuePair<Key, Value> kvp = iter.next();
				if(splitLocation<splits.length && kvp.key.compareTo((Key) (((KeyValuePair)splits[splitLocation]).key)  ) > 0 ){
					FileOutputStream fos = new FileOutputStream(outputPath + "_" + splitLocation);
					ObjectOutputStream oos = new ObjectOutputStream(fos);
					oos.writeObject(tempList);
					oos.close();
					
					while(splitLocation<splits.length && kvp.key.compareTo((Key) (((KeyValuePair)splits[splitLocation]).key) ) > 0 )
						splitLocation++;
					tempList = new ArrayList< KeyValuePair<Key, Value> >();
					tempList.add(kvp);
				} else
					tempList.add(kvp);
			}
			
			if(tempList.size() > 0 ){
				FileOutputStream fos = new FileOutputStream(outputPath + "_" + splitLocation);
				ObjectOutputStream oos = new ObjectOutputStream(fos);
				oos.writeObject(tempList);
				oos.close();
			}
		}
	}