Index: src/ConfigFileBuffer.cpp
===================================================================
--- src/ConfigFileBuffer.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/ConfigFileBuffer.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
@@ -0,0 +1,158 @@
+/*
+ * ConfigFileBuffer.cpp
+ *
+ *  Created on: 12.06.2010
+ *      Author: heber
+ */
+
+#include "ConfigFileBuffer.hpp"
+#include "helpers.hpp"
+#include "lists.hpp"
+#include "log.hpp"
+#include "World.hpp"
+
+/******************************** Functions for class ConfigFileBuffer **********************/
+
+/** Structure containing compare function for Ion_Type sorting.
+ */
+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));
+    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));
+    }
+  }
+};
+
+/** Constructor for ConfigFileBuffer class.
+ */
+ConfigFileBuffer::ConfigFileBuffer() : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
+{
+};
+
+/** Constructor for ConfigFileBuffer class with filename to be parsed.
+ * \param *filename file name
+ */
+ConfigFileBuffer::ConfigFileBuffer(const char * const filename) : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
+{
+  ifstream *file = NULL;
+  char line[MAXSTRINGSIZE];
+
+  // prescan number of lines
+  file= new ifstream(filename);
+  if (file == NULL) {
+    DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);
+    return;
+  }
+  NoLines = 0; // we're overcounting by one
+  long file_position = file->tellg(); // mark current position
+  do {
+    file->getline(line, 256);
+    NoLines++;
+  } while (!file->eof());
+  file->clear();
+  file->seekg(file_position, ios::beg);
+  DoLog(1) && (Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl);
+
+  // allocate buffer's 1st dimension
+  if (buffer != NULL) {
+    DoeLog(1) && (eLog()<< Verbose(1) << "FileBuffer->buffer is not NULL!" << endl);
+    return;
+  } else
+    buffer = new char *[NoLines];
+
+  // scan each line and put into buffer
+  int lines=0;
+  int i;
+  do {
+    buffer[lines] = new char[MAXSTRINGSIZE];
+    file->getline(buffer[lines], MAXSTRINGSIZE-1);
+    i = strlen(buffer[lines]);
+    buffer[lines][i] = '\n';
+    buffer[lines][i+1] = '\0';
+    lines++;
+  } while((!file->eof()) && (lines < NoLines));
+  DoLog(1) && (Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl);
+
+  // close and exit
+  file->close();
+  file->clear();
+  delete(file);
+}
+
+/** Destructor for ConfigFileBuffer class.
+ */
+ConfigFileBuffer::~ConfigFileBuffer()
+{
+  for(int i=0;i<NoLines;++i)
+    delete[](buffer[i]);
+  delete[](buffer);
+  delete[](LineMapping);
+}
+
+
+/** Create trivial mapping.
+ */
+void ConfigFileBuffer::InitMapping()
+{
+  LineMapping = new int[NoLines];
+  for (int i=0;i<NoLines;i++)
+    LineMapping[i] = i;
+}
+
+/** Creates a mapping for the \a *FileBuffer's lines containing the Ion_Type keyword such that they are sorted.
+ * \a *map on return contains a list of NoAtom entries such that going through the list, yields indices to the
+ * lines in \a *FileBuffer in a sorted manner of the Ion_Type?_? keywords. We assume that ConfigFileBuffer::CurrentLine
+ * points to first Ion_Type entry.
+ * \param *FileBuffer pointer to buffer structure
+ * \param NoAtoms of subsequent lines to look at
+ */
+void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms)
+{
+  map<const char *, int, IonTypeCompare> IonTypeLineMap;
+  if (LineMapping == NULL) {
+    DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl);
+    performCriticalExit();
+    return;
+  }
+
+  // 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
+  int nr=0;
+  for (map<const char *, 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);
+      performCriticalExit();
+    }
+  }
+}
+
Index: src/ConfigFileBuffer.hpp
===================================================================
--- src/ConfigFileBuffer.hpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
+++ src/ConfigFileBuffer.hpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
@@ -0,0 +1,40 @@
+/*
+ * ConfigFileBuffer.hpp
+ *
+ *  Created on: 12.06.2010
+ *      Author: heber
+ */
+
+#ifndef CONFIGFILEBUFFER_HPP_
+#define CONFIGFILEBUFFER_HPP_
+
+
+/*********************************************** includes ***********************************/
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+/****************************************** forward declarations *****************************/
+
+/********************************************** declarations *******************************/
+
+class ConfigFileBuffer {
+  public:
+    char **buffer;
+    int *LineMapping;
+    int CurrentLine;
+    int NoLines;
+
+    ConfigFileBuffer();
+    ConfigFileBuffer(const char * const filename);
+    ~ConfigFileBuffer();
+
+    void InitMapping();
+    void MapIonTypesInBuffer(const int NoAtoms);
+};
+
+
+#endif /* CONFIGFILEBUFFER_HPP_ */
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 980dd655b657aeb3ce3173a95b5ac1122b2f7062)
+++ src/Makefile.am	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
@@ -90,4 +90,5 @@
   Parser/TremoloParser.cpp \
   Parser/XyzParser.cpp
+
 PARSERHEADER = \
   Parser/ChangeTracker.hpp \
@@ -114,6 +115,6 @@
   Descriptors/MoleculeDescriptor.cpp \
   Descriptors/MoleculeIdDescriptor.cpp \ 
