@SuppressWarnings("unchecked")
void readGaussianBasis() throws Exception {
    Vector sdata = new Vector();
    Vector gdata = new Vector();
    atomCount = 0;
    gaussianCount = 0;
    int nGaussians = 0;
    shellCount = 0;
    String thisShell = "0";
    String[] tokens;
    discardLinesUntilContains("SHELL TYPE PRIMITIVE");
    readLine();
    Hashtable slater = null;
    while (readLine() != null && line.indexOf("TOTAL") < 0) {
      tokens = getTokens(line);
      switch (tokens.length) {
      case 1:
        atomCount++;
      case 0:
        break;
      default:
        if (!tokens[0].equals(thisShell)) {
          if (slater != null) {
            slater.put("nGaussians", new Integer(nGaussians));
            sdata.add(slater);
          }
          thisShell = tokens[0];
          shellCount++;
          slater = new Hashtable();
          slater.put("atomIndex", new Integer(atomCount - 1));
          slater.put("basisType", tokens[1]);
          slater.put("gaussianPtr", new Integer(gaussianCount)); // or parseInt(tokens[2]) - 1
          nGaussians = 0;
        }
        ++nGaussians;
        ++gaussianCount;
        gdata.add(tokens);
      }
    }
    if (slater != null) {
      slater.put("nGaussians", new Integer(nGaussians));
      sdata.add(slater);
    }
    float[][] garray = new float[gaussianCount][];
    for (int i = 0; i < gaussianCount; i++) {
      tokens = (String[]) gdata.get(i);
      garray[i] = new float[tokens.length - 3];
      for (int j = 3; j < tokens.length; j++)
        garray[i][j - 3] = parseFloat(tokens[j]);
    }
    moData.put("shells", sdata);
    moData.put("gaussians", garray);
    logger.log(shellCount + " slater shells read");
    logger.log(gaussianCount + " gaussian primitives read");
  }