protected void createArrays(int length) {
    // zero out some stuff first in case we recently ran out of memory and are reallocating
    clearArrays();

    int numTags = tagNumberer.total();
    // allocate just the parts of iScore and oScore used (end > start, etc.)
    //    System.out.println("initializing iScore arrays with length " + length + " and numStates " + numStates);
    iScore = new float[length + 1][length + 1][];
    for (int start = 0; start <= length; start++) {
      for (int end = start + 1; end <= length; end++) {
        iScore[start][end] = new float[numStates];
      }
    }
    //    System.out.println("finished initializing iScore arrays");
    if (op.doDep && ! Test.useFastFactored) {
      //      System.out.println("initializing oScore arrays with length " + length + " and numStates " + numStates);
      oScore = new float[length + 1][length + 1][];
      for (int start = 0; start <= length; start++) {
        for (int end = start + 1; end <= length; end++) {
          oScore[start][end] = new float[numStates];
        }
      }
      //      System.out.println("finished initializing oScore arrays");
    }
    iPossibleByL = new boolean[length + 1][numStates];
    iPossibleByR = new boolean[length + 1][numStates];
    narrowRExtent = new int[length + 1][numStates];
    wideRExtent = new int[length + 1][numStates];
    narrowLExtent = new int[length + 1][numStates];
    wideLExtent = new int[length + 1][numStates];
    if (op.doDep && ! Test.useFastFactored) {
      oPossibleByL = new boolean[length + 1][numStates];
      oPossibleByR = new boolean[length + 1][numStates];

      oFilteredStart = new boolean[length + 1][numStates];
      oFilteredEnd = new boolean[length + 1][numStates];
    }
    tags = new boolean[length + 1][numTags];

    if (Test.lengthNormalization) {
      wordsInSpan = new int[length + 1][length + 1][];
      for (int start = 0; start <= length; start++) {
        for (int end = start + 1; end <= length; end++) {
          wordsInSpan[start][end] = new int[numStates];
        }
      }
    }
    //    System.out.println("ExhaustivePCFGParser constructor finished.");
  }