Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/Makefile.am	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -1,4 +1,4 @@
 SOURCE = atom.cpp bond.cpp boundary.cpp builder.cpp config.cpp element.cpp helpers.cpp molecules.cpp moleculelist.cpp periodentafel.cpp vector.cpp verbose.cpp
-HEADER = boundary.hpp defs.hpp helpers.hpp molecules.hpp stackclass.hpp vector.hpp
+HEADER = boundary.hpp defs.hpp helpers.hpp molecules.hpp periodentafel.hpp stackclass.hpp vector.hpp
 
 bin_PROGRAMS = molecuilder joiner analyzer
@@ -6,6 +6,6 @@
 molecuilder_DATA = elements.db valence.db	orbitals.db Hbonddistance.db Hbondangle.db
 molecuilder_SOURCES =  ${SOURCE} ${HEADER}
-joiner_SOURCES = joiner.cpp parser.cpp helpers.cpp verbose.cpp helpers.hpp parser.hpp datacreator.cpp datacreator.hpp
-analyzer_SOURCES = analyzer.cpp parser.cpp datacreator.cpp helpers.cpp verbose.cpp helpers.hpp parser.hpp datacreator.hpp 
+joiner_SOURCES = joiner.cpp datacreator.cpp element.cpp helpers.cpp periodentafel.cpp parser.cpp verbose.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp 
+analyzer_SOURCES = analyzer.cpp datacreator.cpp element.cpp helpers.cpp periodentafel.cpp parser.cpp verbose.cpp helpers.hpp periodentafel.hpp parser.hpp datacreator.hpp 
 
 
Index: src/analyzer.cpp
===================================================================
--- src/analyzer.cpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/analyzer.cpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -8,7 +8,13 @@
 //============================ INCLUDES ===========================
 
+#include "datacreator.hpp"
 #include "helpers.hpp" 
 #include "parser.hpp"
