Index: src/ConfigFileBuffer.cpp
===================================================================
--- src/ConfigFileBuffer.cpp	(revision 03c77c8433e48594a1c472d7a86b4e799d81c363)
+++ src/ConfigFileBuffer.cpp	(revision 6a465e4248cc6569f489730a4176224357fc5126)
@@ -20,4 +20,8 @@
 #include "CodePatterns/MemDebug.hpp"
 
+#include <iostream>
+#include <boost/tokenizer.hpp>
+#include <string>
+
 #include "ConfigFileBuffer.hpp"
 #include "Helpers/helpers.hpp"
@@ -31,34 +35,61 @@
  */
 struct IonTypeCompare {
-  bool operator()(const char* s1, const char *s2) const {
-    char number1[8];
-    char number2[8];
-    const char *dummy1, *dummy2;
-    //Log() << Verbose(0) << s1 << "  " << s2 << endl;
-    dummy1 = strchr(s1, '_')+sizeof(char)*5;  // go just after "Ion_Type"
-    dummy2 = strchr(dummy1, '_');
-    strncpy(number1, dummy1, dummy2-dummy1); // copy the number
-    number1[dummy2-dummy1]='\0';
-    dummy1 = strchr(s2, '_')+sizeof(char)*5;  // go just after "Ion_Type"
-    dummy2 = strchr(dummy1, '_');
-    strncpy(number2, dummy1, dummy2-dummy1); // copy the number
-    number2[dummy2-dummy1]='\0';
-    if (atoi(number1) != atoi(number2))
-      return (atoi(number1) < atoi(number2));
+  bool operator()(std::string s1, std::string s2) const {
+    ConvertTo<int> toInt;
+    boost::char_separator<char> sep("_");
+    tokenizer tokens1(s1,sep);
+    tokenizer tokens2(s2,sep);
+    tokenizer::iterator tok_iter1 = tokens1.begin();
+    tokenizer::iterator tok_iter2 = tokens2.begin();
+    ++tok_iter1;
+    ++tok_iter2;
+
+    std::string element1(*tok_iter1++);
+    std::string element2(*tok_iter2++);
+    int elementno1 = toInt(element1.substr(4,string::npos));
+    int elementno2 = toInt(element2.substr(4,string::npos));
+    if (elementno1 != elementno2)
+      return elementno1 < elementno2;
     else {
-      dummy1 = strchr(s1, '_')+sizeof(char);
-      dummy1 = strchr(dummy1, '_')+sizeof(char);
-      dummy2 = strchr(dummy1, ' ') < strchr(dummy1, '\t') ? strchr(dummy1, ' ') : strchr(dummy1, '\t');
-      strncpy(number1, dummy1, dummy2-dummy1); // copy the number
-      number1[dummy2-dummy1]='\0';
-      dummy1 = strchr(s2, '_')+sizeof(char);
-      dummy1 = strchr(dummy1, '_')+sizeof(char);
-      dummy2 = strchr(dummy1, ' ') < strchr(dummy1, '\t') ? strchr(dummy1, ' ') : strchr(dummy1, '\t');
-      strncpy(number2, dummy1, dummy2-dummy1); // copy the number
-      number2[dummy2-dummy1]='\0';
-      return (atoi(number1) < atoi(number2));
+      std::string atom1(*tok_iter1);
+      std::string atom2(*tok_iter2);
+      int atomno1 = toInt(atom1);
+      int atomno2 = toInt(atom2);
+      return atomno1 < atomno2;
     }
-  }
+
+//    char number1[8];
+//    char number2[8];
+//    const char *dummy1 = s1.c_str();
+//    const char *dummy2 = s2.c_str();
+//    //Log() << Verbose(0) << s1 << "  " << s2 << endl;
+//    dummy1 = strchr(s1, '_')+sizeof(char)*5;  // go just after "Ion_Type"
+//    dummy2 = strchr(dummy1, '_');
+//    strncpy(number1, dummy1, dummy2-dummy1); // copy the number
+//    number1[dummy2-dummy1]='\0';
+//    dummy1 = strchr(s2, '_')+sizeof(char)*5;  // go just after "Ion_Type"
+//    dummy2 = strchr(dummy1, '_');
+//    strncpy(number2, dummy1, dummy2-dummy1); // copy the number
+//    number2[dummy2-dummy1]='\0';
+//    if (atoi(number1) != atoi(number2))
+//      return (atoi(number1) < atoi(number2));
+//    else {
+//      dummy1 = strchr(s1, '_')+sizeof(char);
+//      dummy1 = strchr(dummy1, '_')+sizeof(char);
+//      dummy2 = strchr(dummy1, ' ') < strchr(dummy1, '\t') ? strchr(dummy1, ' ') : strchr(dummy1, '\t');
+//      strncpy(number1, dummy1, dummy2-dummy1); // copy the number
+//      number1[dummy2-dummy1]='\0';
+//      dummy1 = strchr(s2, '_')+sizeof(char);
+//      dummy1 = strchr(dummy1, '_')+sizeof(char);
+//      dummy2 = strchr(dummy1, ' ') < strchr(dummy1, '\t') ? strchr(dummy1, ' ') : strchr(dummy1, '\t');
+//      strncpy(number2, dummy1, dummy2-dummy1); // copy the number
+//      number2[dummy2-dummy1]='\0';
+//      return (atoi(number1) < atoi(number2));
+//    }
+  }
+
+  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
 };
