Index: src/Actions/CmdAction/BondLengthTableAction.cpp
===================================================================
--- src/Actions/CmdAction/BondLengthTableAction.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/Actions/CmdAction/BondLengthTableAction.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -7,4 +7,5 @@
 
 #include "Actions/CmdAction/BondLengthTableAction.hpp"
+#include "bondgraph.hpp"
 #include "config.hpp"
 #include "log.hpp"
Index: src/Actions/FragmentationAction/DepthFirstSearchAction.cpp
===================================================================
--- src/Actions/FragmentationAction/DepthFirstSearchAction.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/Actions/FragmentationAction/DepthFirstSearchAction.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -8,4 +8,5 @@
 #include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
 #include "atom.hpp"
+#include "bondgraph.hpp"
 #include "config.hpp"
 #include "log.hpp"
Index: src/Actions/FragmentationAction/FragmentationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/Actions/FragmentationAction/FragmentationAction.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -8,4 +8,5 @@
 #include "Actions/FragmentationAction/FragmentationAction.hpp"
 #include "atom.hpp"
+#include "bondgraph.hpp"
 #include "config.hpp"
 #include "log.hpp"
Index: src/ConfigFileBuffer.cpp
===================================================================
--- src/ConfigFileBuffer.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/ConfigFileBuffer.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -59,6 +59,13 @@
 ConfigFileBuffer::ConfigFileBuffer(const char * const filename) : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
 {
+  InitFileBuffer(filename);
+}
+
+void ConfigFileBuffer::InitFileBuffer(const char * const filename)
+{
   ifstream *file = NULL;
   char line[MAXSTRINGSIZE];
+
+  RemoveMapping();
 
   // prescan number of lines
@@ -102,4 +109,6 @@
   file->clear();
   delete(file);
+
+  InitMapping();
 }
 
@@ -108,8 +117,6 @@
 ConfigFileBuffer::~ConfigFileBuffer()
 {
-  for(int i=0;i<NoLines;++i)
-    delete[](buffer[i]);
-  delete[](buffer);
-  delete[](LineMapping);
+  RemoveBuffer();
+  RemoveMapping();
 }
 
@@ -122,5 +129,24 @@
   for (int i=0;i<NoLines;i++)
     LineMapping[i] = i;
+  MappingAllocated = true;
 }
+
+/** Remove allocated mapping.
+ */
+void ConfigFileBuffer::RemoveMapping()
+{
+  delete[](LineMapping);
+  MappingAllocated = false;
+}
+
+/** Remove allocated mapping.
+ */
+void ConfigFileBuffer::RemoveBuffer()
+{
+  for(int i=0;i<NoLines;++i)
+    delete[](buffer[i]);
+  delete[](buffer);
+}
+
 
 /** Creates a mapping for the \a *FileBuffer's lines containing the Ion_Type keyword such that they are sorted.
@@ -134,8 +160,6 @@
 {
   map<const char *, int, IonTypeCompare> IonTypeLineMap;
-  if (LineMapping == NULL) {
-    DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl);
-    performCriticalExit();
-    return;
+  if (!MappingAllocated) {
+    InitMapping();
   }
 
@@ -156,3 +180,2 @@
   }
 }
-
Index: src/ConfigFileBuffer.hpp
===================================================================
--- src/ConfigFileBuffer.hpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/ConfigFileBuffer.hpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -33,6 +33,17 @@
     ~ConfigFileBuffer();
 
+    void InitFileBuffer(const char * const filename);
+    void MapIonTypesInBuffer(const int NoAtoms);
+
+private:
+
+    /*
+     * Whether LineMapping is allocated or not.
+     */
+    bool MappingAllocated;
+
     void InitMapping();
-    void MapIonTypesInBuffer(const int NoAtoms);
+    void RemoveMapping();
+    void RemoveBuffer();
 };
 
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/Makefile.am	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -178,4 +178,5 @@
   tesselation.cpp \
   tesselationhelpers.cpp \
+  ThermoStatContainer.cpp \
   triangleintersectionlist.cpp \
   vector.cpp \
