Index: src/analyzer.cpp
===================================================================
--- src/analyzer.cpp	(revision f3dc4cada1aab42f4ac415cb0adb90ad5db6eed7)
+++ src/analyzer.cpp	(revision 8f019c37319f5387da730449c13ecaf090715119)
@@ -29,5 +29,5 @@
   ForceMatrix Shielding;
   ForceMatrix ShieldingPAS;
-  EnergyMatrix Time;
+  MatrixContainer Time;
   EnergyMatrix EnergyFragments;
   EnergyMatrix HcorrectionFragments;
@@ -51,5 +51,4 @@
   bool Hcorrected = true;
   double norm;
-  int counter;
   
   cout << "ANOVA Analyzer" << endl;
@@ -83,11 +82,11 @@
   
   // ------------- Parse through all Fragment subdirs --------
-  if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix,0,0)) return 1;
-  Hcorrected = Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0);
-  if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix,0,0)) return 1;
-  if (!Time.ParseFragmentMatrix(argv[1], dir, TimeSuffix, 10,1)) return 1;
+  if (!Energy.ParseMatrix(argv[1], dir, EnergySuffix,0,0)) return 1;
+  Hcorrected = Hcorrection.ParseMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0);
+  if (!Force.ParseMatrix(argv[1], dir, ForcesSuffix,0,0)) return 1;
+  if (!Time.ParseMatrix(argv[1], dir, TimeSuffix, 10,1)) return 1;
   if (periode != NULL) { // also look for PAS values
-    if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
-    if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
+    if (!Shielding.ParseMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
+    if (!ShieldingPAS.ParseMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
   }
 
@@ -112,10 +111,10 @@
   
   // ---------- Parse fragment files created by 'joiner' into an array -------------
-  if (!EnergyFragments.ParseFragmentMatrix(argv[1], dir, EnergyFragmentSuffix,0,0)) return 1;
-  if (Hcorrected) HcorrectionFragments.ParseFragmentMatrix(argv[1], dir, HcorrectionFragmentSuffix,0,0);
-  if (!ForceFragments.ParseFragmentMatrix(argv[1], dir, ForceFragmentSuffix,0,0)) return 1;
+  if (!EnergyFragments.ParseMatrix(argv[1], dir, EnergyFragmentSuffix,0,0)) return 1;
+  if (Hcorrected) HcorrectionFragments.ParseMatrix(argv[1], dir, HcorrectionFragmentSuffix,0,0);
+  if (!ForceFragments.ParseMatrix(argv[1], dir, ForceFragmentSuffix,0,0)) return 1;
   if (periode != NULL) { // also look for PAS values
-    if (!ShieldingFragments.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
-    if (!ShieldingPASFragments.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
+    if (!ShieldingFragments.ParseMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
+    if (!ShieldingPASFragments.ParseMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
   }
 
@@ -161,14 +160,18 @@
   
   output << endl << "Total Times" << endl << "===============" << endl << Time.Header << endl;
+  Time.SetLastMatrix(0., 0);
+  for (int BondOrder=KeySet.Order;BondOrder--;)
+    for(int i=KeySet.FragmentsPerOrder[BondOrder];i--;)
+      for(int j=Time.RowCounter[Time.MatrixCounter];j--;)
+        for(int k=Time.ColumnCounter;k--;) {
+          Time.Matrix[ Time.MatrixCounter ][j][k] += Time.Matrix[ KeySet.OrderSet[BondOrder][i] ][j][k];
+        }
   for(int j=0;j<Time.RowCounter[Time.MatrixCounter];j++) {
-    for(int k=0;k<Time.ColumnCounter;k++) {
+    for(int k=0;k<Time.ColumnCounter;k++)
       output << scientific << Time.Matrix[ Time.MatrixCounter ][j][k] << "\t";
-    }
     output << endl;
   }
   output << endl;
   output.close();
-  for(int k=0;k<Time.ColumnCounter;k++)
-    Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k] = Time.Matrix[ Time.MatrixCounter ][Time.RowCounter[Time.MatrixCounter]-1][k];
 
   // +++++++++++++++ ANALYZING ++++++++++++++++++++++++++++++
@@ -179,14 +182,7 @@
 
   // +++++++++++++++++++++++++++++++++++++++ Plotting Simtime vs Bond Order
-  // +++++++++++++++++++++++++++++++++++++++ Plotting Delta Simtime vs Bond Order
   if (!OpenOutputFile(output, argv[3], "SimTime-Order.dat" )) return false;
-  if (!OpenOutputFile(output2, argv[3], "DeltaSimTime-Order.dat" )) return false;
-  for(int j=Time.RowCounter[Time.MatrixCounter];j--;)
-    for(int k=Time.ColumnCounter;k--;) {
-      Time.Matrix[ Time.MatrixCounter ][j][k] = 0.;
-    }
-  counter = 0;
+  Time.SetLastMatrix(0., 0);
   output << "#Order\tFrag.No.\t" << Time.Header << endl;
-  output2 << "#Order\tFrag.No.\t" << Time.Header << endl;
   for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
     for(int i=KeySet.FragmentsPerOrder[BondOrder];i--;)
@@ -195,20 +191,10 @@
           Time.Matrix[ Time.MatrixCounter ][j][k] += Time.Matrix[ KeySet.OrderSet[BondOrder][i] ][j][k];
         }
-    counter += KeySet.FragmentsPerOrder[BondOrder];
-    output << BondOrder+1 << "\t" << counter;
-    output2 << BondOrder+1 << "\t" << counter;
-    for(int k=0;k<Time.ColumnCounter;k++) {
-      output << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k];
-      if (fabs(Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k]) > MYEPSILON)
-        output2 << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k] / Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter] ][k];
-      else
-        output2 << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][ Time.RowCounter[Time.MatrixCounter]-1 ][k];
-    }
-    output << endl;
-    output2 << endl;
+    output << BondOrder+1 << "\t" << KeySet.FragmentsPerOrder[BondOrder];
+    for(int k=0;k<Time.ColumnCounter;k++)
+      output << "\t" << scientific << Time.Matrix[ Time.MatrixCounter ][1][k];
+    output << endl;
   }
   output.close();