+
 
 /** Constructor for ConfigFileBuffer class.
@@ -182,21 +213,33 @@
 void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms)
 {
-  map<const char *, int, IonTypeCompare> IonTypeLineMap;
+  std::multimap<std::string, int, IonTypeCompare> IonTypeLineMap;
   if (!MappingAllocated) {
     InitMapping();
   }
 
+  typedef boost::tokenizer<boost::char_separator<char> >
+      tokenizer;
+  boost::char_separator<char> sep("\t ");
+
   // put all into hashed map
-  for (int i=0; i<NoAtoms; ++i) {
-    IonTypeLineMap.insert(pair<const char *, int> (buffer[CurrentLine+i], CurrentLine+i));
-  }
-
-  // fill map
+  for (int i=CurrentLine; i<NoLines; ++i) {
+    std::string line(buffer[i]);
+    tokenizer tokens(line, sep);
+    if (tokens.begin() != tokens.end()) {
+      const std::string token = *tokens.begin();
+      if (token.find("Ion_Type") != string::npos) {
+        IonTypeLineMap.insert(pair<std::string, int> (token, i));
+      }
+    }
+  }
+
+  // fill map (aka IonType1_1, IonType1_1, IonType1_1, IonType1_2, IonType1_2, IonType1_2, ...
+  // ..., IonType2_1, IonType2_1, IonType2_1, ...)
   int nr=0;
-  for (map<const char *, int, IonTypeCompare>::iterator runner = IonTypeLineMap.begin(); runner != IonTypeLineMap.end(); ++runner) {
+  for (map<std::string, int, IonTypeCompare>::iterator runner = IonTypeLineMap.begin(); runner != IonTypeLineMap.end(); ++runner) {
     if (CurrentLine+nr < NoLines)
       LineMapping[CurrentLine+(nr++)] = runner->second;
     else {
-      DoeLog(0) && (eLog()<< Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl);
+      DoeLog(0) && (eLog()<< Verbose(0) << "config::MapIonTypesInBuffer - NoLines is wrong: We are past the end of the file!" << endl);
       performCriticalExit();
     }
Index: src/Parser/unittests/ParserPcpUnitTest.cpp
===================================================================
--- src/Parser/unittests/ParserPcpUnitTest.cpp	(revision 03c77c8433e48594a1c472d7a86b4e799d81c363)
+++ src/Parser/unittests/ParserPcpUnitTest.cpp	(revision 6a465e4248cc6569f489730a4176224357fc5126)
@@ -111,5 +111,5 @@
 Ion_Type2\t1\t8\t1.0\t3\t3\t15.999\tOxygen\tO\n\
 #Ion_TypeNr._Nr.R[0]\tR[1]\tR[2]\tMoveType (0 MoveIon, 1 FixedIon)\n\
-Ion_Type2_1\t0.000000000\t0.000000000\t0.000000000\t0 # molecule nr 0\n\
+Ion_Type2_1\t1.000000000\t0.000000000\t0.000000000\t0 # molecule nr 0\n\
 Ion_Type1_1\t0.758602\t0.000000000\t0.504284\t0 # molecule nr 1\n\
 Ion_Type1_2\t0.758602\t0.000000000\t-0.504284\t0 # molecule nr 2\n";
Index: src/config.cpp
===================================================================
--- src/config.cpp	(revision 03c77c8433e48594a1c472d7a86b4e799d81c363)
+++ src/config.cpp	(revision 6a465e4248cc6569f489730a4176224357fc5126)
@@ -21,4 +21,7 @@
 #include <stdio.h>
 #include <cstring>
+#include <iostream>
+#include <boost/tokenizer.hpp>
+#include <string>
 
 //#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
@@ -457,11 +460,9 @@
   int MaxTypes = 0;
   const element *elementhash[MAX_ELEMENTS];
-  char name[MAX_ELEMENTS];
-  char keyword[MAX_ELEMENTS];
+  char name[MAXSTRINGSIZE];
+  char keyword[MAXSTRINGSIZE];
   int Z = -1;
   int No[MAX_ELEMENTS];
-  int verbose = 0;
-  Vector tempVector;
-  int _fixedion;
+  int verbose = DoLog(4);
   double value[3];
 
@@ -487,5 +488,5 @@
       NoAtoms += No[i];
     }
-    int repetition = 0; // which repeated keyword shall be read
+    int repetition = -1; // which repeated keyword shall be read
 
     // sort the lines via the LineMapping
@@ -499,125 +500,227 @@
     //Log() << Verbose(0) << FileBuffer->buffer[ FileBuffer->LineMapping[FileBuffer->CurrentLine]];
     FileBuffer->MapIonTypesInBuffer(NoAtoms);
-    //for (int i=0; i<(NoAtoms < 100 ? NoAtoms : 100 < 100 ? NoAtoms : 100);++i) {
-    //  Log() << Verbose(0) << FileBuffer->buffer[ FileBuffer->LineMapping[FileBuffer->CurrentLine+i]];
-    //}
+    for (int i=FileBuffer->CurrentLine; i<FileBuffer->NoLines;++i) {
+      Log() << Verbose(0) << FileBuffer->buffer[ FileBuffer->LineMapping[i] ];
+    }
 
     map<int, atom *> AtomList[MaxTypes];
     map<int, atom *> LinearList;
     atom *neues = NULL;
-    Vector position;
-    if (!FastParsing) {
-      // parse in trajectories
-      bool status = true;
-      while (status) {
-        DoLog(0) && (Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl);
-        for (int i=0; i < MaxTypes; i++) {
-          sprintf(name,"Ion_Type%i",i+1);
-          for(int j=0;j<No[i];j++) {
-            sprintf(keyword,"%s_%i",name, j+1);
-            if (repetition == 0) {
-              neues = World::getInstance().createAtom();
-              AtomList[i][j] = neues;
-              LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
-              neues->setType(elementhash[i]); // find element type
-            } else
-              neues = AtomList[i][j];
-            status = (status &&
-                    ParseForParameter(verbose,FileBuffer, keyword, 0, 1, 1, double_type, &position[0], 1, (repetition == 0) ? critical : optional) &&
-                    ParseForParameter(verbose,FileBuffer, keyword, 0, 2, 1, double_type, &position[1], 1, (repetition == 0) ? critical : optional) &&
-                    ParseForParameter(verbose,FileBuffer, keyword, 0, 3, 1, double_type, &position[2], 1, (repetition == 0) ? critical : optional) &&
-                    ParseForParameter(verbose,FileBuffer, keyword, 0, 4, 1, int_type, &_fixedion, 1, (repetition == 0) ? critical : optional));
-            if (!status)
+    Vector tempVector;
+    int _fixedion;
+
+    typedef boost::tokenizer<boost::char_separator<char> >
+        tokenizer;
+    boost::char_separator<char> sep("\t ");
+    ConvertTo<double> toDouble;
+    ConvertTo<int> toInt;
+
+    for (int i=0; i < MaxTypes; i++) {
+      for(int j=0;j<No[i];j++) {
+        int step = 0;
+        std::stringstream keyword_stream;
+        keyword_stream << "Ion_Type" << i+1 << "_" << j+1;
+        const std::string keyword = keyword_stream.str();
+        DoLog(3) && (Log() << Verbose(3) << "INFO: Parsing for " << keyword << "." << std::endl);
+        while (true) {
+          const std::string line(FileBuffer->buffer[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ]);
+          const std::string line_without_comment = line.substr(0,line.find("#"));
+          tokenizer tokens(line_without_comment, sep);
+          if (tokens.begin() != tokens.end()) {
+            tokenizer::iterator tok_iter = tokens.begin();
+            const std::string token = *tok_iter++;
+            if (token == keyword) {
+              DoLog(3) && (Log() << Verbose(3) << "INFO: Found keyword " << keyword << " in line " << FileBuffer->CurrentLine << std::endl);
+              if (step == 0) {
+                neues = World::getInstance().createAtom();
+                AtomList[i][j] = neues;
+                std::cout << "filling LinearList [ (FileBuffer->LineMapping[" << FileBuffer->CurrentLine << "]) = " << FileBuffer->LineMapping[FileBuffer->CurrentLine] << " with " << neues << endl;
+                LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
+                neues->setType(elementhash[i]); // find element type
+              } else
+                neues = AtomList[i][j];
+
+              // count tokens
+              size_t tokens_size = 0;
+              for (tokenizer::iterator tokiter = tokens.begin(); tokiter != tokens.end(); ++tokiter)
+                ++tokens_size;
+              DoLog(3) && (Log() << Verbose(3) << "INFO: Line contains " << tokens_size << " tokens." << std::endl);
+              // and parse
+              if (tokens_size >= 5) { // only AtomicPosition and FixedIon
+                DoLog(3) && (Log() << Verbose(3) << "INFO: Parsing AtomicPosition and FixedIon" << std::endl);
+                for (int i=0;i<NDIM;++i)
+                  tempVector[i] = toDouble(*tok_iter++);
+                neues->setPositionAtStep(step, tempVector);
+                _fixedion = toInt(*tok_iter++);
+                neues->setFixedIon(_fixedion == 1);
+              }
+              if (tokens_size >= 8) { // AtomicVelocity
+                DoLog(3) && (Log() << Verbose(3) << "INFO: Parsing AtomicVelocity" << std::endl);
+                for (int i=0;i<NDIM;++i)
+                  tempVector[i] = toDouble(*tok_iter++);
+                neues->setAtomicVelocityAtStep(step, tempVector);
+              }
+              if (tokens_size >= 11) {  // AtomicForce
+                DoLog(3) && (Log() << Verbose(3) << "INFO: Parsing AtomicForce" << std::endl);
+                for (int i=0;i<NDIM;++i)
+                  tempVector[i] = toDouble(*tok_iter++);
+                neues->setAtomicForceAtStep(step, tempVector);
+              }
+              std::stringstream output;
+              output << "Parsed position of step " << (step+1) << ": ";
+              output << neues->getPositionAtStep(step);          // next step
+              output << "\t";
+              output << (neues->getFixedIon() ? "true" : "false");
+              output << "\t";
+              output << neues->getAtomicVelocityAtStep(step);          // next step
+              output << "\t";
+              output << neues->getAtomicForceAtStep(step);          // next step
+              DoLog(2) && (Log() << Verbose(2) << output.str() << endl);
+
+              step++;
+            } else {
+              if ((repetition > step) || (repetition == -1))
+                repetition = step;
               break;
-
-            // check size of vectors
-            if (neues->getTrajectorySize() <= (unsigned int)(repetition)) {
-              //Log() << Verbose(0) << "Increasing size for trajectory array of " << keyword << " to " << (repetition+10) << "." << endl;
-              neues->ResizeTrajectory(repetition+1);
-              neues->ResizeTrajectory(repetition+1);
-              neues->ResizeTrajectory(repetition+1);
             }
-            neues->setFixedIon(_fixedion);
-            neues->setPositionAtStep(repetition,position);
-
-            // parse velocities if present
-            tempVector.Zero();
-            if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &tempVector[0], 1,optional))
-              tempVector[0] = 0.;
-            if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &tempVector[1], 1,optional))
-              tempVector[1] = 0.;
-            if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &tempVector[2], 1,optional))
-              tempVector[2] = 0.;
-            neues->setAtomicVelocityAtStep(repetition, tempVector);
-
-            // parse forces if present
-            tempVector.Zero();
-            if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 8, 1, double_type, &tempVector[0], 1,optional))
-              tempVector[0] = 0.;
-            if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 9, 1, double_type, &tempVector[1], 1,optional))
-              tempVector[1] = 0.;
-            if(!ParseForParameter(verbose,FileBuffer, keyword, 1, 10, 1, double_type, &tempVector[2], 1,optional))
-              tempVector[2] = 0.;
-            neues->setAtomicForceAtStep(repetition, tempVector);
-
-  //            Log() << Verbose(0) << "Parsed position of step " << (repetition) << ": (";
-  //            Log() << Verbose(0) << neues->getPosition(repetition) << " ";          // next step
-  //            Log() << Verbose(0) << neues->getAtomicVelocity(repetition) << " ";          // next step
-  //            Log() << Verbose(0) << neues->getAtomicForce(repetition) << " ";          // next step
-  //            Log() << Verbose(0) << ")" << endl;
           }
-        }
-        repetition++;
-      }
-      repetition--;
-      DoLog(0) && (Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl);
-      if (repetition <= 1)  // if onyl one step, desactivate use of trajectories
-        mol->MDSteps = 0;
-      else
-        mol->MDSteps = repetition;
-    } else {
-      // find the maximum number of MD steps so that we may parse last one (Ion_Type1_1 must always be present, because is the first atom)
-      repetition = 0;
-      while ( ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 1, 1, double_type, &value[0], repetition, (repetition == 0) ? critical : optional) &&
-              ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 2, 1, double_type, &value[1], repetition, (repetition == 0) ? critical : optional) &&
-              ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 3, 1, double_type, &value[2], repetition, (repetition == 0) ? critical : optional))
-        repetition++;
-      DoLog(0) && (Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl);
-      // parse in molecule coordinates
-      for (int i=0; i < MaxTypes; i++) {
-        sprintf(name,"Ion_Type%i",i+1);
-        for(int j=0;j<No[i];j++) {
-          sprintf(keyword,"%s_%i",name, j+1);
-          if (repetition == 0) {
-            neues = World::getInstance().createAtom();
-            AtomList[i][j] = neues;
-            LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
-            neues->setType(elementhash[i]); // find element type
-          } else
-            neues = AtomList[i][j];
-          // then parse for each atom the coordinates as often as present
-          tempVector.Zero();
-          ParseForParameter(verbose,FileBuffer, keyword, 0, 1, 1, double_type, &tempVector[0], repetition,critical);
-          ParseForParameter(verbose,FileBuffer, keyword, 0, 2, 1, double_type, &tempVector[1], repetition,critical);
-          ParseForParameter(verbose,FileBuffer, keyword, 0, 3, 1, double_type, &tempVector[2], repetition,critical);
-          neues->setPosition(tempVector);
-          // fixed ion
-          ParseForParameter(verbose,FileBuffer, keyword, 0, 4, 1, int_type, &_fixedion, repetition,critical);
-          neues->setFixedIon(_fixedion);
-          // and velocity
-          tempVector.Zero();
-          if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &tempVector[0], repetition,optional))
-            tempVector[0] = 0.;
-          if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &tempVector[1], repetition,optional))
-            tempVector[1] = 0.;
-          if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &tempVector[2], repetition,optional))
-            tempVector[2] = 0.;
-          neues->setAtomicVelocity(tempVector);
-          // here we don't care if forces are present (last in trajectories is always equal to current position)
-          neues->setType(elementhash[i]); // find element type
-          mol->AddAtom(neues);
+          FileBuffer->CurrentLine++;
         }
       }
     }
+
+    if (repetition <= 1)  // if onyl one step, desactivate use of trajectories
+      mol->MDSteps = 0;
+    else {
+      DoLog(0) && (Log() << Verbose(0) << "Found " << repetition << " trajectory step(s)." << endl);
+      mol->MDSteps = repetition;
+    }
+
+//    if (!FastParsing) {
+//      // parse in trajectories
+//      bool status = true;
+//      while (status) {
+//        DoLog(0) && (Log() << Verbose(0) << "Currently checking on MD step " << repetition+1 << "." << endl);
+//        for (int i=0; i < MaxTypes; i++) {
+//          sprintf(name,"Ion_Type%i",i+1);
+//          for(int j=0;j<No[i];j++) {
+//            sprintf(keyword,"%s_%i",name, j+1);
+//            DoLog(3) && (Log() << Verbose(3) << "Looking for " << keyword << " of " << (repetition) << " repetition." << std::endl);
+//            DoLog(3) && (Log() << Verbose(3) << "INFO: Parsing AtomicPosition." << std::endl);
+//            for (int k=0;k<NDIM;++k) { // repetition=1 is correct, as we advance eventually by sequential=1!
+//              status = status && ParseForParameter(verbose,FileBuffer, (const char*)keyword, 0, 1+k, 1, double_type, &tempVector[k], 1, (repetition == 0) ? critical : optional);
+//            }
+//            if (!status)
+//              break;
+//
+//            if (repetition == 0) {
+//              neues = World::getInstance().createAtom();
+//              AtomList[i][j] = neues;
+//              std::cout << "filling LinearList [ (FileBuffer->LineMapping[" << FileBuffer->CurrentLine << "]) = " << FileBuffer->LineMapping[FileBuffer->CurrentLine] << " with " << neues << endl;
+//              LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
+//              neues->setType(elementhash[i]); // find element type
+//            } else
+//              neues = AtomList[i][j];
+//
+//            DoLog(3) && (Log() << Verbose(3) << "INFO: Parsing FixedIon." << std::endl);
+//            status = status && ParseForParameter(verbose,FileBuffer, (const char*)keyword, 0, 4, 1, int_type, &_fixedion, 1, (repetition == 0) ? critical : optional);
+//            neues->setFixedIon(_fixedion == 1);
+//
+//            // check size of vectors
+//            if (neues->getTrajectorySize() <= (unsigned int)(repetition)) {
+//              neues->ResizeTrajectory(repetition+10);
+//              //Log() << Verbose(0) << "Increasing size for trajectory array of " << keyword << " to " << (repetition+10) << "." << endl;
+//            }
+//
+//            // put into trajectories list
+//            neues->setPosition(repetition, tempVector);
+//
+//            // parse velocities if present
+//            DoLog(3) && (Log() << Verbose(3) << "INFO: Parsing AtomicVelocity." << std::endl);
+//            bool velocityStatus = true;
+//            for (int k=0;k<NDIM;++k)
+//              velocityStatus = velocityStatus && ParseForParameter(verbose,FileBuffer, (const char*)keyword, 0, 5+k, 1, double_type, &tempVector[k], 1,optional);
+//            if (!velocityStatus) {
+//              neues->setAtomicVelocity(repetition, zeroVec);
+//            } else
+//              neues->setAtomicVelocity(repetition, tempVector);
+//
+//            // parse forces if present
+//            DoLog(3) && (Log() << Verbose(3) << "INFO: Parsing AtomicForce." << std::endl);
+//            bool forceStatus = true;
+//            for (int k=0;k<NDIM;++k)
+//              forceStatus = forceStatus && ParseForParameter(verbose,FileBuffer, (const char*)keyword, (k==(NDIM-1)) ? 1 : 0, 8+k, 1, double_type, &tempVector[k], 1,optional);
+//            if (!forceStatus) {
+//              ++FileBuffer->CurrentLine;  // as above sequential=1 did not apply due to end of file
+//              neues->setAtomicForce(repetition, zeroVec);
+//            } else {
+//              neues->setAtomicForce(repetition, tempVector);
+//            }
+//
+//            std::stringstream output;
+//            output << "Parsed position of step " << (repetition+1) << ": ";
+//            output << neues->getPosition(repetition);          // next step
+//            output << "\t";
+//            output << (neues->getFixedIon() ? "true" : "false");
+//            output << "\t";
+//            output << neues->getAtomicVelocity(repetition);          // next step
+//            output << "\t";
+//            output << neues->getAtomicForce(repetition);          // next step
+//            DoLog(2) && (Log() << Verbose(2) << output.str() << endl);
+//          }
+//        }
+//        repetition++;
+//      }
+//      repetition--;
+//      if (repetition <= 1)  // if onyl one step, desactivate use of trajectories
+//        mol->MDSteps = 0;
+//      else {
+//        DoLog(0) && (Log() << Verbose(0) << "Found " << repetition+1 << " trajectory step(s)." << endl);
+//        mol->MDSteps = repetition;
+//      }
+//    } else {
+//      // find the maximum number of MD steps so that we may parse last one (Ion_Type1_1 must always be present, because is the first atom)
+//      repetition = 0;
+//      while ( ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 1, 1, double_type, &value[0], repetition, (repetition == 0) ? critical : optional) &&
+//              ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 2, 1, double_type, &value[1], repetition, (repetition == 0) ? critical : optional) &&
+//              ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 3, 1, double_type, &value[2], repetition, (repetition == 0) ? critical : optional))
+//        repetition++;
+//      DoLog(0) && (Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl);
+//      // parse in molecule coordinates
+//      for (int i=0; i < MaxTypes; i++) {
+//        sprintf(name,"Ion_Type%i",i+1);
+//        for(int j=0;j<No[i];j++) {
+//          sprintf(keyword,"%s_%i",name, j+1);
+//          if (repetition == 0) {
+//            neues = World::getInstance().createAtom();
+//            AtomList[i][j] = neues;
+//            LinearList[ FileBuffer->LineMapping[FileBuffer->CurrentLine] ] = neues;
+//            neues->setType(elementhash[i]); // find element type
+//          } else
+//            neues = AtomList[i][j];
+//          // then parse for each atom the coordinates as often as present
+//          ParseForParameter(verbose,FileBuffer, keyword, 0, 1, 1, double_type, &tempVector[0], repetition,critical);
+//          ParseForParameter(verbose,FileBuffer, keyword, 0, 2, 1, double_type, &tempVector[1], repetition,critical);
+//          ParseForParameter(verbose,FileBuffer, keyword, 0, 3, 1, double_type, &tempVector[2], repetition,critical);
+//          neues->setPosition(tempVector);
+//          bool _fixedion;
+//          ParseForParameter(verbose,FileBuffer, keyword, 0, 4, 1, int_type, &_fixedion, repetition,critical);
+//          neues->setFixedIon(_fixedion);
+//          bool velocityStatus = true;
+//          velocityStatus = velocityStatus &&
+//              ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &tempVector[0], repetition,optional) &&
+//              ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &tempVector[1], repetition,optional) &&
+//              ParseForParameter(verbose,FileBuffer, keyword, 1, 7, 1, double_type, &tempVector[2], repetition,optional);
+//          if (!velocityStatus)
+//            neues->setAtomicVelocity(zeroVec);
+//          else
+//            neues->setAtomicVelocity(tempVector);
+//
+//          // here we don't care if forces are present (last in trajectories is always equal to current position)
+//          neues->setType(elementhash[i]); // find element type
+//          mol->AddAtom(neues);
+//        }
+//      }
+//    }
     // put atoms into the molecule in their original order
     for(map<int, atom*>::iterator runner = LinearList.begin(); runner != LinearList.end(); ++runner) {
@@ -1458,16 +1561,16 @@
   char *dummy1 = NULL;
   char *dummy = NULL;    // pointers in the line that is read in per step
-
-  //fprintf(stderr,"Parsing for %s\n",name);
+  char *free_dummy = NULL;
+
+  if (verbose) fprintf(stderr,"Begin of Parsing for %s\n",name);
   if (repetition == 0)
     //Error(SomeError, "ParseForParameter(): argument repetition must not be 0!");
     return 0;
 
-  int line = 0; // marks line where parameter was found
   int found = (type >= grid) ? 0 : (-yth + 1);  // marks if yth parameter name was found
   while((found != repetition)) {
     dummy1 = dummy = NULL;
     do {
-      dummy1 = FileBuffer->buffer[ FileBuffer->LineMapping[FileBuffer->CurrentLine++] ];
+      free_dummy = dummy1 = FileBuffer->buffer[ FileBuffer->LineMapping[FileBuffer->CurrentLine++] ];
       if (FileBuffer->CurrentLine >= FileBuffer->NoLines) {
         if ((critical) && (found == 0)) {
@@ -1476,4 +1579,5 @@
           exit(255);
         } else {
+          //fprintf(stdout,"Rewinding to OldCurrentLine due to search till end of file.\n");
           FileBuffer->CurrentLine = OldCurrentLine; // rewind to start position
           return 0;
@@ -1481,9 +1585,9 @@
       }
       if (dummy1 == NULL) {
-        if (verbose) fprintf(stderr,"Error reading line %i\n",line);
+        if (verbose) fprintf(stderr,"Error reading line %i\n",FileBuffer->CurrentLine);
       } else {
-        //fprintf(stderr,"Now parsing the line %i: %s\n", line, dummy1);
+        if (verbose) fprintf(stderr,"Now parsing the line %i: %s\n", FileBuffer->CurrentLine, dummy1);
       }
-      line++;
+      //FileBuffer->CurrentLine++;
     } while (dummy1 != NULL && ((dummy1[0] == '#') || (dummy1[0] == '\0'))); // skip commentary and empty lines
 
@@ -1501,5 +1605,5 @@
         //Error(FileOpenParams, NULL);
       } else {
-        //fprintf(stderr,"found tab at %i\n",(char *)dummy-(char *)dummy1);
+        if (verbose) fprintf(stderr,"found tab at line %i at position %li\n",FileBuffer->CurrentLine, (char *)dummy-(char *)dummy1);
       }
     } else dummy = dummy1;
@@ -1508,5 +1612,5 @@
     if ((name == NULL) || (((dummy-dummy1 >= 3) && (strncmp(dummy1, name, strlen(name)) == 0)) && ((unsigned int)(dummy-dummy1) == strlen(name)))) {
       found++; // found the parameter!
-      //fprintf(stderr,"found %s at line %i between %i and %i\n", name, line, dummy1, dummy);
+      if (verbose) fprintf(stderr,"found %s at line %i between %li and %li\n", name, FileBuffer->CurrentLine, (unsigned long)dummy1, (unsigned long)dummy);
 
       if (found == repetition) {
@@ -1523,4 +1627,5 @@
                   exit(255);
                 } else {
+                  //fprintf(stdout,"Rewinding to OldCurrentLine due to search till end of line.\n");
                   FileBuffer->CurrentLine = OldCurrentLine; // rewind to start position
                   return 0;
@@ -1528,9 +1633,9 @@
               }
               if (dummy1 == NULL) {
-                if (verbose) fprintf(stderr,"Error reading line %i\n", line);
+                if (verbose) fprintf(stderr,"Error reading line %i\n", FileBuffer->CurrentLine);
               } else {
-                //fprintf(stderr,"Reading next line %i: %s\n", line, dummy1);
+                if (verbose) fprintf(stderr,"Reading next line %i: %s\n", FileBuffer->CurrentLine, dummy1);
               }
-              line++;
+              //FileBuffer->CurrentLine++;
             } while ((dummy1 != NULL) && ((dummy1[0] == '#') || (dummy1[0] == '\n')));
             dummy = dummy1;
@@ -1557,5 +1662,5 @@
                 if ((j < yth-1) && (type < 4)) {  // check if xth value or not yet
                   if (critical) {
-                    if (verbose) fprintf(stderr,"Error: EoL at %i and still missing %i value(s) for parameter %s\n", line, yth-j, name);
+                    if (verbose) fprintf(stderr,"Error: EoL at %i and still missing %i value(s) for parameter %s\n", FileBuffer->CurrentLine, yth-j, name);
                     //return 0;
                     exit(255);
@@ -1563,4 +1668,5 @@
                   } else {
                     if (!sequential) { // here we need it!
+                      //fprintf(stdout,"Rewinding to OldCurrentLine due to end of line and sequential %d.\n", sequential);
                       FileBuffer->CurrentLine = OldCurrentLine; // rewind to start position
                     }
@@ -1569,5 +1675,5 @@
                 }
               } else {
-                //fprintf(stderr,"found tab at %i\n",(char *)dummy-(char *)free_dummy);
+                if (verbose) fprintf(stderr,"found tab at line %i at position %li\n",FileBuffer->CurrentLine, (char *)dummy-(char *)free_dummy);
               }
               if (*dummy1 == '#') {
@@ -1575,9 +1681,10 @@
                 //if (verbose) fprintf(stderr,"Error: '#' at %i and still missing %i value(s) for parameter %s\n", line, yth-j, name);
                 if (!sequential) { // here we need it!
+                  //fprintf(stdout,"Rewinding to OldCurrentLine due to comment and sequential %d.\n", sequential);
                   FileBuffer->CurrentLine = OldCurrentLine; // rewind to start position
                 }
                 return 0;
               }
-              //fprintf(stderr,"value from %i to %i\n",(char *)dummy1-(char *)free_dummy,(char *)dummy-(char *)free_dummy);
+              if (verbose) fprintf(stderr,"value from %li to %li\n",(char *)dummy1-(char *)free_dummy,(char *)dummy-(char *)free_dummy);
               switch(type) {
                 case (row_int):
@@ -1632,7 +1739,8 @@
   if ((type >= row_int) && (verbose)) fprintf(stderr,"\n");
   if (!sequential) {
+    //fprintf(stdout,"Rewinding to OldCurrentLine due to sequential %d.\n", sequential);
     FileBuffer->CurrentLine = OldCurrentLine; // rewind to start position
   }
-  //fprintf(stderr, "End of Parsing\n\n");
+  if (verbose) fprintf(stderr, "End of Parsing for %s\n\n",name);
 
   return (found); // true if found, false if not
Index: tests/regression/Molecules/SaveTemperature/post/test.ekin
===================================================================
--- tests/regression/Molecules/SaveTemperature/post/test.ekin	(revision 03c77c8433e48594a1c472d7a86b4e799d81c363)
+++ tests/regression/Molecules/SaveTemperature/post/test.ekin	(revision 6a465e4248cc6569f489730a4176224357fc5126)
@@ -1,4 +1,5 @@
 # Step Temperature [K] Temperature [a.u.]
 0	139247	0.44097
-1	25464.1	0.08064
+1	139247	0.44097
 2	0	0
+3	0	0
