File addConditions(File file, File conditions) {
		// adds a conditions column to the Hb and HbO files
		// the conditions file contains lines of the form:
		//       start stop condition
		// where start to stop is a range of rows in the Hb/HbO file where condition was in effect
		// on each line, start and stop must both be larger than the preceding line
		// any rows not specified in the conditions file will be assigned the default condition 0
		File tempfile = new File("temp");
		try {
			
			BufferedReader creader = new BufferedReader(new FileReader(conditions));
			BufferedReader freader = new BufferedReader(new FileReader(file));
			Scanner scanner = new Scanner(creader);
			BufferedWriter fwriter = new BufferedWriter(new FileWriter(tempfile));
			String line;
			int row = 1;
			int start;
			int stop;
			String condition;
			
			// get rid of max condition
			if (scanner.hasNext())
				scanner.nextInt();
			while (scanner.hasNext()) {
				start = scanner.nextInt();
				stop = scanner.nextInt();
				condition = scanner.next();
				while (row<start) {
					line = freader.readLine();
					fwriter.write(line + "\t0");
					fwriter.newLine();
					row++;
				}
				while (row<=stop) {
					line = freader.readLine();
					fwriter.write(line + "\t" + condition);
					fwriter.newLine();
					row++;
				}
			}
			while ((line = freader.readLine()) != null) {
				fwriter.write(line + "\t0");
				fwriter.newLine();
			}
			
			creader.close();
			freader.close();
			fwriter.close();
			scanner.close();
			
		} catch(IOException ie) {
			ie.printStackTrace();
		}
		return tempfile;
	}