@@ -221,4 +222,5 @@
   tesselation.hpp \
   tesselationhelpers.hpp \
+  ThermoStatContainer.hpp \
   triangleintersectionlist.hpp \
   verbose.hpp \
Index: src/ThermoStatContainer.cpp
===================================================================
--- src/ThermoStatContainer.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
+++ src/ThermoStatContainer.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -0,0 +1,127 @@
+/*
+ * ThermoStatContainer.cpp
+ *
+ *  Created on: 12.06.2010
+ *      Author: heber
+ */
+
+#include <cstring>
+
+#include "ConfigFileBuffer.hpp"
+#include "config.hpp"
+#include "log.hpp"
+#include "ThermoStatContainer.hpp"
+#include "verbose.hpp"
+
+/** Constructor for class ThermoStatContainer.
+ *
+ */
+ThermoStatContainer::ThermoStatContainer() : Thermostat(4), ThermostatImplemented(NULL),
+ThermostatNames(NULL), TempFrequency(2.5), alpha(0.), HooverMass(0.), TargetTemp(0.00095004455), ScaleTempStep(25)
+{
+  ThermostatImplemented = new int[MaxThermostats];
+  ThermostatNames = new char *[MaxThermostats];
+  for (int j=0;j<MaxThermostats;j++)
+    ThermostatNames[j] = new char[12];
+
+  strcpy(ThermostatNames[0],"None");
+  ThermostatImplemented[0] = 1;
+  strcpy(ThermostatNames[1],"Woodcock");
+  ThermostatImplemented[1] = 1;
+  strcpy(ThermostatNames[2],"Gaussian");
+  ThermostatImplemented[2] = 1;
+  strcpy(ThermostatNames[3],"Langevin");
+  ThermostatImplemented[3] = 1;
+  strcpy(ThermostatNames[4],"Berendsen");
+  ThermostatImplemented[4] = 1;
+  strcpy(ThermostatNames[5],"NoseHoover");
+  ThermostatImplemented[5] = 1;
+}
+
+/** Destructor for Class ThermoStatContainer.
+ *
+ */
+ThermoStatContainer::~ThermoStatContainer()
+{
+  delete[](ThermostatImplemented);
+  for (int j=0;j<MaxThermostats;j++)
+    delete[](ThermostatNames[j]);
+  delete[](ThermostatNames);
+}
+
+
+/** Reading of Thermostat related values from parameter file.
+ * \param *fb file buffer containing the config file
+ */
+void ThermoStatContainer::ParseThermostats(class ConfigFileBuffer * const fb)
+{
+  char * const thermo = new char[12];
+  const int verbose = 0;
+
+  // read desired Thermostat from file along with needed additional parameters
+  if (ParseForParameter(verbose,fb,"Thermostat", 0, 1, 1, string_type, thermo, 1, optional)) {
+    if (strcmp(thermo, ThermostatNames[0]) == 0) { // None
+      if (ThermostatImplemented[0] == 1) {
+        Thermostat = None;
+      } else {
+        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
+        Thermostat = None;
+      }
+    } else if (strcmp(thermo, ThermostatNames[1]) == 0) { // Woodcock
+      if (ThermostatImplemented[1] == 1) {
+        Thermostat = Woodcock;
+        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read scaling frequency
+      } else {
+        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
+        Thermostat = None;
+      }
+    } else if (strcmp(thermo, ThermostatNames[2]) == 0) { // Gaussian
+      if (ThermostatImplemented[2] == 1) {
+        Thermostat = Gaussian;
+        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read collision rate
+      } else {
+        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
+        Thermostat = None;
+      }
+    } else if (strcmp(thermo, ThermostatNames[3]) == 0) { // Langevin
+      if (ThermostatImplemented[3] == 1) {
+        Thermostat = Langevin;
+        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read gamma
+        if (ParseForParameter(verbose,fb,"Thermostat", 0, 3, 1, double_type, &alpha, 1, optional)) {
+          DoLog(2) && (Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl);
+        } else {
+          alpha = 1.;
+        }
+      } else {
+        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
+        Thermostat = None;
+      }
+    } else if (strcmp(thermo, ThermostatNames[4]) == 0) { // Berendsen
+      if (ThermostatImplemented[4] == 1) {
+        Thermostat = Berendsen;
+        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read \tau_T
+      } else {
+        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
+        Thermostat = None;
+      }
+    } else if (strcmp(thermo, ThermostatNames[5]) == 0) { // Nose-Hoover
+      if (ThermostatImplemented[5] == 1) {
+        Thermostat = NoseHoover;
+        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &HooverMass, 1, critical); // read Hoovermass
+        alpha = 0.;
+      } else {
+        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
+        Thermostat = None;
+      }
+    } else {
+      DoLog(1) && (Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl);
+      Thermostat = None;
+    }
+  } else {
+    if ((TargetTemp != 0))
+      DoLog(2) && (Log() << Verbose(2) <<  "No thermostat chosen despite finite temperature MD, falling back to None." << endl);
+    Thermostat = None;
+  }
+  delete[](thermo);
+};
+
Index: src/ThermoStatContainer.hpp
===================================================================
--- src/ThermoStatContainer.hpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
+++ src/ThermoStatContainer.hpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -0,0 +1,38 @@
+/*
+ * ThermoStatContainer.hpp
+ *
+ *  Created on: 12.06.2010
+ *      Author: heber
+ */
+
+#ifndef THERMOSTATCONTAINER_HPP_
+#define THERMOSTATCONTAINER_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+class ConfigFileBuffer;
+
+#define MaxThermostats 6      //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented
+enum thermostats { None, Woodcock, Gaussian, Langevin, Berendsen, NoseHoover };   //!< Thermostat names for output
+
+class ThermoStatContainer {
+public:
+  ThermoStatContainer();
+  ~ThermoStatContainer();
+
+  void ParseThermostats(class ConfigFileBuffer * const fb);
+
+  int Thermostat;
+  int *ThermostatImplemented;
+  char **ThermostatNames;
+  double TempFrequency;
+  double alpha;
+  double HooverMass;
+  double TargetTemp;
+  int ScaleTempStep;
+};
+
+#endif /* THERMOSTATCONTAINER_HPP_ */
Index: src/atom_trajectoryparticle.cpp
===================================================================
--- src/atom_trajectoryparticle.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/atom_trajectoryparticle.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -13,4 +13,5 @@
 #include "log.hpp"
 #include "parser.hpp"