-#include "datacreator.hpp"
+#include "periodentafel.hpp" 
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 
@@ -17,14 +23,20 @@
 int main(int argc, char **argv)
 {
+  periodentafel *periode = NULL; // and a period table of all elements
   EnergyMatrix Energy;
   ForceMatrix Force;
+  ForceMatrix Shielding;
+  ForceMatrix ShieldingPAS;
   MatrixContainer Time;
   EnergyMatrix EnergyFragments;
   ForceMatrix ForceFragments;
-  KeySetsContainer KeySet;  
+  ForceMatrix ShieldingFragments;
+  ForceMatrix ShieldingPASFragments;
+  KeySetsContainer KeySet;
   ofstream output;
   ofstream output2;
   ofstream output3;
   ofstream output4;
+  ifstream input;
   stringstream filename;
   time_t t = time(NULL);
@@ -39,9 +51,15 @@
   // Get the command line options
   if (argc < 4) {
-    cout << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir>" << endl;
+    cout << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> [elementsdb]" << endl;
     cout << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl;
     cout << "<prefix>\tprefix of energy and forces file." << endl;
     cout << "<outputdir>\tcreated plotfiles and datafiles are placed into this directory " << endl;
+    cout << "[elementsdb]\tpath to elements database, needed for shieldings." << endl;
     return 1;
+  }
+  if (argc > 4) {
+    cout << "Loading periodentafel." << endl;
+    periode = new periodentafel;
+    periode->LoadPeriodentafel(argv[4]);
   }
   
@@ -56,4 +74,8 @@
   if (!Force.ParseMatrix(argv[1], argv[2], ForcesSuffix,0,0)) return 1;
   if (!Time.ParseMatrix(argv[1], argv[2], TimeSuffix, 10,1)) return 1;
+  if (periode != NULL) { // also look for PAS values
+    if (!Shielding.ParseMatrix(argv[1], argv[2], ShieldingSuffix, 1, 0)) return 1;
+    if (!ShieldingPAS.ParseMatrix(argv[1], argv[2], ShieldingPASSuffix, 1, 0)) return 1;
+  }
 
   // ---------- Parse the TE Factors into an array -----------------
@@ -62,10 +84,22 @@
   // ---------- Parse the Force indices into an array ---------------
   if (!Force.ParseIndices(argv[1])) return 1;
+
+  // ---------- Parse the shielding indices into an array ---------------
+  if (periode != NULL) { // also look for PAS values
+    if(!Shielding.ParseIndices(argv[1])) return 1;
+    if(!ShieldingPAS.ParseIndices(argv[1])) return 1;
+  }
 
   // ---------- Parse the KeySets into an array ---------------
   if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1;
   if (!KeySet.ParseManyBodyTerms()) return 1;
+  
+  // ---------- Parse fragment files created by 'joiner' into an array -------------
   if (!EnergyFragments.ParseMatrix(argv[1], argv[2], EnergyFragmentSuffix,0,0)) return 1;
   if (!ForceFragments.ParseMatrix(argv[1], argv[2], ForceFragmentSuffix,0,0)) return 1;
+  if (periode != NULL) { // also look for PAS values
+    if (!ShieldingFragments.ParseMatrix(argv[1], argv[2], ShieldingSuffix, 1, 0)) return 1;
+    if (!ShieldingPASFragments.ParseMatrix(argv[1], argv[2], ShieldingPASSuffix, 1, 0)) return 1;
+  }
 
   // +++++++++++++++ TESTING ++++++++++++++++++++++++++++++
@@ -91,4 +125,22 @@
   output << endl;
 
+  if (periode != NULL) { // also look for PAS values
+    output << endl << "Total Shieldings" << endl << "===============" << endl << Shielding.Header << endl;
+    for(int j=0;j<Shielding.RowCounter[Shielding.MatrixCounter];j++) {
+      for(int k=0;k<Shielding.ColumnCounter;k++)
+        output << scientific << Shielding.Matrix[ Shielding.MatrixCounter ][j][k] << "\t";
+      output << endl;
+    }
+    output << endl;
+  
+    output << endl << "Total Shieldings PAS" << endl << "===============" << endl << ShieldingPAS.Header << endl;
+    for(int j=0;j<ShieldingPAS.RowCounter[ShieldingPAS.MatrixCounter];j++) {
+      for(int k=0;k<ShieldingPAS.ColumnCounter;k++)
+        output << scientific << ShieldingPAS.Matrix[ ShieldingPAS.MatrixCounter ][j][k] << "\t";
+      output << endl;
+    }
+    output << endl;
+  }
+  
   output << endl << "Total Times" << endl << "===============" << endl << Time.Header << endl;
   Time.SetLastMatrix(0., 0);
@@ -380,5 +432,6 @@
   output.close();
  
-  // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++  
+  // ++++++++++++++++ exit ++++++++++++++++++++++++++++++++++
+  delete(periode);
   cout << "done." << endl;
   return 0;
Index: src/boundary.cpp
===================================================================
--- src/boundary.cpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/boundary.cpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -702,8 +702,8 @@
     secondline++;
   } while (!(
-      (BPS[0] == secondline->second.first->second) && (BPS[1] != secondline->second.second->second) ||
-      (BPS[0] == secondline->second.second->second) && (BPS[1] != secondline->second.first->second) ||
-      (BPS[1] == secondline->second.first->second) && (BPS[0] != secondline->second.second->second) ||
-      (BPS[1] == secondline->second.second->second) && (BPS[0] != secondline->second.first->second)
+      ((BPS[0] == secondline->second.first->second) && (BPS[1] != secondline->second.second->second)) ||
+      ((BPS[0] == secondline->second.second->second) && (BPS[1] != secondline->second.first->second)) ||
+      ((BPS[1] == secondline->second.first->second) && (BPS[0] != secondline->second.second->second)) ||
+      ((BPS[1] == secondline->second.second->second) && (BPS[0] != secondline->second.first->second))
     ));
   BPS[0] = secondline->second.first->second;
Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/builder.cpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -764,5 +764,5 @@
             cout << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner and stores config files in same dir as config." << endl;
             cout << "\t-h/-H/-?\tGive this help screen." << endl;
-            cout << "\t-m\tAlign in PAS with greatest EV along z axis." << endl;
+            cout << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;
             cout << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl;
             cout << "\t-o\tGet volume of the convex envelope (and store to tecplot file)." << endl;