-  output2.close();
-
 
   // +++++++++++++++++++++++++++++++++++++++ Plotting deviation in energy to full QM
Index: src/helpers.cpp
===================================================================
--- src/helpers.cpp	(revision f3dc4cada1aab42f4ac415cb0adb90ad5db6eed7)
+++ src/helpers.cpp	(revision 8f019c37319f5387da730449c13ecaf090715119)
@@ -73,6 +73,8 @@
   void *buffer = NULL;
   if (OldPointer == NULL)
-  	cout << Verbose(0) << "ReAlloc impossible - old is NULL: " << output << endl;
-  buffer = (void *)realloc(OldPointer, size); // alloc
+  	//cout << Verbose(0) << "ReAlloc impossible - old is NULL: " << output << endl;
+    buffer = (void *)malloc(size); // malloc
+  else
+    buffer = (void *)realloc(OldPointer, size); // realloc
   if (buffer == NULL)
     cout << Verbose(0) << "ReAlloc failed - new is NULL: " << output << endl;
Index: src/joiner.cpp
===================================================================
--- src/joiner.cpp	(revision f3dc4cada1aab42f4ac415cb0adb90ad5db6eed7)
+++ src/joiner.cpp	(revision 8f019c37319f5387da730449c13ecaf090715119)
@@ -60,10 +60,10 @@
   
   // ------------- Parse through all Fragment subdirs --------