+#include "ThermoStatContainer.hpp"
 #include "verbose.hpp"
 
@@ -195,9 +196,9 @@
 void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration)
 {
-  double sigma  = sqrt(configuration->TargetTemp/type->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
+  double sigma  = sqrt(configuration->Thermostats->TargetTemp/type->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)
   Vector &U = Trajectory.U.at(Step);
   if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
     // throw a dice to determine whether it gets hit by a heat bath particle
-    if (((((rand()/(double)RAND_MAX))*configuration->TempFrequency) < 1.)) {
+    if (((((rand()/(double)RAND_MAX))*configuration->Thermostats->TempFrequency) < 1.)) {
       DoLog(3) && (Log() << Verbose(3) << "Particle " << *this << " was hit (sigma " << sigma << "): " << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << " -> ");
       // pick three random numbers from a Boltzmann distribution around the desired temperature T for each momenta axis
@@ -223,5 +224,5 @@
   if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
     for (int d=0; d<NDIM; d++) {
-      U[d] *= sqrt(1+(configuration->Deltat/configuration->TempFrequency)*(ScaleTempFactor-1));
+      U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1));
       *ekin += 0.5*type->mass * U[d]*U[d];
     }
@@ -253,5 +254,5 @@
   if (FixedIon == 0) { // even FixedIon moves, only not by other's forces
     for (int d=0; d<NDIM; d++) {
-        U[d] += configuration->Deltat/type->mass * (configuration->alpha * (U[d] * type->mass));
+        U[d] += configuration->Deltat/type->mass * (configuration->Thermostats->alpha * (U[d] * type->mass));
         *ekin += (0.5*type->mass) * U[d]*U[d];
       }
Index: src/config.cpp
===================================================================
--- src/config.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/config.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -10,5 +10,7 @@
 #include "atom.hpp"
 #include "bond.hpp"
+#include "bondgraph.hpp"
 #include "config.hpp"
+#include "ConfigFileBuffer.hpp"
 #include "element.hpp"
 #include "helpers.hpp"
@@ -20,4 +22,5 @@
 #include "molecule.hpp"
 #include "periodentafel.hpp"
+#include "ThermoStatContainer.hpp"
 #include "World.hpp"
 
@@ -26,7 +29,6 @@
 /** Constructor for config file class.
  */
-config::config() : BG(NULL), PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), configpath(NULL),
-    configname(NULL), FastParsing(false), Deltat(0.01), basis(""), databasepath(NULL), DoConstrainedMD(0), MaxOuterStep(0), Thermostat(4), ThermostatImplemented(NULL),
-    ThermostatNames(NULL), TempFrequency(2.5), alpha(0.), HooverMass(0.), TargetTemp(0.00095004455), ScaleTempStep(25),  mainname(NULL), defaultpath(NULL), pseudopotpath(NULL),
+config::config() : BG(NULL), Thermostats(0), PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), configpath(NULL),
+    configname(NULL), FastParsing(false), Deltat(0.01), basis(""), databasepath(NULL), DoConstrainedMD(0), MaxOuterStep(0), mainname(NULL), defaultpath(NULL), pseudopotpath(NULL),
     DoOutVis(0), DoOutMes(1), DoOutNICS(0), DoOutOrbitals(0), DoOutCurrent(0), DoFullCurrent(0), DoPerturbation(0), DoWannier(0), CommonWannier(0), SawtoothStart(0.01),
     VectorPlane(0), VectorCut(0.), UseAddGramSch(1), Seed(1), OutVisStep(10), OutSrcStep(5), MaxPsiStep(0), EpsWannier(1e-7), MaxMinStep(100), RelEpsTotalEnergy(1e-7),
@@ -40,4 +42,5 @@
   configpath = new char[MAXSTRINGSIZE];
   configname = new char[MAXSTRINGSIZE];
+  Thermostats = new ThermoStatContainer();
   strcpy(mainname,"pcp");
   strcpy(defaultpath,"not specified");
@@ -46,6 +49,4 @@
   configname[0]='\0';
   basis = "3-21G";
-
-  InitThermostats();
 };
 