Index: src/defs.hpp
===================================================================
--- src/defs.hpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/defs.hpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -49,4 +49,6 @@
 #define TEFACTORSFILE "TE-Factors.dat"    //!< default filename of BOSSANOVA total energy factors file
 #define FORCESFILE "Forces-Factors.dat"    //!< default filename of BOSSANOVA force factors file
+#define SHIELDINGSUFFIX "sigma_all.csv"                //!< default filename of BOSSANOVA shieldings file
+#define SHIELDINGPASSUFFIX "sigma_all_PAS.csv"                 //!< default filename of BOSSANOVA shieldings PAS file
 #define ORDERATSITEFILE "OrderAtSite.dat"    //!< default filename of BOSSANOVA Bond Order at each atom file
 #define ENERGYPERFRAGMENT "EnergyPerFragment"    //!< default filename of BOSSANOVA Energy contribution Per Fragment file
Index: src/element.cpp
===================================================================
--- src/element.cpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/element.cpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -5,5 +5,5 @@
  */
 
-#include "molecules.hpp"
+#include "periodentafel.hpp"
 
 /************************************* Functions for class element **********************************/
Index: src/joiner.cpp
===================================================================
--- src/joiner.cpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/joiner.cpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -11,4 +11,5 @@
 #include "helpers.hpp" 
 #include "parser.hpp" 
+#include "periodentafel.hpp" 
 
 //============================== MAIN =============================
@@ -16,8 +17,13 @@
 int main(int argc, char **argv)
 {
+  periodentafel *periode = NULL; // and a period table of all elements
   EnergyMatrix Energy;
   ForceMatrix Force;
   EnergyMatrix EnergyFragments;
   ForceMatrix ForceFragments;
+  ForceMatrix Shielding;
+  ForceMatrix ShieldingPAS;
+  ForceMatrix ShieldingFragments;
+  ForceMatrix ShieldingPASFragments;
   KeySetsContainer KeySet;  
   stringstream prefix;
@@ -28,8 +34,13 @@
   // Get the command line options
   if (argc < 3) {
-    cout << "Usage: " << argv[0] << " <inputdir> <prefix>" << endl;
+    cout << "Usage: " << argv[0] << " <inputdir> <prefix> [elementsdb]" << endl;
     cout << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl;
     cout << "<prefix>\tprefix of energy and forces file." << endl;
+    cout << "[elementsdb]\tpath to elements database, needed for shieldings." << endl;
     return 1;
+  }
+  if (argc > 3) {
+    periode = new periodentafel;
+    periode->LoadPeriodentafel(argv[3]);
   }
   
@@ -42,7 +53,9 @@
   // ------------- Parse through all Fragment subdirs --------
   if (!Energy.ParseMatrix(argv[1], argv[2], EnergySuffix, 0,0)) return 1;
-  //if (!ParseSubEnergies(argv[1], argv[2], EnergySuffix, data.EnergyHeader, data.Energies, data.EnergyIndices, data.LevelCounter, data.ColumnCounter, data.FragmentCounter)) return 1;
   if (!Force.ParseMatrix(argv[1], argv[2], ForcesSuffix, 0,0)) return 1;
-  //if (!ParseSubForces(argv[1], argv[2], ForcesSuffix, data.ForcesHeader, data.Forces, data.AtomCounter, data.Column2Counter, data.FragmentCounter)) return 1;
+  if (periode != NULL) { // also look for PAS values
+    if (!Shielding.ParseMatrix(argv[1], argv[2], ShieldingSuffix, 1, 0)) return 1;
+    if (!ShieldingPAS.ParseMatrix(argv[1], argv[2], ShieldingPASSuffix, 1, 0)) return 1;
+  }
 
   // ---------- Parse the TE Factors into an array -----------------
@@ -51,21 +64,30 @@
   // ---------- Parse the Force indices into an array ---------------
   if (!Force.ParseIndices(argv[1])) return 1;
-  //if (!ParseForceIndices(argv[1], data.ForcesIndices, data.AtomCounter, data.FragmentCounter)) return 1;
+
+  // ---------- Parse the shielding indices into an array ---------------
+  if (periode != NULL) { // also look for PAS values
+    if(!Shielding.ParseIndices(argv[1])) return 1;
+    if(!ShieldingPAS.ParseIndices(argv[1])) return 1;
+  }
 
   // ---------- Parse the KeySets into an array ---------------
   if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1;
-  //if (!ParseKeySets(argv[1], data.KeySets, data.AtomCounter, data.FragmentCounter)) return 1;
 
   if (!KeySet.ParseManyBodyTerms()) return 1;
-  //if (!ParseManyBodyTerms(data.Order, data.OrderSet, data.FragmentsPerOrder, data.KeySets, data.AtomCounter, data.FragmentCounter)) return 1;
   if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return 1;
-  //if (!ParseSubEnergies(argv[1], argv[2], EnergyFragmentSuffix, data.EnergyHeader, data.EnergyFragments, data.EnergyFragmentIndices, data.LevelFragmentCounter, data.ColumnFragmentCounter, data.FragmentCounter)) return 1;
   if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return 1;
-  //if (!ParseSubForces(argv[1], argv[2], ForceFragmentSuffix, data.ForcesHeader, data.ForceFragments, data.AtomCounter, data.Column2Counter, data.FragmentCounter)) return 1;
+  if (periode != NULL) { // also look for PAS values
+    if (!ShieldingFragments.AllocateMatrix(Shielding.Header, Shielding.MatrixCounter, Shielding.RowCounter, Shielding.ColumnCounter)) return 1;
+    if (!ShieldingPASFragments.AllocateMatrix(ShieldingPAS.Header, ShieldingPAS.MatrixCounter, ShieldingPAS.RowCounter, ShieldingPAS.ColumnCounter)) return 1;
+  }
   
   // ----------- Resetting last matrices (where full QM values are stored right now)
   if(!Energy.SetLastMatrix(0., 0)) return 1;
   if(!Force.SetLastMatrix(0., 2)) return 1;
-  
+  if (periode != NULL) { // also look for PAS values
+    if(!Shielding.SetLastMatrix(0., 0)) return 1;
+    if(!ShieldingPAS.SetLastMatrix(0., 2)) return 1;
+  }
+
   // +++++++++++++++++ SUMMING +++++++++++++++++++++++++++++++
 
@@ -80,4 +102,11 @@
     if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return 1;
     if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder)) return 1;