-  if (!Energy.ParseMatrix(argv[1], dir, EnergySuffix, 0,0)) return 1;
-  Hcorrected = Hcorrection.ParseMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0);
-  if (!Force.ParseMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1;
+  if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix, 0,0)) return 1;
+  Hcorrected = Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0);
+  if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1;
   if (periode != NULL) { // also look for PAS values
-    if (!Shielding.ParseMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
-    if (!ShieldingPAS.ParseMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
+    if (!Shielding.ParseFragmentMatrix(argv[1], dir, ShieldingSuffix, 1, 0)) return 1;
+    if (!ShieldingPAS.ParseFragmentMatrix(argv[1], dir, ShieldingPASSuffix, 1, 0)) return 1;
   }
 
Index: src/parser.cpp
===================================================================
--- src/parser.cpp	(revision f3dc4cada1aab42f4ac415cb0adb90ad5db6eed7)
+++ src/parser.cpp	(revision 8f019c37319f5387da730449c13ecaf090715119)
@@ -55,9 +55,11 @@
  */
 MatrixContainer::MatrixContainer() {
-  Matrix = NULL;
   Indices = NULL;
-  Header = NULL;
+  Header = (char *) Malloc(sizeof(char)*1023, "MatrixContainer::MatrixContainer: *Header");
+  Matrix = (double ***) Malloc(sizeof(double **)*(1), "MatrixContainer::MatrixContainer: ***Matrix"); // one more each for the total molecule
+  RowCounter = (int *) Malloc(sizeof(int)*(1), "MatrixContainer::MatrixContainer: *RowCounter");
+  Matrix[0] = NULL;
+  RowCounter[0] = -1;
   MatrixCounter = 0;
-  RowCounter = NULL;
   ColumnCounter = 0;
 };
@@ -89,4 +91,101 @@
   Free((void **)&Header, "MatrixContainer::~MatrixContainer: *Header");
   Free((void **)&RowCounter, "MatrixContainer::~MatrixContainer: *RowCounter");
+};
+
+
+/** Parsing a number of matrices.
+ *    -# open the matrix file
+ *    -# skip some lines (\a skiplines)
+ *    -# scan header lines for number of columns
+ *    -# scan lines for number of rows
+ *    -# allocate matrix
+ *    -# loop over found column and row counts and parse in each entry
+ * \param *name directory with files
+ * \param skiplines number of inital lines to skip
+ * \param skiplines number of inital columns to skip
+ * \param MatrixNr index number in Matrix array to parse into
+ * \return parsing successful 
+ */
+bool MatrixContainer::ParseMatrix(const char *name, int skiplines, int skipcolumns, int MatrixNr)
+{
+  ifstream input;
+  stringstream line;
+  string token;
+  char filename[1023];
+
+  input.open(name, ios::in);
+  //cout << "Opening " << name << " ... "  << input << endl;
+  if (input == NULL) {
+    cerr << endl << "Unable to open " << name << ", is the directory correct?" << endl;
+    return false;
+  }
+  
+  // skip some initial lines
+  for (int m=skiplines+1;m--;)
+    input.getline(Header, 1023);
+  
+  // scan header for number of columns
+  line.str(Header);
+  for(int k=skipcolumns;k--;)
+    line >> Header;
+  //cout << line.str() << endl;
+  ColumnCounter=0;
+  while ( getline(line,token, '\t') ) {
+    if (token.length() > 0)
+      ColumnCounter++;
+  }
+  //cout << line.str() << endl;
+  //cout << "ColumnCounter: " << ColumnCounter << "." << endl;
+  if (ColumnCounter == 0)
+    cerr << "ColumnCounter: " << ColumnCounter << " from file " << name << ", this is probably an error!" << endl;
+  
+  // scan rest for number of rows/lines
+  RowCounter[MatrixNr]=-1;    // counts one line too much
+  while (!input.eof()) { 
+    input.getline(filename, 1023);
+    //cout << "Comparing: " << strncmp(filename,"MeanForce",9) << endl;
+    RowCounter[MatrixNr]++; // then line was not last MeanForce
+    if (strncmp(filename,"MeanForce", 9) == 0) {
+      break;
+    }
+  }
+  //cout << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << "." << endl;
+  if (RowCounter[MatrixNr] == 0)
+    cerr << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl;
+  
+  // allocate matrix if it's not zero dimension in one direction
+  if ((ColumnCounter > 0) && (RowCounter[MatrixNr] > -1)) {
+    Matrix[MatrixNr] = (double **) Malloc(sizeof(double *)*(RowCounter[MatrixNr]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
+  
+    // parse in each entry for this matrix
+    input.clear();
+    input.seekg(ios::beg);
+    for (int m=skiplines+1;m--;)
+      input.getline(Header, 1023);    // skip header
+    line.str(Header);
+    for(int k=skipcolumns;k--;)  // skip columns in header too
+      line >> filename;
+    strncpy(Header, line.str().c_str(), 1023);  
+    for(int j=0;j<RowCounter[MatrixNr];j++) {
+      Matrix[MatrixNr][j] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");
+      input.getline(filename, 1023);
+      stringstream lines(filename);
+      //cout << "Matrix at level " << j << ":";// << filename << endl;
+      for(int k=skipcolumns;k--;)
+        lines >> filename;
+      for(int k=0;(k<ColumnCounter) && (!lines.eof());k++) {
+        lines >> Matrix[MatrixNr][j][k];
+        //cout << " " << setprecision(2) << Matrix[MatrixNr][j][k];;
+      }
+      //cout << endl;
+      Matrix[MatrixNr][ RowCounter[MatrixNr] ] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseFragmentMatrix: *Matrix[RowCounter[MatrixNr]][]");
+      for(int j=ColumnCounter;j--;)
+        Matrix[MatrixNr][ RowCounter[MatrixNr] ][j] = 0.;
+    }
+  } else {
+    cerr << "ERROR: Matrix nr. " << MatrixNr << " has column and row count of (" << ColumnCounter << "," << RowCounter[MatrixNr] << "), could not allocate nor parse!" << endl; 
+  }
+  input.close();
+  return true;
 };
 
@@ -109,5 +208,5 @@
  * \return parsing successful 
  */
-bool MatrixContainer::ParseMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns)
+bool MatrixContainer::ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns)
 {
   char filename[1023];
@@ -117,6 +216,4 @@
   string token;
   
-  Header = (char *) Malloc(sizeof(char)*1023, "MatrixContainer::ParseMatrix: *EnergyHeader");
-
   // count the number of matrices
   MatrixCounter = -1; // we count one too much
@@ -129,95 +226,25 @@
   while (!input.eof()) {
     input.getline(filename, 1023);
+    stringstream zeile(filename);
     MatrixCounter++;
   }
-  input.close();
+  input.close();  
   cout << "Determined " << MatrixCounter << " fragments." << endl;
   
   cout << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl;
-  Matrix = (double ***) Malloc(sizeof(double **)*(MatrixCounter+1), "MatrixContainer::ParseMatrix: ***Matrix"); // one more each for the total molecule
-  RowCounter = (int *) Malloc(sizeof(int)*(MatrixCounter+1), "MatrixContainer::ParseMatrix: *RowCounter");
+  Matrix = (double ***) ReAlloc(Matrix, sizeof(double **)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule
+  RowCounter = (int *) ReAlloc(RowCounter, sizeof(int)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: *RowCounter");
   for(int i=MatrixCounter+1;i--;) {
     Matrix[i] = NULL;
     RowCounter[i] = -1;
   }
-  for(int i=MatrixCounter+1;i--;) {
+  for(int i=0; i < MatrixCounter;i++) {
     // open matrix file
-    stringstream line;
     FragmentNumber = FixedDigitNumber(MatrixCounter, i);
     file.str(" ");
-    if (i != MatrixCounter)  
-      file << name << FRAGMENTPREFIX << FragmentNumber << prefix << suffix;
-    else
-      file << name << prefix << suffix;
-    Free((void **)&FragmentNumber, "MatrixContainer::ParseMatrix: *FragmentNumber");
-    input.open(file.str().c_str(), ios::in);
-    //cout << "Opening " << file.str() << " ... "  << input << endl;
-    if (input == NULL) {
-      cerr << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
+    file << name << FRAGMENTPREFIX << FragmentNumber << prefix << suffix;
+    if (!ParseMatrix(file.str().c_str(), skiplines, skipcolumns, i))
       return false;
-    }
-    
-    // skip some initial lines
-    for (int m=skiplines+1;m--;)
-      input.getline(Header, 1023);
-    
-    // scan header for number of columns
-    line.str(Header);
-    for(int k=skipcolumns;k--;)
-      line >> Header;
-    //cout << line.str() << endl;
-    ColumnCounter=0;
-    while ( getline(line,token, '\t') ) {
-      if (token.length() > 0)
-        ColumnCounter++;
-    }
-    //cout << line.str() << endl;
-    //cout << "ColumnCounter: " << ColumnCounter << endl;
-    
-    // scan rest for number of rows/lines
-    RowCounter[i]=-1;    // counts one line too much
-    while (!input.eof()) { 
-      input.getline(filename, 1023);
-      //cout << "Comparing: " << strncmp(filename,"MeanForce",9) << endl;
-      RowCounter[i]++; // then line was not last MeanForce
-      if (strncmp(filename,"MeanForce", 9) == 0) {
-        break;
-      }
-    }
-    //cout << "RowCounter[" << i << "]: " << RowCounter[i] << " from file " << file.str() << "." << endl;
-    
-    // allocate matrix if it's not zero dimension in one direction
-    if ((ColumnCounter > 0) && (RowCounter[i] > -1)) {
-      Matrix[i] = (double **) Malloc(sizeof(double *)*(RowCounter[i]+1), "MatrixContainer::ParseMatrix: **Matrix[]");
-    
-      // parse in each entry for this matrix
-      input.clear();
-      input.seekg(ios::beg);
-      for (int m=skiplines+1;m--;)
-        input.getline(Header, 1023);    // skip header
-      line.str(Header);
-      for(int k=skipcolumns;k--;)  // skip columns in header too
-        line >> filename;
-      strncpy(Header, line.str().c_str(), 1023);  
-      for(int j=0;j<RowCounter[i];j++) {
-        Matrix[i][j] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseMatrix: *Matrix[][]");
-        input.getline(filename, 1023);
-        stringstream lines(filename);
-        //cout << "Matrix at level " << j << ":";// << filename << endl;
-        for(int k=skipcolumns;k--;)
-          lines >> filename;
-        for(int k=0;(k<ColumnCounter) && (!lines.eof());k++) {
-          lines >> Matrix[i][j][k];
-          //cout << " " << setprecision(2) << Matrix[i][j][k];;
-        }
-        //cout << endl;
-        Matrix[i][ RowCounter[i] ] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseMatrix: *Matrix[RowCounter[i]][]");
-        for(int j=ColumnCounter;j--;)
-          Matrix[i][ RowCounter[i] ][j] = 0.;
-      }
-    } else {
-      cerr << "ERROR: Matrix nr. " << i << " has column and row count of (" << ColumnCounter << "," << RowCounter[i] << "), could not allocate nor parse!" << endl; 
-    }
-    input.close();
+    Free((void **)&FragmentNumber, "MatrixContainer::ParseFragmentMatrix: *FragmentNumber");
   }
   return true;
@@ -233,16 +260,16 @@
 bool MatrixContainer::AllocateMatrix(char *GivenHeader, int MCounter, int *RCounter, int CCounter)
 {
-  Header = (char *) Malloc(sizeof(char)*1024, "MatrixContainer::ParseMatrix: *EnergyHeader");
+  Header = (char *) Malloc(sizeof(char)*1024, "MatrixContainer::ParseFragmentMatrix: *EnergyHeader");
   strncpy(Header, GivenHeader, 1023);
 
   MatrixCounter = MCounter;
   ColumnCounter = CCounter;
-  Matrix = (double ***) Malloc(sizeof(double **)*(MatrixCounter+1), "MatrixContainer::ParseMatrix: ***Matrix"); // one more each for the total molecule
-  RowCounter = (int *) Malloc(sizeof(int)*(MatrixCounter+1), "MatrixContainer::ParseMatrix: *RowCounter");
+  Matrix = (double ***) Malloc(sizeof(double **)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule
+  RowCounter = (int *) Malloc(sizeof(int)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: *RowCounter");
   for(int i=MatrixCounter+1;i--;) {
     RowCounter[i] = RCounter[i];
-    Matrix[i] = (double **) Malloc(sizeof(double *)*(RowCounter[i]+1), "MatrixContainer::ParseMatrix: **Matrix[]");  
+    Matrix[i] = (double **) Malloc(sizeof(double *)*(RowCounter[i]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]");  
     for(int j=RowCounter[i]+1;j--;) {
-      Matrix[i][j] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseMatrix: *Matrix[][]");
+      Matrix[i][j] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");
       for(int k=ColumnCounter;k--;)
         Matrix[i][j][k] = 0.;
@@ -481,4 +508,38 @@
 };
 
+/** Calls MatrixContainer::ParseFragmentMatrix() and additionally allocates last plus one matrix.
+ * \param *name directory with files
+ * \param *prefix prefix of each matrix file
+ * \param *suffix suffix of each matrix file
+ * \param skiplines number of inital lines to skip
+ * \param skiplines number of inital columns to skip
+ * \return parsing successful
+ */ 
+bool EnergyMatrix::ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns)
+{
+  char filename[1024];
+  bool status = MatrixContainer::ParseFragmentMatrix(name, prefix, suffix, skiplines, skipcolumns);
+
+  if (status) {
+    // count maximum of columns
+    RowCounter[MatrixCounter] = 0;
+    for(int j=0; j < MatrixCounter;j++) // (energy matrix might be bigger than number of atoms in terms of rows)
+      if (RowCounter[j] > RowCounter[MatrixCounter])
+        RowCounter[MatrixCounter] = RowCounter[j];
+    // allocate last plus one matrix
+    cout << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter << " columns." << endl;
+    Matrix[MatrixCounter] = (double **) Malloc(sizeof(double *)*(RowCounter[MatrixCounter]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
+    for(int j=0;j<=RowCounter[MatrixCounter];j++)
+      Matrix[MatrixCounter][j] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");
+    
+    // try independently to parse global energysuffix file if present
+    strncpy(filename, name, 1023);
+    strncat(filename, prefix, 1023-strlen(filename));
+    strncat(filename, suffix.c_str(), 1023-strlen(filename));
+    ParseMatrix(filename, skiplines, skipcolumns, MatrixCounter);
+  }
+  return status;
+};
+
 // ======================================= CLASS ForceMatrix =============================
 
@@ -556,4 +617,59 @@
 };
 
+
+/** Calls MatrixContainer::ParseFragmentMatrix() and additionally allocates last plus one matrix.
+ * \param *name directory with files
+ * \param *prefix prefix of each matrix file
+ * \param *suffix suffix of each matrix file
+ * \param skiplines number of inital lines to skip
+ * \param skiplines number of inital columns to skip
+ * \return parsing successful
+ */ 
+bool ForceMatrix::ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns)
+{
+  char filename[1023];
+  ifstream input;
+  stringstream file;
+  int nr;
+  bool status = MatrixContainer::ParseFragmentMatrix(name, prefix, suffix, skiplines, skipcolumns);
+
+  if (status) {
+    // count number of atoms for last plus one matrix
+    file << name << FRAGMENTPREFIX << KEYSETFILE;
+    input.open(file.str().c_str(), ios::in);
+    if (input == NULL) {
+      cout << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
+      return false;
+    }
+    RowCounter[MatrixCounter] = 0;
+    while (!input.eof()) {
+      input.getline(filename, 1023);
+      stringstream zeile(filename);
+      while (!zeile.eof()) {
+        zeile >> nr;
+        //cout << "Current index: " << nr << "." << endl;
+        if (nr > RowCounter[MatrixCounter])
+          RowCounter[MatrixCounter] = nr;
+      }
+    }
+    RowCounter[MatrixCounter]++;    // nr start at 0, count starts at 1
+    input.close();
+  
+    // allocate last plus one matrix
+    cout << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter << " columns." << endl;
+    Matrix[MatrixCounter] = (double **) Malloc(sizeof(double *)*(RowCounter[MatrixCounter]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]");
+    for(int j=0;j<=RowCounter[MatrixCounter];j++)
+      Matrix[MatrixCounter][j] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");
+
+    // try independently to parse global forcesuffix file if present
+    strncpy(filename, name, 1023);
+    strncat(filename, prefix, 1023-strlen(filename));
+    strncat(filename, suffix.c_str(), 1023-strlen(filename));
+    ParseMatrix(filename, skiplines, skipcolumns, MatrixCounter);
+  }
+ 
+
+  return status;
+};
 
 // ======================================= CLASS KeySetsContainer =============================
Index: src/parser.hpp
===================================================================
--- src/parser.hpp	(revision f3dc4cada1aab42f4ac415cb0adb90ad5db6eed7)
+++ src/parser.hpp	(revision 8f019c37319f5387da730449c13ecaf090715119)
@@ -51,5 +51,6 @@
   ~MatrixContainer();
   
-  bool ParseMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns);
+  bool ParseMatrix(const char *name, int skiplines, int skipcolumns, int MatrixNr);
+  virtual bool ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns);
   bool AllocateMatrix(char *GivenHeader, int MCounter, int *RCounter, int CCounter);
   bool ResetMatrix();
@@ -71,4 +72,5 @@
     bool ParseIndices();
     bool SumSubEnergy(class EnergyMatrix &Fragments, class EnergyMatrix *CorrectionFragments, class KeySetsContainer &KeySet, int Order, double sign);
+    bool ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns);
 };
 
@@ -79,4 +81,5 @@
     bool ParseIndices(char *name);
     bool SumSubForces(class ForceMatrix &Fragments, class KeySetsContainer &KeySet, int Order, double sign);
+    bool ParseFragmentMatrix(char *name, char *prefix, string suffix, int skiplines, int skipcolumns);
 };
 