@@ -60,111 +61,10 @@
   delete[](configpath);
   delete[](configname);
-  delete[](ThermostatImplemented);
-  for (int j=0;j<MaxThermostats;j++)
-    delete[](ThermostatNames[j]);
-  delete[](ThermostatNames);
+  if (Thermostats != NULL)
+    delete(Thermostats);
 
   if (BG != NULL)
     delete(BG);
 };
-
-/** Initialises variables in class config for Thermostats.
- */
-void config::InitThermostats()
-{
-  ThermostatImplemented = new int[MaxThermostats];
-  ThermostatNames = new char *[MaxThermostats];
-  for (int j=0;j<MaxThermostats;j++)
-    ThermostatNames[j] = new char[12];
-
-  strcpy(ThermostatNames[0],"None");
-  ThermostatImplemented[0] = 1;
-  strcpy(ThermostatNames[1],"Woodcock");
-  ThermostatImplemented[1] = 1;
-  strcpy(ThermostatNames[2],"Gaussian");
-  ThermostatImplemented[2] = 1;
-  strcpy(ThermostatNames[3],"Langevin");
-  ThermostatImplemented[3] = 1;
-  strcpy(ThermostatNames[4],"Berendsen");
-  ThermostatImplemented[4] = 1;
-  strcpy(ThermostatNames[5],"NoseHoover");
-  ThermostatImplemented[5] = 1;
-};
-
-/** Readin of Thermostat related values from parameter file.
- * \param *fb file buffer containing the config file
- */
-void config::ParseThermostats(class ConfigFileBuffer * const fb)
-{
-  char * const thermo = new char[12];
-  const int verbose = 0;
-
-  // read desired Thermostat from file along with needed additional parameters
-  if (ParseForParameter(verbose,fb,"Thermostat", 0, 1, 1, string_type, thermo, 1, optional)) {
-    if (strcmp(thermo, ThermostatNames[0]) == 0) { // None
-      if (ThermostatImplemented[0] == 1) {
-        Thermostat = None;
-      } else {
-        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
-        Thermostat = None;
-      }
-    } else if (strcmp(thermo, ThermostatNames[1]) == 0) { // Woodcock
-      if (ThermostatImplemented[1] == 1) {
-        Thermostat = Woodcock;
-        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read scaling frequency
-      } else {
-        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
-        Thermostat = None;
-      }
-    } else if (strcmp(thermo, ThermostatNames[2]) == 0) { // Gaussian
-      if (ThermostatImplemented[2] == 1) {
-        Thermostat = Gaussian;
-        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read collision rate
-      } else {
-        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
-        Thermostat = None;
-      }
-    } else if (strcmp(thermo, ThermostatNames[3]) == 0) { // Langevin
-      if (ThermostatImplemented[3] == 1) {
-        Thermostat = Langevin;
-        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read gamma
-        if (ParseForParameter(verbose,fb,"Thermostat", 0, 3, 1, double_type, &alpha, 1, optional)) {
-          DoLog(2) && (Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl);
-        } else {
-          alpha = 1.;
-        }
-      } else {
-        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
-        Thermostat = None;
-      }
-    } else if (strcmp(thermo, ThermostatNames[4]) == 0) { // Berendsen
-      if (ThermostatImplemented[4] == 1) {
-        Thermostat = Berendsen;
-        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read \tau_T
-      } else {
-        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
-        Thermostat = None;
-      }
-    } else if (strcmp(thermo, ThermostatNames[5]) == 0) { // Nose-Hoover
-      if (ThermostatImplemented[5] == 1) {
-        Thermostat = NoseHoover;
-        ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &HooverMass, 1, critical); // read Hoovermass
-        alpha = 0.;
-      } else {
-        DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);
-        Thermostat = None;
-      }
-    } else {
-      DoLog(1) && (Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl);
-      Thermostat = None;
-    }
-  } else {
-    if ((MaxOuterStep > 0) && (TargetTemp != 0)) 
-      DoLog(2) && (Log() << Verbose(2) <<  "No thermostat chosen despite finite temperature MD, falling back to None." << endl);
-    Thermostat = None;
-  }
-  delete[](thermo);
-};
-
 
 /** Displays menu for editing each entry of the config file.
@@ -508,19 +408,4 @@
 };
 
-/** Initializes ConfigFileBuffer from a file.
- * \param *file input file stream being the opened config file
- * \param *FileBuffer pointer to FileBuffer on return, should point to NULL
- */
-void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer)
-{
-  if (FileBuffer != NULL) {
-    DoeLog(2) && (eLog()<< Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl);
-    delete(FileBuffer);
-  }
-  FileBuffer = new ConfigFileBuffer(filename);
-
-  FileBuffer->InitMapping();
-};
-
 /** Loads a molecule from a ConfigFileBuffer.
  * \param *mol molecule to load
@@ -719,6 +604,5 @@
 
   // ParseParameterFile
-  struct ConfigFileBuffer *FileBuffer = NULL;
-  PrepareFileBuffer(filename,FileBuffer);
+  class ConfigFileBuffer *FileBuffer = new ConfigFileBuffer(filename);
 
   /* Oeffne Hauptparameterdatei */