-  Descriptors/MoleculeNameDescriptor.cpp \ 
-  Descriptors/MoleculePtrDescriptor.cpp 
+  Descriptors/MoleculeNameDescriptor.cpp \
+  Descriptors/MoleculePtrDescriptor.cpp
 				   
 
@@ -151,4 +152,5 @@
   CommandLineParser.cpp \
   config.cpp \
+  ConfigFileBuffer.cpp \
   element.cpp \
   elements_db.cpp \
@@ -196,4 +198,5 @@
   CommandLineParser.hpp \
   config.hpp \
+  ConfigFileBuffer.hpp \
   defs.hpp \
   element.hpp \
Index: src/config.cpp
===================================================================
--- src/config.cpp	(revision 980dd655b657aeb3ce3173a95b5ac1122b2f7062)
+++ src/config.cpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
@@ -8,5 +8,4 @@
 #include <cstring>
 
-#include "World.hpp"
 #include "atom.hpp"
 #include "bond.hpp"
@@ -22,149 +21,4 @@
 #include "periodentafel.hpp"
 #include "World.hpp"
-
-/******************************** Functions for class ConfigFileBuffer **********************/
-
-/** Structure containing compare function for Ion_Type sorting.
- */
-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));
-    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));
-    }
-  }
-};
-
-/** Constructor for ConfigFileBuffer class.
- */
-ConfigFileBuffer::ConfigFileBuffer() : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
-{
-};
-
-/** Constructor for ConfigFileBuffer class with filename to be parsed.
- * \param *filename file name
- */
-ConfigFileBuffer::ConfigFileBuffer(const char * const filename) : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
-{
-  ifstream *file = NULL;
-  char line[MAXSTRINGSIZE];
-
-  // prescan number of lines
-  file= new ifstream(filename);
-  if (file == NULL) {
-    DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);
-    return;
-  }
-  NoLines = 0; // we're overcounting by one
-  long file_position = file->tellg(); // mark current position
-  do {
-    file->getline(line, 256);
-    NoLines++;
-  } while (!file->eof());
-  file->clear();
-  file->seekg(file_position, ios::beg);
-  DoLog(1) && (Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl);
-
-  // allocate buffer's 1st dimension
-  if (buffer != NULL) {
-    DoeLog(1) && (eLog()<< Verbose(1) << "FileBuffer->buffer is not NULL!" << endl);
-    return;
-  } else
-    buffer = new char *[NoLines];
-
-  // scan each line and put into buffer
-  int lines=0;
-  int i;
-  do {
-    buffer[lines] = new char[MAXSTRINGSIZE];
-    file->getline(buffer[lines], MAXSTRINGSIZE-1);
-    i = strlen(buffer[lines]);
-    buffer[lines][i] = '\n';
-    buffer[lines][i+1] = '\0';
-    lines++;
-  } while((!file->eof()) && (lines < NoLines));
-  DoLog(1) && (Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl);
-
-  // close and exit
-  file->close();
-  file->clear();
-  delete(file);
-}
-
-/** Destructor for ConfigFileBuffer class.
- */
-ConfigFileBuffer::~ConfigFileBuffer()
-{
-  for(int i=0;i<NoLines;++i)
-    delete[](buffer[i]);
-  delete[](buffer);
-  delete[](LineMapping);
-}
-
-
-/** Create trivial mapping.
- */
-void ConfigFileBuffer::InitMapping()
-{
-  LineMapping = new int[NoLines];
-  for (int i=0;i<NoLines;i++)
-    LineMapping[i] = i;
-}
-
-/** Creates a mapping for the \a *FileBuffer's lines containing the Ion_Type keyword such that they are sorted.
- * \a *map on return contains a list of NoAtom entries such that going through the list, yields indices to the
- * lines in \a *FileBuffer in a sorted manner of the Ion_Type?_? keywords. We assume that ConfigFileBuffer::CurrentLine
- * points to first Ion_Type entry.
- * \param *FileBuffer pointer to buffer structure
- * \param NoAtoms of subsequent lines to look at
- */
-void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms)
-{
-  map<const char *, int, IonTypeCompare> IonTypeLineMap;
-  if (LineMapping == NULL) {
-    DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl);
-    performCriticalExit();
-    return;
-  }
-
-  // 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
-  int nr=0;
-  for (map<const char *, 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);
-      performCriticalExit();
-    }
-  }
-}
 
 /************************************* Functions for class config ***************************/
Index: src/config.hpp
===================================================================
--- src/config.hpp	(revision 980dd655b657aeb3ce3173a95b5ac1122b2f7062)
+++ src/config.hpp	(revision 88104f086073b22665cda040c1703bc0f50a7de1)
@@ -21,4 +21,5 @@
 
 #include "bondgraph.hpp"
+#include "ConfigFileBuffer.hpp"
 
 /****************************************** forward declarations *****************************/
@@ -29,19 +30,4 @@
 
 /********************************************** declarations *******************************/
-
-class ConfigFileBuffer {
-  public:
-    char **buffer;
-    int *LineMapping;
-    int CurrentLine;
-    int NoLines;
-
-    ConfigFileBuffer();
-    ConfigFileBuffer(const char * const filename);
-    ~ConfigFileBuffer();
-
-    void InitMapping();
-    void MapIonTypesInBuffer(const int NoAtoms);
-};
 
 /** The config file.
