Index: src/Parser/MpqcParser.cpp
===================================================================
--- src/Parser/MpqcParser.cpp	(revision 214240311376bc0a14571b81249ac930343e5a7b)
+++ src/Parser/MpqcParser.cpp	(revision 69f38a24fc83bffdebbc2578d63ad2bcf4d52b79)
@@ -54,4 +54,5 @@
 #include "molecule.hpp"
 #include "MoleculeListClass.hpp"
+#include "Parser/Exceptions.hpp"
 #include "World.hpp"
 
@@ -85,4 +86,5 @@
   bool MoleculeSection = false;
   bool GeometrySection = false;
+  bool GeometrySection_n = false;
   bool BasisSection = false;
   bool AuxBasisSection = false;
@@ -94,4 +96,5 @@
   boost::char_separator<char> whitesep(" \t");
   ConvertTo<double> toDouble;
+  int old_n = -1; // note down the last parsed "n" to ascertain it's ascending
 
   molecule *newmol = World::getInstance().createMolecule();
@@ -102,5 +105,7 @@
     file->getline(line, MAXSTRINGSIZE-1);
     std::string linestring(line);
-    if ((linestring.find("atoms geometry") == string::npos) && (linestring.find("}") != string::npos)) {
+    if (((linestring.find("atoms") == string::npos)
+        || (linestring.find("geometry") == string::npos))
+        && (linestring.find("}") != string::npos)) {
       GeometrySection = false;
     }
@@ -113,22 +118,52 @@
     if (MoleculeSection) {
       if (GeometrySection) { // we have an atom
+//        LOG(2, "DEBUG: Full line is '" << linestring << "'.");
+        // separate off [..] part
         tokenizer tokens(linestring, sep);
-  //      if (tokens.size() != 2)
-  //        throw MpqcParseException;
-        tokenizer::iterator tok_iter = tokens.begin();
-        ASSERT(tok_iter != tokens.end(),
-            "FormatParser< mpqc >::load() - missing token for MoleculeSection in line "+linestring+"!");
-        std::stringstream whitespacefilter(*tok_iter++);
+        // split part prior to [..] into tokens
+        std::string prior_part(*tokens.begin());
+        tokenizer prefixtokens(prior_part, whitesep);
+        tokenizer::iterator tok_iter = prefixtokens.begin();
+//        LOG(2, "DEBUG: Current tok_iter is " << *tok_iter << ".");
+        if (GeometrySection_n) {
+          ASSERT(tok_iter != prefixtokens.end(),
+              "FormatParser< mpqc >::load() - missing n entry for MoleculeSection in line "
+              +linestring+"!");
+          // if additional n is given, parse and check but discard eventually
+          int n;
+          std::stringstream whitespacefilter(*tok_iter++);
+          whitespacefilter >> ws >> n;
+          if ((old_n != -1) && ((n-1) != old_n))
+            ELOG(2, "n index is not simply ascending by one but "
+                << n-old_n << ", specific ids are lost!");
+          if (old_n >= n) {
+            ELOG(1, "n index is not simply ascending, coordinates might get mixed!");
+            throw ParserException();
+          }
+          old_n = n;
+        }
+        ASSERT(tok_iter != prefixtokens.end(),
+            "FormatParser< mpqc >::load() - missing atoms entry for MoleculeSection in line "
+            +linestring+"!");
+//        LOG(2, "DEBUG: Current tok_iter is " << *tok_iter << ".");
         std::string element;
-        whitespacefilter >> ws >> element;
-        ASSERT(tok_iter != tokens.end(),
-            "FormatParser< mpqc >::load() - missing token for MoleculeSection in line "+linestring+"!");
-        std::string vector = *tok_iter;
+        {
+          std::stringstream whitespacefilter(*tok_iter++);
+          whitespacefilter >> ws >> element;
+        }
+        // split [..] part and parse
+        tok_iter = (++tokens.begin());
+        ASSERT (tok_iter != tokens.end(),
+            "FormatParser< mpqc >::load() - missing geometry entry for MoleculeSection in line "
+            +linestring+"!");
+//        LOG(2, "DEBUG: Current tok_iter is " << *tok_iter << ".");
+        std::string vector(*tok_iter);
         tokenizer vectorcomponents(vector, whitesep);
         Vector X;
-  //      if (vectorcomponents.size() != NDIM)
-  //        throw MpqcParseException;
+//        if (vectorcomponents.size() != NDIM)
+//          throw ParserException();
         tok_iter = vectorcomponents.begin();
         for (int i=0; i<NDIM; ++i) {
+//          LOG(2, "DEBUG: Current tok_iter is " << *tok_iter << ".");
           X[i] = toDouble(*tok_iter++);
         }
@@ -220,6 +255,9 @@
       MoleculeSection = true;
     }
-    if (linestring.find("atoms geometry") != string::npos) {
+    if ((linestring.find("atoms") != string::npos)
+        && (linestring.find("geometry") != string::npos)) {
       GeometrySection = true;
+      if (linestring.find("n") != string::npos) // neither atoms nor geometry contains a letter n
+        GeometrySection_n = true;
     }
     if ((linestring.find("basis<GaussianBasisSet>:") != string::npos) && ((linestring.find("abasis<") == string::npos))) {