@@ -729,5 +613,6 @@
   int verbose = 0;
   
-  ParseThermostats(FileBuffer);
+  //TODO: This is actually sensible?: if (MaxOuterStep > 0)
+  Thermostats->ParseThermostats(FileBuffer);
   
   /* Namen einlesen */
@@ -793,5 +678,5 @@
   ParseForParameter(verbose,FileBuffer,"OutVisStep", 0, 1, 1, int_type, &(config::OutVisStep), 1, optional);
   ParseForParameter(verbose,FileBuffer,"OutSrcStep", 0, 1, 1, int_type, &(config::OutSrcStep), 1, optional);
-  ParseForParameter(verbose,FileBuffer,"TargetTemp", 0, 1, 1, double_type, &(config::TargetTemp), 1, optional);
+  ParseForParameter(verbose,FileBuffer,"TargetTemp", 0, 1, 1, double_type, &(Thermostats->TargetTemp), 1, optional);
   //ParseForParameter(verbose,FileBuffer,"Thermostat", 0, 1, 1, int_type, &(config::ScaleTempStep), 1, optional);
   if (!ParseForParameter(verbose,FileBuffer,"EpsWannier", 0, 1, 1, double_type, &(config::EpsWannier), 1, optional))
@@ -1002,6 +887,6 @@
   ParseForParameter(verbose,file,"VisOuterStep", 0, 1, 1, int_type, &(config::OutVisStep), 1, optional);
   ParseForParameter(verbose,file,"VisSrcOuterStep", 0, 1, 1, int_type, &(config::OutSrcStep), 1, optional);
