void initFiles() {
    String parentDir = params.sget("Data Dir") + File.separator;
    imFileWd = parentDir + "imWd.txt";
    FileUtil.initFile(
        imFileWd, params, "Stress Met not coarse grained in time, dead sites included");
    imFileNd = parentDir + "imNd.txt";
    FileUtil.initFile(
        imFileNd, params, "Stress Met not coarse grained in time, no dead sites included");

    for (int i = 0; i < pow; i++) {
      int dx = (int) Math.pow(2, i);
      String dirName_wd = parentDir + "wd" + File.separator + "dx" + dx + File.separator;
      FileUtil.makeDirs(dirName_wd);
      String dirName_nd = parentDir + "nd" + File.separator + "dx" + dx + File.separator;
      FileUtil.makeDirs(dirName_nd);
      String im = " Inverse Coarse-grained Metric File: ";
      String nd = " No dead sites included in metric calculation. ";
      String wd = " Dead sites included in metric calculation. ";
      String time = " time (Plate Updates), ";
      String imm = " inverse cg metric.";
      cgFiles[i][0] = dirName_nd + "m.txt";
      FileUtil.initFile(cgFiles[i][0], params, im + nd + time + " stress" + imm);
      cgFiles[i][1] = dirName_wd + "m.txt";
      FileUtil.initFile(cgFiles[i][1], params, im + wd + time + " stress" + imm);
      cgFiles[i][2] = dirName_nd + "a.txt";
      FileUtil.initFile(cgFiles[i][2], params, im + nd + time + " activity" + imm);
      cgFiles[i][3] = dirName_wd + "a.txt";
      FileUtil.initFile(cgFiles[i][3], params, im + wd + time + " activity" + imm);
      cgFiles[i][4] = dirName_nd + "s.txt";
      FileUtil.initFile(cgFiles[i][4], params, im + nd + time + " size-activity" + imm);
      cgFiles[i][5] = dirName_wd + "s.txt";
      FileUtil.initFile(cgFiles[i][5], params, im + wd + time + " size-activity" + imm);
    }
    sizeHistFile = parentDir + "sh.txt";
  }
  void writeAccumulatedData() {
    FileUtil.initFile(sizeHistFile, params, " Avalanch Size Histogram Data File");
    FileUtil.printHistToFile(sizeHistFile, sizeHist);

    for (int i = 0; i < pow; i++) {
      for (int j = 0; j < 4; j++) {
        FileUtil.printAccumToFileNoErrorBars(cgFiles[i][j], cgMetsAcc[i][j]);
      }
    }
    // clear temp accumulators
    for (int i = 0; i < pow; i++) {
      for (int j = 0; j < 4; j++) {
        cgMetsAcc[i][j].clear();
      }
    }
  }