+    if (periode != NULL) { // also look for PAS values
+      cout << "Summing shieldings of order " << BondOrder+1 << " ..." << endl;
+      if (!ShieldingFragments.SumSubManyBodyTerms(Shielding, KeySet, BondOrder)) return 1;
+      if (!Shielding.SumSubForces(ShieldingFragments, KeySet, BondOrder)) return 1;
+      if (!ShieldingPASFragments.SumSubManyBodyTerms(ShieldingPAS, KeySet, BondOrder)) return 1;
+      if (!ShieldingPAS.SumSubForces(ShieldingPASFragments, KeySet, BondOrder)) return 1;
+    }
 
     // --------- write the energy and forces file --------------------
@@ -89,4 +118,9 @@
     // forces
     if (!Force.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ForcesSuffix)) return 1;
+    // shieldings
+    if (periode != NULL) { // also look for PAS values
+      if (!Shielding.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ShieldingSuffix)) return 1;
+      if (!ShieldingPAS.WriteLastMatrix(argv[1], (prefix.str()).c_str(), ShieldingPASSuffix)) return 1;
+    }
   }
   // fragments
@@ -98,10 +132,23 @@
   if (!ForceFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
   if (!CreateDataFragment(EnergyFragments, KeySet, argv[1], FRAGMENTPREFIX ENERGYPERFRAGMENT, "fragment energy versus the Fragment No", "today", CreateEnergy)) return 1;
+  if (periode != NULL) { // also look for PAS values
+    prefix.str(" ");
+    prefix << argv[2] << ShieldingFragmentSuffix;
+    if (!ShieldingFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
+    prefix.str(" ");
+    prefix << argv[2] << ShieldingPASFragmentSuffix;
+    if (!ShieldingPASFragments.WriteTotalFragments(argv[1], (prefix.str()).c_str())) return 1;
+  }
 
   // write last matrices as fragments into central dir (not subdir as above), for analyzer to know index bounds
   if (!Energy.WriteLastMatrix(argv[1], argv[2], EnergyFragmentSuffix)) return 1;
   if (!Force.WriteLastMatrix(argv[1], argv[2], ForceFragmentSuffix)) return 1;
+  if (periode != NULL) { // also look for PAS values
+    if (!Shielding.WriteLastMatrix(argv[1], argv[2], ShieldingFragmentSuffix)) return 1;
+    if (!ShieldingPAS.WriteLastMatrix(argv[1], argv[2], ShieldingPASFragmentSuffix)) return 1;
+  }
 
   // exit  
+  delete(periode);
   cout << "done." << endl;
   return 0;
Index: src/molecules.hpp
===================================================================
--- src/molecules.hpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/molecules.hpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -22,4 +22,5 @@
 
 #include "helpers.hpp"
+#include "periodentafel.hpp"
 #include "stackclass.hpp"
 #include "vector.hpp"
@@ -28,8 +29,6 @@
 class bond;
 class config;
-class element;
 class molecule;
 class MoleculeListClass;
-class periodentafel;
 class vector;
 class Verbose;
@@ -58,62 +57,4 @@
 /************************************* Class definitions ****************************************/
 
-/** Chemical element.
- * Class incorporates data for a certain chemical element to be referenced from atom class.
- */
-class element {
-  public:
-    double mass;    //!< mass in g/mol
-    double CovalentRadius;  //!< covalent radius
-    double VanDerWaalsRadius;  //!< can-der-Waals radius
-    int Z;          //!< atomic number
-    char name[64];  //!< atom name, i.e. "Hydrogren"
-    char symbol[3]; //!< short form of the atom, i.e. "H"
-    char period[8];    //!< period: n quantum number
-    char group[8];    //!< group: l quantum number
-    char block[8];    //!< block: l quantum number
-    element *previous;  //!< previous item in list
-    element *next;  //!< next element in list
-    int *sort;      //!< sorc criteria
-    int No;         //!< number of element set on periodentafel::Output()
-    double Valence;		//!< number of valence electrons for this element
-    int NoValenceOrbitals;  //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix()
-    double HBondDistance[NDIM];	//!< distance in Angstrom of this element to hydrogen  (for single, double and triple bonds)
-    double HBondAngle[NDIM];     //!< typical angle for one, two, three bonded hydrogen (in degrees)
-
-  element();
-  ~element();
-
-  //> print element entries to screen
-  bool Output(ofstream *out) const;
-  bool Checkout(ofstream *out, const int No, const int NoOfAtoms) const;
-  
-  private:
-};
-
-/** Periodentafel is a list of all elements sorted by their atomic number.
- */
-class periodentafel {
-  public:
-    element *start; //!< start of element list
-    element *end;   //!< end of element list
-    char header1[MAXSTRINGSIZE]; //!< store first header line
-    char header2[MAXSTRINGSIZE]; //!< store second header line
-  
-  periodentafel();
-  ~periodentafel(); 
-  
-  bool AddElement(element *pointer);
-  bool RemoveElement(element *pointer);
-  bool CleanupPeriodtable();
-  element * FindElement(int Z);
-  element * FindElement(char *shorthand) const;
-  element * AskElement(); 
-  bool Output(ofstream *output) const;
-  bool Checkout(ofstream *output, const int *checkliste) const;
-  bool LoadPeriodentafel(char *filename = NULL);
-  bool StorePeriodentafel(char *filename = NULL) const;
-  
-  private:
-};
 
 // some algebraic matrix stuff
Index: src/parser.cpp
===================================================================
--- src/parser.cpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/parser.cpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -10,15 +10,17 @@
 #include "parser.hpp"
 
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 // ======================================= FUNCTIONS ==========================================
 
 /** Test if given filename can be opened.
  * \param filename name of file
+ * \param test true - no error message, false - print error
  * \return given file exists
  */
-#ifdef HAVE_INLINE
-inline bool FilePresent(const char *filename)
-#else
-bool FilePresent(const char *filename)
-#endif
+bool FilePresent(const char *filename, bool test)
 {
   ifstream input;
@@ -26,5 +28,6 @@
   input.open(filename, ios::in);
   if (input == NULL) {
-    cout << endl << "Unable to open " << filename << ", is the directory correct?" << endl;
+    if (!test)
+      cout << endl << "Unable to open " << filename << ", is the directory correct?" << endl;
     return false;
   }
@@ -44,5 +47,5 @@
 
   line << argv[1] << FRAGMENTPREFIX << KEYSETFILE;
-  return FilePresent(line.str().c_str());
+  return FilePresent(line.str().c_str(), false);
 };
 
@@ -89,4 +92,14 @@
 
 /** Parsing a number of matrices.
+ * -# First, count the number of matrices by counting lines in KEYSETFILE
+ * -# Then, 
+ *    -# construct the fragment number
+ *    -# 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
+ * -# Finally, allocate one additional matrix (\a MatrixCounter) containing combined or temporary values 
  * \param *name directory with files
  * \param *prefix prefix of each matrix file
@@ -131,18 +144,21 @@
     stringstream line;
     FragmentNumber = FixedDigitNumber(MatrixCounter, i);
+    file.str(" ");
     if (i != MatrixCounter)  
-      line << name << FRAGMENTPREFIX << FragmentNumber << "/" << prefix << suffix;
+      file << name << FRAGMENTPREFIX << FragmentNumber << "/" << prefix << suffix;
     else
-      line << name << prefix << suffix;
+      file << name << prefix << suffix;
     Free((void **)&FragmentNumber, "MatrixContainer::ParseMatrix: *FragmentNumber");
-    input.open(line.str().c_str(), ios::in);
-    //cout << "Opening " << line.str() << " ... "  << input << endl;
+    input.open(file.str().c_str(), ios::in);
+    //cout << "Opening " << file.str() << " ... "  << input << endl;
     if (input == NULL) {
-      cerr << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;
+      cerr << endl << "Unable to open " << file.str() << ", 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);
@@ -159,4 +175,5 @@
     //cout << line.str() << endl;
     //cout << "ColumnCounter: " << ColumnCounter << endl;
+    
     // scan rest for number of rows/lines
     RowCounter[i]=-1;    // counts one line too much
@@ -169,30 +186,38 @@
       }
     }
-    cout << "RowCounter[" << i << "]: " << RowCounter[i] << endl;
-    Matrix[i] = (double **) Malloc(sizeof(double *)*(RowCounter[i]+1), "MatrixContainer::ParseMatrix: **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 << "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.;
       }
-      //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();
   }
@@ -430,5 +455,5 @@
   stringstream line;
   
-  cout << "Parsing force indices." << endl;
+  cout << "Parsing force indices for " << MatrixCounter << " matrices." << endl;
   Indices = (int **) Malloc(sizeof(int *)*(MatrixCounter+1), "ForceMatrix::ParseIndices: **Indices");
   line << name << FRAGMENTPREFIX << FORCESFILE;
@@ -446,11 +471,11 @@
     Indices[i] = (int *) Malloc(sizeof(int)*RowCounter[i], "ForceMatrix::ParseIndices: *Indices[]");
     FragmentNumber = FixedDigitNumber(MatrixCounter, i);
-    cout << FRAGMENTPREFIX << FragmentNumber << "[" << RowCounter[i] << "]:";
+    //cout << FRAGMENTPREFIX << FragmentNumber << "[" << RowCounter[i] << "]:";
     Free((void **)&FragmentNumber, "ForceMatrix::ParseIndices: *FragmentNumber");
     for(int j=0;(j<RowCounter[i]) && (!line.eof());j++) {
       line >> Indices[i][j];
-      cout << " " << Indices[i][j];
-    }
-    cout << endl;
+      //cout << " " << Indices[i][j];
+    }
+    //cout << endl;
   }
   Indices[MatrixCounter] = (int *) Malloc(sizeof(int)*RowCounter[MatrixCounter], "ForceMatrix::ParseIndices: *Indices[]");
@@ -568,5 +593,5 @@
   
   cout << "Creating Fragment terms." << endl;
-  // scan through all to determine order
+  // scan through all to determine maximum order
   Order=0;
   for(int i=FragmentCounter;i--;) {
Index: src/parser.hpp
===================================================================
--- src/parser.hpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/parser.hpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -20,4 +20,8 @@
 #define EnergySuffix ".energy.all"
 #define ForcesSuffix ".forces.all"
+#define ShieldingSuffix ".sigma_all.csv"
+#define ShieldingPASSuffix ".sigma_all_PAS.csv"
+#define ShieldingFragmentSuffix ".sigma_all_fragment.all"
+#define ShieldingPASFragmentSuffix ".sigma_all_PAS_fragment.all"
 #define TimeSuffix ".speed"
 #define EnergyFragmentSuffix ".energyfragment.all"
@@ -27,10 +31,5 @@
 // ======================================= FUNCTIONS ==========================================
 
-#ifdef HAVE_INLINE
-inline bool FilePresent(const char *filename);
-#else
-bool FilePresent(const char *filename);
-#endif
-
+bool FilePresent(const char *filename, bool test);
 bool TestParams(int argc, char **argv);
 
Index: src/periodentafel.cpp
===================================================================
--- src/periodentafel.cpp	(revision 1f066feec5dd1816d82aa85f8b131467fb6faaa0)
+++ src/periodentafel.cpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -5,5 +5,7 @@
  */
 
-#include "molecules.hpp"
+using namespace std;
+
+#include "periodentafel.hpp"
 
 /************************************* Functions for class periodentafel ***************************/
Index: src/periodentafel.hpp
===================================================================
--- src/periodentafel.hpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
+++ src/periodentafel.hpp	(revision 68cb0f6ecaea70afd3066840aea2c154a6ecfb92)
@@ -0,0 +1,79 @@
+#ifndef PERIODENTAFEL_HPP_
+#define PERIODENTAFEL_HPP_
+
+using namespace std;
+
+#include "defs.hpp"
+#include "helpers.hpp"
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// ====================================== class definitions =========================
+
+class element;
+class periodentafel;
+
+/** Chemical element.
+ * Class incorporates data for a certain chemical element to be referenced from atom class.
+ */
+class element {
+  public:
+    double mass;    //!< mass in g/mol
+    double CovalentRadius;  //!< covalent radius
+    double VanDerWaalsRadius;  //!< can-der-Waals radius
+    int Z;          //!< atomic number
+    char name[64];  //!< atom name, i.e. "Hydrogren"
+    char symbol[3]; //!< short form of the atom, i.e. "H"
+    char period[8];    //!< period: n quantum number
+    char group[8];    //!< group: l quantum number
+    char block[8];    //!< block: l quantum number
+    element *previous;  //!< previous item in list
+    element *next;  //!< next element in list
+    int *sort;      //!< sorc criteria
+    int No;         //!< number of element set on periodentafel::Output()
+    double Valence;   //!< number of valence electrons for this element
+    int NoValenceOrbitals;  //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix()
+    double HBondDistance[NDIM]; //!< distance in Angstrom of this element to hydrogen  (for single, double and triple bonds)
+    double HBondAngle[NDIM];     //!< typical angle for one, two, three bonded hydrogen (in degrees)
+
+  element();
+  ~element();
+
+  //> print element entries to screen
+  bool Output(ofstream *out) const;
+  bool Checkout(ofstream *out, const int No, const int NoOfAtoms) const;
+  
+  private:
+};
+
+/** Periodentafel is a list of all elements sorted by their atomic number.
+ */
+class periodentafel {
+  public:
+    element *start; //!< start of element list
+    element *end;   //!< end of element list
+    char header1[MAXSTRINGSIZE]; //!< store first header line
+    char header2[MAXSTRINGSIZE]; //!< store second header line
+  
+  periodentafel();
+  ~periodentafel(); 
+  
+  bool AddElement(element *pointer);
+  bool RemoveElement(element *pointer);
+  bool CleanupPeriodtable();
+  element * FindElement(int Z);
+  element * FindElement(char *shorthand) const;
+  element * AskElement(); 
+  bool Output(ofstream *output) const;
+  bool Checkout(ofstream *output, const int *checkliste) const;
+  bool LoadPeriodentafel(char *filename = NULL);
+  bool StorePeriodentafel(char *filename = NULL) const;
+  
+  private:
+};
+
+
+#endif /*PERIODENTAFEL_HPP_*/