-  ParseForParameter(verbose,file,"TargetTemp", 0, 1, 1, double_type, &(config::TargetTemp), 1, optional);
-  ParseForParameter(verbose,file,"ScaleTempStep", 0, 1, 1, int_type, &(config::ScaleTempStep), 1, optional);
+  ParseForParameter(verbose,file,"TargetTemp", 0, 1, 1, double_type, &(Thermostats->TargetTemp), 1, optional);
+  ParseForParameter(verbose,file,"ScaleTempStep", 0, 1, 1, int_type, &(Thermostats->ScaleTempStep), 1, optional);
   config::EpsWannier = 1e-8;
 
@@ -1191,23 +1076,23 @@
     *output << "DoFullCurrent\t" << config::DoFullCurrent << "\t# Do full perturbation" << endl;
     *output << "DoConstrainedMD\t" << config::DoConstrainedMD << "\t# Do perform a constrained (>0, relating to current MD step) instead of unconstrained (0) MD" << endl;
-    *output << "Thermostat\t" << ThermostatNames[Thermostat] << "\t";
-    switch(Thermostat) {
+    *output << "Thermostat\t" << Thermostats->ThermostatNames[Thermostats->Thermostat] << "\t";
+    switch(Thermostats->Thermostat) {
       default:
       case None:
         break;
       case Woodcock:
-        *output << ScaleTempStep;
+        *output << Thermostats->ScaleTempStep;
         break;
       case Gaussian:
-        *output << ScaleTempStep;
+        *output << Thermostats->ScaleTempStep;
         break;
       case Langevin:
-        *output << TempFrequency << "\t" << alpha;
+        *output << Thermostats->TempFrequency << "\t" << Thermostats->alpha;
         break;
       case Berendsen:
-        *output << TempFrequency;
+        *output << Thermostats->TempFrequency;
         break;
       case NoseHoover:
-        *output << HooverMass;
+        *output << Thermostats->HooverMass;
         break;
     };
@@ -1224,5 +1109,5 @@
     *output << "OutVisStep\t" << config::OutVisStep << "\t# Output visual data every ...th step" << endl;
     *output << "OutSrcStep\t" << config::OutSrcStep << "\t# Output \"restart\" data every ..th step" << endl;
-    *output << "TargetTemp\t" << config::TargetTemp << "\t# Target temperature" << endl;
+    *output << "TargetTemp\t" << Thermostats->TargetTemp << "\t# Target temperature" << endl;
     *output << "MaxPsiStep\t" << config::MaxPsiStep << "\t# number of Minimisation steps per state (0 - default)" << endl;
     *output << "EpsWannier\t" << config::EpsWannier << "\t# tolerance value for spread minimisation of orbitals" << endl;
Index: src/config.hpp
===================================================================
--- src/config.hpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/config.hpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -20,12 +20,12 @@
 #include <string>
 
-#include "bondgraph.hpp"
-#include "ConfigFileBuffer.hpp"
-
 /****************************************** forward declarations *****************************/
 
+class BondGraph;
+class ConfigFileBuffer;
 class molecule;
 class MoleculeListClass;
 class periodentafel;
+class ThermoStatContainer;
 
 /********************************************** declarations *******************************/
@@ -37,4 +37,5 @@
   public:
     class BondGraph *BG;
+    class ThermoStatContainer *Thermostats;
 
     int PsiType;
@@ -56,12 +57,4 @@
     int DoConstrainedMD;
     int MaxOuterStep;
-    int Thermostat;
-    int *ThermostatImplemented;
-    char **ThermostatNames;
-    double TempFrequency;
-    double alpha;
-    double HooverMass;
-    double TargetTemp;
-    int ScaleTempStep;
 
   private:
@@ -138,6 +131,4 @@
   char *GetDefaultPath() const;
   void SetDefaultPath(const char * const path);
-  void InitThermostats();
-  void ParseThermostats(class ConfigFileBuffer * const fb);
 };
 
