@SuppressWarnings("unchecked")
void readBasis() throws Exception {
    Vector sdata = new Vector();
    Vector gdata = new Vector();
    atomCount = -1;
    gaussianCount = 0;
    shellCount = 0;
    String lastAtom = "";
    String[] tokens;
    while (readLine() != null && line.startsWith(" Atom")) {
      shellCount++;
      tokens = getTokens(line);
      Hashtable slater = new Hashtable();
      if (!tokens[1].equals(lastAtom))
        atomCount++;
      lastAtom = tokens[1];
      slater.put("atomIndex", new Integer(atomCount));
      slater.put("basisType", tokens[4]);
      int nGaussians = parseInt(tokens[5]);
      slater.put("gaussianPtr", new Integer(gaussianCount)); // or parseInt(tokens[7]) - 1
      slater.put("nGaussians", new Integer(nGaussians));
      sdata.add(slater);
      gaussianCount += nGaussians;
      for (int i = 0; i < nGaussians; i++)
        gdata.add(getTokens(readLine()));
    }
    if (atomCount == -1)
      atomCount = 0;
    float[][] garray = new float[gaussianCount][];
    for (int i = 0; i < gaussianCount; i++) {
      tokens = (String[]) gdata.get(i);
      garray[i] = new float[tokens.length];
      for (int j = 0; j < tokens.length; j++)
        garray[i][j] = parseFloat(tokens[j]);
    }
    moData.put("shells", sdata);
    moData.put("gaussians", garray);
    logger.log(shellCount + " slater shells read");
    logger.log(gaussianCount + " gaussian primitives read");
  }