Index: src/molecule.hpp
===================================================================
--- src/molecule.hpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/molecule.hpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -80,8 +80,4 @@
   double *PenaltyConstants;   //!<  penalty constant in front of each term
 };
-
-#define MaxThermostats 6      //!< maximum number of thermostat entries in Ions#ThermostatNames and Ions#ThermostatImplemented 
-enum thermostats { None, Woodcock, Gaussian, Langevin, Berendsen, NoseHoover };   //!< Thermostat names for output
-
 
 /** The complete molecule.
Index: src/molecule_dynamics.cpp
===================================================================
--- src/molecule_dynamics.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/molecule_dynamics.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -16,4 +16,5 @@
 #include "parser.hpp"
 #include "Plane.hpp"
+#include "ThermoStatContainer.hpp"
 
 /************************************* Functions for class molecule *********************************/
@@ -641,5 +642,5 @@
 
   // calculate scale configuration
-  ScaleTempFactor = configuration.TargetTemp/ActualTemp;
+  ScaleTempFactor = configuration.Thermostats->TargetTemp/ActualTemp;
 
   // differentating between the various thermostats
@@ -649,5 +650,5 @@
       break;
      case Woodcock:
-      if ((configuration.ScaleTempStep > 0) && ((MDSteps-1) % configuration.ScaleTempStep == 0)) {
+      if ((configuration.Thermostats->ScaleTempStep > 0) && ((MDSteps-1) % configuration.Thermostats->ScaleTempStep == 0)) {
         DoLog(2) && (Log() << Verbose(2) <<  "Applying Woodcock thermostat..." << endl);
         ActOnAllAtoms( &atom::Thermostat_Woodcock, sqrt(ScaleTempFactor), MDSteps, &ekin );
@@ -682,7 +683,7 @@
       delta_alpha = 0.;
       ActOnAllAtoms( &atom::Thermostat_NoseHoover_init, MDSteps, &delta_alpha );
-      delta_alpha = (delta_alpha - (3.*getAtomCount()+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass);
-      configuration.alpha += delta_alpha*configuration.Deltat;
-      DoLog(3) && (Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl);
+      delta_alpha = (delta_alpha - (3.*getAtomCount()+1.) * configuration.Thermostats->TargetTemp)/(configuration.Thermostats->HooverMass*Units2Electronmass);
+      configuration.Thermostats->alpha += delta_alpha*configuration.Deltat;
+      DoLog(3) && (Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.Thermostats->alpha << "." << endl);
       // apply updated alpha as additional force
       ActOnAllAtoms( &atom::Thermostat_NoseHoover_scale, MDSteps, &ekin, &configuration );
Index: src/moleculelist.cpp
===================================================================
--- src/moleculelist.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/moleculelist.cpp	(revision a3fded485f7f96b3a75bd175b6c7cdda9af47a7a)
@@ -10,4 +10,5 @@
 #include "atom.hpp"
 #include "bond.hpp"
+#include "bondgraph.hpp"
 #include "boundary.hpp"
 #include "config.hpp"
