Index: src/Actions/AnalysisAction/PairCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationAction.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Actions/AnalysisAction/PairCorrelationAction.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -75,5 +75,5 @@
   ofstream output;
   ofstream binoutput;
-  std::vector< element *> elements;
+  std::vector<const element *> elements;
   string type;
   Vector Point;
Index: src/Actions/AnalysisAction/PointCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PointCorrelationAction.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Actions/AnalysisAction/PointCorrelationAction.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -76,5 +76,5 @@
   ofstream output;
   ofstream binoutput;
-  std::vector< element *> elements;
+  std::vector<const element *> elements;
   string type;
   Vector Point;
@@ -96,6 +96,6 @@
   cout << "Point to correlate to is  " << Point << endl;
   CorrelationToPointMap *correlationmap = NULL;
-  for(std::vector< element *>::iterator iter = elements.begin(); iter != elements.end(); ++iter)
-    cout << "element is " << (*iter)->symbol << endl;
+  for(std::vector<const element *>::iterator iter = elements.begin(); iter != elements.end(); ++iter)
+    cout << "element is " << (*iter)->getSymbol() << endl;
   std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
   if (periodic)
Index: src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -79,5 +79,5 @@
   ofstream output;
   ofstream binoutput;
-  std::vector< element *> elements;
+  std::vector<const element *> elements;
   string type;
   Vector Point;
Index: src/Actions/AtomAction/AddAction.cpp
===================================================================
--- src/Actions/AtomAction/AddAction.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Actions/AtomAction/AddAction.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -52,5 +52,5 @@
 
 Action::state_ptr AtomAddAction::performCall() {
-  element * elemental = NULL;
+  const element * elemental = NULL;
   Vector position;
 
@@ -63,5 +63,5 @@
   first->setType(elemental);
   first->setPosition(position);
-  DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->name << " at " << (first->getPosition()) << "." << endl);
+  DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->getName() << " at " << (first->getPosition()) << "." << endl);
   // TODO: remove when all of World's atoms are stored.
   std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
Index: src/Actions/AtomAction/ChangeElementAction.cpp
===================================================================
--- src/Actions/AtomAction/ChangeElementAction.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Actions/AtomAction/ChangeElementAction.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -51,5 +51,5 @@
 Action::state_ptr AtomChangeElementAction::performCall() {
   atom *first = NULL;
-  element *elemental = NULL;
+  const element *elemental;
   molecule *mol = NULL;
 
@@ -58,5 +58,5 @@
   for (World::AtomSelectionIterator iter = World::getInstance().beginAtomSelection(); iter != World::getInstance().endAtomSelection(); ++iter) {
     first = iter->second;
-    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << elemental->symbol << "." << endl);
+    DoLog(1) && (Log() << Verbose(1) << "Changing atom " << *first << " to element " << *elemental << "." << endl);
     mol = first->getMolecule();
     first->removeFromMolecule(); // remove atom
Index: src/Actions/MapOfActions.cpp
===================================================================
--- src/Actions/MapOfActions.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Actions/MapOfActions.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -296,5 +296,5 @@
 
   // value types for the actions
-  TypeMap["add-atom"] = &typeid(element);
+  TypeMap["add-atom"] = &typeid(const element);
   TypeMap["bond-file"] = &typeid(std::string);
   TypeMap["bond-table"] = &typeid(std::string);
@@ -302,5 +302,5 @@
   TypeMap["center-in-box"] = &typeid(BoxValue);
   TypeMap["change-box"] = &typeid(BoxValue);
-  TypeMap["change-element"] = &typeid(element);
+  TypeMap["change-element"] = &typeid(const element);
   TypeMap["change-molname"] = &typeid(std::string);
   TypeMap["convex-envelope"] = &typeid(void);
@@ -348,6 +348,6 @@
   TypeMap["distances"] = &typeid(VectorValue);
   TypeMap["DoRotate"] = &typeid(bool);
-  TypeMap["element"] = &typeid(element);
-  TypeMap["elements"] = &typeid(std::vector<element *>);
+  TypeMap["element"] = &typeid(const element);
+  TypeMap["elements"] = &typeid(std::vector<const element *>);
   TypeMap["end-step"] = &typeid(int);
   TypeMap["id-mapping"] = &typeid(bool);
@@ -386,6 +386,6 @@
   TypeEnumMap[&typeid(atom)] = Atom;
   TypeEnumMap[&typeid(std::vector<atom *>)] = ListOfAtoms;
-  TypeEnumMap[&typeid(element)] = Element;
-  TypeEnumMap[&typeid(std::vector<element *>)] = ListOfElements;
+  TypeEnumMap[&typeid(const element)] = Element;
+  TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElements;
 
   // default values for any action that needs one (always string!)
@@ -568,7 +568,7 @@
 }
 
-void MapOfActions::queryCurrentValue(const char * name, class element * &_T)  {
+void MapOfActions::queryCurrentValue(const char * name, const element * &_T)  {
   int Z = -1;
-  if (typeid( element ) == *TypeMap[name]) {
+  if (typeid(const element ) == *TypeMap[name]) {
     if (CurrentValue.find(name) == CurrentValue.end())
       throw MissingValueException(__FILE__, __LINE__);
@@ -652,9 +652,9 @@
 }
 
-void MapOfActions::queryCurrentValue(const char * name, std::vector<element *>&_T)
+void MapOfActions::queryCurrentValue(const char * name, std::vector<const element *>&_T)
 {
   int Z = -1;
-  element *elemental = NULL;
-  if (typeid( std::vector<element *> ) == *TypeMap[name]) {
+  const element *elemental = NULL;
+  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
     if (CurrentValue.find(name) == CurrentValue.end())
       throw MissingValueException(__FILE__, __LINE__);
@@ -704,7 +704,7 @@
 }
 
-void MapOfActions::setCurrentValue(const char * name, class element * &_T)
-{
-  if (typeid( element ) == *TypeMap[name]) {
+void MapOfActions::setCurrentValue(const char * name, const element * &_T)
+{
+  if (typeid(const element ) == *TypeMap[name]) {
     std::ostringstream stream;
     stream << _T->Z;
@@ -764,9 +764,9 @@
 }
 
-void MapOfActions::setCurrentValue(const char * name, std::vector<element *>&_T)
-{
-  if (typeid( std::vector<element *> ) == *TypeMap[name]) {
+void MapOfActions::setCurrentValue(const char * name, std::vector<const element *>&_T)
+{
+  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
     std::ostringstream stream;
-    for (std::vector<element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
+    for (std::vector<const element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
       stream << (*iter)->Z << " ";
     }
Index: src/Actions/MapOfActions.hpp
===================================================================
--- src/Actions/MapOfActions.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Actions/MapOfActions.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -164,10 +164,10 @@
 
   void queryCurrentValue(const char * name, class atom * &_T);
-  void queryCurrentValue(const char * name, class element * &_T);
+  void queryCurrentValue(const char * name, const element * &_T);
   void queryCurrentValue(const char * name, class molecule * &_T);
   void queryCurrentValue(const char * name, class Box &_T);
   void queryCurrentValue(const char * name, class Vector &_T);
   void queryCurrentValue(const char * name, std::vector<atom *>&_T);
-  void queryCurrentValue(const char * name, std::vector<element *>&_T);
+  void queryCurrentValue(const char * name, std::vector<const element *>&_T);
   void queryCurrentValue(const char * name, std::vector<molecule *>&_T);
   template<typename T> void queryCurrentValue(const char * name, T &_T)
@@ -198,10 +198,10 @@
 
   void setCurrentValue(const char * name, class atom * &_T);
-  void setCurrentValue(const char * name, class element * &_T);
+  void setCurrentValue(const char * name, const element * &_T);
   void setCurrentValue(const char * name, class molecule * &_T);
   void setCurrentValue(const char * name, class Box &_T);
   void setCurrentValue(const char * name, class Vector &_T);
   void setCurrentValue(const char * name, std::vector<atom *>&_T);
-  void setCurrentValue(const char * name, std::vector<element *>&_T);
+  void setCurrentValue(const char * name, std::vector<const element *>&_T);
   void setCurrentValue(const char * name, std::vector<molecule *>&_T);
   template<class T> void setCurrentValue(const char * name, T &_T)
Index: src/Formula.cpp
===================================================================
--- src/Formula.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Formula.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -47,5 +47,5 @@
   for(const_iterator iter=end();iter!=begin();){
     --iter;
-    sstr << (*iter).first->symbol;
+    sstr << (*iter).first->getSymbol();
     if((*iter).second>1)
       sstr << (*iter).second;
@@ -146,5 +146,5 @@
 
 bool Formula::hasElement(const string &shorthand) const{
-  element * element = World::getInstance().getPeriode()->FindElement(shorthand);
+  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
   return hasElement(element);
 }
@@ -167,5 +167,5 @@
 
 void Formula::operator+=(const string &shorthand){
-  element * element = World::getInstance().getPeriode()->FindElement(shorthand);
+  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
   operator+=(element);
 }
@@ -198,5 +198,5 @@
 
 void Formula::operator-=(const string &shorthand){
-  element * element = World::getInstance().getPeriode()->FindElement(shorthand);
+  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
   operator-=(element);
 }
@@ -220,5 +220,5 @@
 
 void Formula::addElements(const string &shorthand,unsigned int count){
-  element * element = World::getInstance().getPeriode()->FindElement(shorthand);
+  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
   addElements(element,count);
 }
@@ -252,5 +252,5 @@
 
 const unsigned int Formula::operator[](string shorthand) const{
-  element * element = World::getInstance().getPeriode()->FindElement(shorthand);
+  const element * element = World::getInstance().getPeriode()->FindElement(shorthand);
   return operator[](element);
 }
@@ -380,5 +380,5 @@
 result_type
 Formula::_iterator<result_type>::operator*(){
-  element *element = World::getInstance().getPeriode()->FindElement(pos+1);
+  const element *element = World::getInstance().getPeriode()->FindElement(pos+1);
   ASSERT(element,"Element with position of iterator not found");
   return make_pair(element,(*set)[pos]);
@@ -390,5 +390,5 @@
   // no one can keep this value around, so a static is ok to avoid temporaries
   static value_type value=make_pair(reinterpret_cast<element*>(0),0); // no default constructor for std::pair
-  element *element = World::getInstance().getPeriode()->FindElement(pos+1);
+  const element *element = World::getInstance().getPeriode()->FindElement(pos+1);
   ASSERT(element,"Element with position of iterator not found");
   value = make_pair(element,(*set)[pos]);
Index: src/Parser/PcpParser.cpp
===================================================================
--- src/Parser/PcpParser.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Parser/PcpParser.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -540,5 +540,5 @@
     const element * const elemental = World::getInstance().getPeriode()->FindElement(iter->first);
     ZtoIndexMap.insert( pair<int,int> (iter->first, counter) );
-    *file << "Ion_Type" << counter++ << "\t" << iter->second << "\t" << elemental->Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << elemental->mass << "\t" << elemental->name << "\t" << elemental->symbol <<endl;
+    *file << "Ion_Type" << counter++ << "\t" << iter->second << "\t" << elemental->Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << elemental->mass << "\t" << elemental->getName() << "\t" << elemental->getSymbol() <<endl;
   }
 }
Index: src/Parser/XyzParser.cpp
===================================================================
--- src/Parser/XyzParser.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/Parser/XyzParser.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -86,5 +86,5 @@
   vector<atom*> atoms = World::getInstance().getAllAtoms();
   for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) {
-    *file << noshowpoint << (*it)->getType()->symbol << "\t" << (*it)->at(0) << "\t" << (*it)->at(1) << "\t" << (*it)->at(2) << endl;
+    *file << noshowpoint << (*it)->getType()->getSymbol() << "\t" << (*it)->at(0) << "\t" << (*it)->at(1) << "\t" << (*it)->at(2) << endl;
   }
 }
Index: src/UIElements/Dialog.hpp
===================================================================
--- src/UIElements/Dialog.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/UIElements/Dialog.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -255,5 +255,5 @@
     virtual void setResult();
   protected:
-    element * tmp;
+    const element * tmp;
   };
 
@@ -265,6 +265,6 @@
     virtual void setResult();
   protected:
-    element *temp;
-    std::vector<element *> tmp;
+    const element *temp;
+    std::vector<const element *> tmp;
   };
 
Index: src/UIElements/QT4/QTDialog.cpp
===================================================================
--- src/UIElements/QT4/QTDialog.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/UIElements/QT4/QTDialog.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -554,5 +554,5 @@
   {
     stringstream sstr;
-    sstr << (*iter).first << "\t" << (*iter).second->name;
+    sstr << (*iter).first << "\t" << (*iter).second->getName();
     inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
   }
@@ -589,5 +589,5 @@
   {
     stringstream sstr;
-    sstr << (*iter).first << "\t" << (*iter).second->name;
+    sstr << (*iter).first << "\t" << (*iter).second->getName();
     inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
   }
@@ -816,5 +816,5 @@
 }
 
-ElementQTQueryPipe::ElementQTQueryPipe(element **_content, QTDialog *_dialog, QComboBox *_theBox) :
+ElementQTQueryPipe::ElementQTQueryPipe(const element **_content, QTDialog *_dialog, QComboBox *_theBox) :
   content(_content),
   dialog(_dialog),
@@ -832,5 +832,5 @@
 }
 
-ElementsQTQueryPipe::ElementsQTQueryPipe(std::vector<element *>*_content, QTDialog *_dialog, QComboBox *_theBox) :
+ElementsQTQueryPipe::ElementsQTQueryPipe(std::vector<const element *>*_content, QTDialog *_dialog, QComboBox *_theBox) :
   content(_content),
   dialog(_dialog),
@@ -844,5 +844,5 @@
   QVariant data = theBox->itemData(newIndex);
   int idx = data.toInt();
-  element *elemental = World::getInstance().getPeriode()->FindElement(idx);
+  const element *elemental = World::getInstance().getPeriode()->FindElement(idx);
   if(elemental)
     (*content).push_back(elemental);
Index: src/UIElements/QT4/QTDialog.hpp
===================================================================
--- src/UIElements/QT4/QTDialog.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/UIElements/QT4/QTDialog.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -451,5 +451,5 @@
   Q_OBJECT
 public:
-  ElementQTQueryPipe(element **_content, QTDialog *_dialog, QComboBox *_theBox);
+  ElementQTQueryPipe(const element **_content, QTDialog *_dialog, QComboBox *_theBox);
   virtual ~ElementQTQueryPipe();
 
@@ -458,5 +458,5 @@
 
 private:
-  element **content;
+  const element **content;
   QTDialog *dialog;
   QComboBox *theBox;
@@ -466,5 +466,5 @@
   Q_OBJECT
 public:
-  ElementsQTQueryPipe(std::vector<element *>*_content, QTDialog *_dialog, QComboBox *_theBox);
+  ElementsQTQueryPipe(std::vector<const element *>*_content, QTDialog *_dialog, QComboBox *_theBox);
   virtual ~ElementsQTQueryPipe();
 
@@ -473,5 +473,5 @@
 
 private:
-  std::vector<element *>*content;
+  std::vector<const element *>*content;
   QTDialog *dialog;
   QComboBox *theBox;
Index: src/UIElements/TextUI/TextDialog.cpp
===================================================================
--- src/UIElements/TextUI/TextDialog.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/UIElements/TextUI/TextDialog.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -569,5 +569,5 @@
   bool badInput=false;
   bool aborted = false;
-  element * temp = NULL;
+  const element * temp = NULL;
   do{
     badInput = false;
Index: src/analysis_bonds.cpp
===================================================================
--- src/analysis_bonds.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/analysis_bonds.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -215,5 +215,5 @@
           if (((OtherAtom->getType() == first) || (OtherAtom->getType() == second)) && (theAtom->nr < OtherAtom->nr)) {
             count++;
-            DoLog(1) && (Log() << Verbose(1) << first->name << "-" << second->name << " bond found between " << *Walker << " and " << *OtherAtom << "." << endl);
+            DoLog(1) && (Log() << Verbose(1) << *first << "-" << *second << " bond found between " << *Walker << " and " << *OtherAtom << "." << endl);
           }
         }
@@ -262,5 +262,5 @@
         if (result) { // check results
           count++;
-          DoLog(1) && (Log() << Verbose(1) << first->name << "-" << second->name << "-" << third->name << " bond found at " << *Walker << "." << endl);
+          DoLog(1) && (Log() << Verbose(1) << *first << "-" << *second << "-" << *third << " bond found at " << *Walker << "." << endl);
         }
       }
Index: src/analysis_correlation.cpp
===================================================================
--- src/analysis_correlation.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/analysis_correlation.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -33,5 +33,5 @@
  * \return Map of doubles with values the pair of the two atoms.
  */
-PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements)
+PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements)
 {
   Info FunctionInfo(__func__);
@@ -48,16 +48,16 @@
 
   // create all possible pairs of elements
-  set <pair<element *, element *> > PairsOfElements;
+  set <pair<const element *,const element *> > PairsOfElements;
   if (elements.size() >= 2) {
-    for (vector<element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
-      for (vector<element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
+    for (vector<const element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
+      for (vector<const element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
         if (type1 != type2) {
-          PairsOfElements.insert( pair<element *, element*>(*type1,*type2) );
-          DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << (*type1)->symbol << " and " << (*type2)->symbol << "." << endl);
+          PairsOfElements.insert( make_pair(*type1,*type2) );
+          DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << *(*type1) << " and " << *(*type2) << "." << endl);
         }
   } else if (elements.size() == 1) { // one to all are valid
-    element *elemental = *elements.begin();
-    PairsOfElements.insert( pair<element *, element*>(elemental,(element *)NULL) );
-    PairsOfElements.insert( pair<element *, element*>((element *)NULL,elemental) );
+    const element *elemental = *elements.begin();
+    PairsOfElements.insert( pair<const element *,const element*>(elemental,0) );
+    PairsOfElements.insert( pair<const element *,const element*>(0,elemental) );
   } else { // all elements valid
     PairsOfElements.insert( pair<element *, element*>((element *)NULL, (element *)NULL) );
@@ -74,5 +74,5 @@
           DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
           if ((*iter)->getId() < (*runner)->getId()){
-            for (set <pair<element *, element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
+            for (set <pair<const element *, const element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
               if ((PairRunner->first == (**iter).getType()) && (PairRunner->second == (**runner).getType())) {
                 distance = domain.periodicDistance((*iter)->getPosition(),(*runner)->getPosition());
@@ -95,5 +95,5 @@
  * \return Map of doubles with values the pair of the two atoms.
  */
-PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const int ranges[NDIM] )
+PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const int ranges[NDIM] )
 {
   Info FunctionInfo(__func__);
@@ -115,16 +115,16 @@
 
   // create all possible pairs of elements
-  set <pair<element *, element *> > PairsOfElements;
+  set <pair<const element *,const element *> > PairsOfElements;
   if (elements.size() >= 2) {
-    for (vector<element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
-      for (vector<element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
+    for (vector<const element *>::const_iterator type1 = elements.begin(); type1 != elements.end(); ++type1)
+      for (vector<const element *>::const_iterator type2 = elements.begin(); type2 != elements.end(); ++type2)
         if (type1 != type2) {
-          PairsOfElements.insert( pair<element *, element*>(*type1,*type2) );
-          DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << (*type1)->symbol << " and " << (*type2)->symbol << "." << endl);
+          PairsOfElements.insert( make_pair(*type1,*type2) );
+          DoLog(1) && (Log() << Verbose(1) << "Creating element pair " << *(*type1) << " and " << *(*type2) << "." << endl);
         }
   } else if (elements.size() == 1) { // one to all are valid
-    element *elemental = *elements.begin();
-    PairsOfElements.insert( pair<element *, element*>(elemental,(element *)NULL) );
-    PairsOfElements.insert( pair<element *, element*>((element *)NULL,elemental) );
+    const element *elemental = *elements.begin();
+    PairsOfElements.insert( pair<const element *,const element*>(elemental,0) );
+    PairsOfElements.insert( pair<const element *,const element*>(0,elemental) );
   } else { // all elements valid
     PairsOfElements.insert( pair<element *, element*>((element *)NULL, (element *)NULL) );
@@ -149,5 +149,5 @@
                   DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl);
                   if ((*iter)->getId() < (*runner)->getId()){
-                    for (set <pair<element *, element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
+                    for (set <pair<const element *,const element *> >::iterator PairRunner = PairsOfElements.begin(); PairRunner != PairsOfElements.end(); ++PairRunner)
                       if ((PairRunner->first == (**iter).getType()) && (PairRunner->second == (**runner).getType())) {
                         periodicOtherX = FullInverseMatrix * ((*runner)->getPosition()); // x now in [0,1)^3
@@ -178,5 +178,5 @@
  * \return Map of dobules with values as pairs of atom and the vector
  */
-CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point )
+CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point )
 {
   Info FunctionInfo(__func__);
@@ -196,5 +196,5 @@
     for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
       DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
-      for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
+      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
         if ((*type == NULL) || ((*iter)->getType() == *type)) {
           distance = domain.periodicDistance((*iter)->getPosition(),*point);
@@ -215,5 +215,5 @@
  * \return Map of dobules with values as pairs of atom and the vector
  */
-CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point, const int ranges[NDIM] )
+CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point, const int ranges[NDIM] )
 {
   Info FunctionInfo(__func__);
@@ -237,5 +237,5 @@
     for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
       DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
-      for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
+      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
         if ((*type == NULL) || ((*iter)->getType() == *type)) {
           periodicX = FullInverseMatrix * ((*iter)->getPosition()); // x now in [0,1)^3
@@ -263,5 +263,5 @@
  * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
  */
-CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC )
+CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC )
 {
   Info FunctionInfo(__func__);
@@ -284,5 +284,5 @@
     for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
       DoLog(3) && (Log() << Verbose(3) << "\tCurrent atom is " << *(*iter) << "." << endl);
-      for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
+      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
         if ((*type == NULL) || ((*iter)->getType() == *type)) {
           TriangleIntersectionList Intersections((*iter)->getPosition(),Surface,LC);
@@ -309,5 +309,5 @@
  * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
  */
-CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
+CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
 {
   Info FunctionInfo(__func__);
@@ -335,5 +335,5 @@
     for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) {
       DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl);
-      for (vector<element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
+      for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
         if ((*type == NULL) || ((*iter)->getType() == *type)) {
           periodicX = FullInverseMatrix * ((*iter)->getPosition()); // x now in [0,1)^3
Index: src/analysis_correlation.hpp
===================================================================
--- src/analysis_correlation.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/analysis_correlation.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -46,10 +46,10 @@
 /********************************************** declarations *******************************/
 
-PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements);
-CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point );
-CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC );
-PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const int ranges[NDIM] );
-CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Vector *point, const int ranges[NDIM] );
-CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] );
+PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements);
+CorrelationToPointMap *CorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point );
+CorrelationToSurfaceMap *CorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC );
+PairCorrelationMap *PeriodicPairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const int ranges[NDIM] );
+CorrelationToPointMap *PeriodicCorrelationToPoint(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Vector *point, const int ranges[NDIM] );
+CorrelationToSurfaceMap *PeriodicCorrelationToSurface(std::vector<molecule *> &molecules, const std::vector<const element *> &elements, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] );
 int GetBin ( const double value, const double BinWidth, const double BinStart );
 void OutputCorrelation( ofstream * const file, const BinPairMap * const map );
Index: src/atom.cpp
===================================================================
--- src/atom.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/atom.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -194,5 +194,5 @@
 {
   if (out != NULL) {
-    *out << getType()->symbol << "\t" << at(0) << "\t" << at(1) << "\t" << at(2) << "\t" << endl;
+    *out << getType()->getSymbol() << "\t" << at(0) << "\t" << at(1) << "\t" << at(2) << "\t" << endl;
     return true;
   } else
@@ -232,5 +232,5 @@
 {
   if (out != NULL) {
-    *out << getType()->symbol << "\t";
+    *out << getType()->getSymbol() << "\t";
     *out << Trajectory.R.at(step)[0] << "\t";
     *out << Trajectory.R.at(step)[1] << "\t";
@@ -250,5 +250,5 @@
   Vector recentered(getPosition());
   recentered -= *center;
-  *out << "\t\t" << getType()->symbol << " [ " << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " ]" << endl;
+  *out << "\t\t" << getType()->getSymbol() << " [ " << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " ]" << endl;
   if (AtomNo != NULL)
     *AtomNo++;
Index: src/config.cpp
===================================================================
--- src/config.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/config.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -1339,5 +1339,5 @@
     AtomNo = 0;
     for (molecule::const_iterator iter = (*MolRunner)->begin(); iter != (*MolRunner)->end(); ++iter) {
-      sprintf(name, "%2s%2d",(*iter)->getType()->symbol, elementNo[(*iter)->getType()->Z]);
+      sprintf(name, "%2s%2d",(*iter)->getType()->getSymbol().c_str(), elementNo[(*iter)->getType()->Z]);
       elementNo[(*iter)->getType()->Z] = (elementNo[(*iter)->getType()->Z]+1) % 100;   // confine to two digits
       fprintf(f,
@@ -1354,5 +1354,5 @@
              (double)(*iter)->getType()->NoValenceOrbitals,          /* temperature factor */
              "0",            /* segment identifier */
-             (*iter)->getType()->symbol,    /* element symbol */
+             (*iter)->getType()->getSymbol().c_str(),    /* element symbol */
              "0");           /* charge */
       AtomNo++;
@@ -1392,5 +1392,5 @@
   AtomNo = 0;
   for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-    sprintf(name, "%2s%2d",(*iter)->getType()->symbol, elementNo[(*iter)->getType()->Z]);
+    sprintf(name, "%2s%2d",(*iter)->getType()->getSymbol().c_str(), elementNo[(*iter)->getType()->Z]);
     elementNo[(*iter)->getType()->Z] = (elementNo[(*iter)->getType()->Z]+1) % 100;   // confine to two digits
     fprintf(f,
@@ -1407,5 +1407,5 @@
            (double)(*iter)->getType()->NoValenceOrbitals,          /* temperature factor */
            "0",            /* segment identifier */
-           (*iter)->getType()->symbol,    /* element symbol */
+           (*iter)->getType()->getSymbol().c_str(),    /* element symbol */
            "0");           /* charge */
     AtomNo++;
@@ -1452,5 +1452,5 @@
     *output << (*iter)->at(0) << "\t" << (*iter)->at(1) << "\t" << (*iter)->at(2) << "\t";
     *output << static_cast<double>((*iter)->getType()->Valence) << "\t";
-    *output << (*iter)->getType()->symbol << "\t";
+    *output << (*iter)->getType()->getSymbol() << "\t";
     for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++)
       *output << (*runner)->GetOtherAtom(*iter)->nr << "\t";
@@ -1524,5 +1524,5 @@
         *output << (*iter)->at(0) << "\t" << (*iter)->at(1) << "\t" << (*iter)->at(2) << "\t";
         *output << (double)(*iter)->getType()->Valence << "\t";
-        *output << (*iter)->getType()->symbol << "\t";
+        *output << (*iter)->getType()->getSymbol() << "\t";
         for (BondList::iterator runner = (*iter)->ListOfBonds.begin(); runner != (*iter)->ListOfBonds.end(); runner++)
           *output << LocalNotoGlobalNoMap[ (*runner)->GetOtherAtom((*iter))->getId() ] << "\t";
Index: src/element.cpp
===================================================================
--- src/element.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/element.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -23,7 +23,4 @@
   VanDerWaalsRadius(0),
 	Z(-1),
-	previous(NULL),
-	next(NULL),
-	sort(NULL),
 	Valence(0),
 	NoValenceOrbitals(0)
@@ -31,7 +28,39 @@
 };
 
+element::element(const element &src) :
+  mass(src.mass),
+  CovalentRadius(src.CovalentRadius),
+  VanDerWaalsRadius(src.VanDerWaalsRadius),
+  Z(src.Z),
+  Valence(src.Valence),
+  NoValenceOrbitals(src.NoValenceOrbitals),
+  name(src.name),
+  symbol(src.symbol)
+{
+  strncpy(period,src.period,strfield_length+1);
+  strncpy(group,src.group,strfield_length+1);
+  strncpy(block,src.block,strfield_length+1);
+}
+
 /** Destructor of class element.
  */
 element::~element() {};
+
+element &element::operator=(const element &src){
+  if(this!=&src){
+    mass=src.mass;
+    CovalentRadius=src.CovalentRadius;
+    VanDerWaalsRadius=src.VanDerWaalsRadius;
+    Z=src.Z;
+    Valence=src.Valence;
+    NoValenceOrbitals=src.NoValenceOrbitals;
+    name=src.name;
+    symbol=src.symbol;
+    strncpy(period,src.period,strfield_length+1);
+    strncpy(group,src.group,strfield_length+1);
+    strncpy(block,src.block,strfield_length+1);
+  }
+  return *this;
+}
 
 /** Prints element data to \a *out.
@@ -66,10 +95,18 @@
 }
 
-string element::getSymbol() const{
-  return string(symbol);
+string &element::getSymbol(){
+  return symbol;
 }
 
-std::string element::getName() const{
-  return string(name);
+const string &element::getSymbol() const{
+  return symbol;
+}
+
+std::string &element::getName(){
+  return name;
+}
+
+const std::string &element::getName() const{
+  return name;
 }
 
Index: src/element.hpp
===================================================================
--- src/element.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/element.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -28,4 +28,5 @@
  */
 class element {
+  enum {strfield_length=7};
   public:
     double mass;    //!< mass in g/mol
@@ -33,12 +34,7 @@
     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
+    char period[strfield_length+1];    //!< period: n quantum number
+    char group[strfield_length+1];    //!< group: l quantum number
+    char block[strfield_length+1];    //!< block: l quantum number
     double Valence;   //!< number of valence electrons for this element
     int NoValenceOrbitals;  //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix()
@@ -46,17 +42,24 @@
     double HBondAngle[NDIM];     //!< typical angle for one, two, three bonded hydrogen (in degrees)
 
-  element();
-  ~element();
+    element();
+    element(const element&);
+    ~element();
 
-  // accessor functions
-  atomicNumber_t getNumber() const;
-  std::string getSymbol() const;
-  std::string getName() const;
+    element &operator=(const element&);
 
-  //> print element entries to screen
-  bool Output(std::ostream * const out) const;
-  bool Checkout(std::ostream * const out, const int No, const int NoOfAtoms) const;
+    // accessor functions
+    atomicNumber_t getNumber() const;
+    std::string &getSymbol();
+    const std::string &getSymbol() const;
+    std::string &getName();
+    const std::string &getName() const;
+
+    //> print element entries to screen
+    bool Output(std::ostream * const out) const;
+    bool Checkout(std::ostream * const out, const int No, const int NoOfAtoms) const;
 
   private:
+    std::string name;  //!< atom name, i.e. "Hydrogren"
+    std::string symbol; //!< short form of the atom, i.e. "H"
 };
 
Index: src/molecule.cpp
===================================================================
--- src/molecule.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/molecule.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -218,5 +218,5 @@
       if(pointer->getName() == "Unknown"){
         stringstream sstr;
-        sstr << pointer->getType()->symbol << pointer->nr+1;
+        sstr << pointer->getType()->getSymbol() << pointer->nr+1;
         pointer->setName(sstr.str());
       }
@@ -972,5 +972,5 @@
       NoNonHydrogen++;
     stringstream sstr;
-    sstr << (*iter)->getType()->symbol << (*iter)->nr+1;
+    sstr << (*iter)->getType()->getSymbol() << (*iter)->nr+1;
     (*iter)->setName(sstr.str());
     DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << (*iter)->nr << " " << (*iter)->getName() << "." << endl);
@@ -978,110 +978,4 @@
   }
   return res;
-};
-
-/** Determines whether two molecules actually contain the same atoms and coordination.
- * \param *out output stream for debugging
- * \param *OtherMolecule the molecule to compare this one to
- * \param threshold upper limit of difference when comparing the coordination.
- * \return NULL - not equal, otherwise an allocated (molecule::AtomCount) permutation map of the atom numbers (which corresponds to which)
- */
-int * molecule::IsEqualToWithinThreshold(molecule *OtherMolecule, double threshold)
-{
-  int flag;
-  double *Distances = NULL, *OtherDistances = NULL;
-  Vector CenterOfGravity, OtherCenterOfGravity;
-  size_t *PermMap = NULL, *OtherPermMap = NULL;
-  int *PermutationMap = NULL;
-  bool result = true; // status of comparison
-
-  DoLog(3) && (Log() << Verbose(3) << "Begin of IsEqualToWithinThreshold." << endl);
-  /// first count both their atoms and elements and update lists thereby ...
-  //Log() << Verbose(0) << "Counting atoms, updating list" << endl;
-
-  /// ... and compare:
-  /// -# AtomCount
-  if (result) {
-    if (getAtomCount() != OtherMolecule->getAtomCount()) {
-      DoLog(4) && (Log() << Verbose(4) << "AtomCounts don't match: " << getAtomCount() << " == " << OtherMolecule->getAtomCount() << endl);
-      result = false;
-    } else Log() << Verbose(4) << "AtomCounts match: " << getAtomCount() << " == " << OtherMolecule->getAtomCount() << endl;
-  }
-  /// -# Formula
-  if (result) {
-    if (formula != OtherMolecule->formula) {
-      DoLog(4) && (Log() << Verbose(4) << "Formulas don't match: " << formula << " == " << OtherMolecule->formula << endl);
-      result = false;
-    } else Log() << Verbose(4) << "Formulas match: " << formula << " == " << OtherMolecule->formula << endl;
-  }
-  /// then determine and compare center of gravity for each molecule ...
-  if (result) {
-    DoLog(5) && (Log() << Verbose(5) << "Calculating Centers of Gravity" << endl);
-    DeterminePeriodicCenter(CenterOfGravity);
-    OtherMolecule->DeterminePeriodicCenter(OtherCenterOfGravity);
-    DoLog(5) && (Log() << Verbose(5) << "Center of Gravity: " << CenterOfGravity << endl);
-    DoLog(5) && (Log() << Verbose(5) << "Other Center of Gravity: " << OtherCenterOfGravity << endl);
-    if (CenterOfGravity.DistanceSquared(OtherCenterOfGravity) > threshold*threshold) {
-      DoLog(4) && (Log() << Verbose(4) << "Centers of gravity don't match." << endl);
-      result = false;
-    }
-  }
-
-  /// ... then make a list with the euclidian distance to this center for each atom of both molecules
-  if (result) {
-    DoLog(5) && (Log() << Verbose(5) << "Calculating distances" << endl);
-    Distances = new double[getAtomCount()];
-    OtherDistances = new double[getAtomCount()];
-    SetIndexedArrayForEachAtomTo ( Distances, &atom::nr, &atom::DistanceSquaredToVector, (const Vector &)CenterOfGravity);
-    SetIndexedArrayForEachAtomTo ( OtherDistances, &atom::nr, &atom::DistanceSquaredToVector, (const Vector &)CenterOfGravity);
-    for(int i=0;i<getAtomCount();i++) {
-      Distances[i] = 0.;
-      OtherDistances[i] = 0.;
-    }
-
-    /// ... sort each list (using heapsort (o(N log N)) from GSL)
-    DoLog(5) && (Log() << Verbose(5) << "Sorting distances" << endl);
-    PermMap = new size_t[getAtomCount()];
-    OtherPermMap = new size_t[getAtomCount()];
-    for(int i=0;i<getAtomCount();i++) {
-      PermMap[i] = 0;
-      OtherPermMap[i] = 0;
-    }
-    gsl_heapsort_index (PermMap, Distances, getAtomCount(), sizeof(double), CompareDoubles);
-    gsl_heapsort_index (OtherPermMap, OtherDistances, getAtomCount(), sizeof(double), CompareDoubles);
-    PermutationMap = new int[getAtomCount()];
-    for(int i=0;i<getAtomCount();i++)
-      PermutationMap[i] = 0;
-    DoLog(5) && (Log() << Verbose(5) << "Combining Permutation Maps" << endl);
-    for(int i=getAtomCount();i--;)
-      PermutationMap[PermMap[i]] = (int) OtherPermMap[i];
-
-    /// ... and compare them step by step, whether the difference is individually(!) below \a threshold for all
-    DoLog(4) && (Log() << Verbose(4) << "Comparing distances" << endl);
-    flag = 0;
-    for (int i=0;i<getAtomCount();i++) {
-      DoLog(5) && (Log() << Verbose(5) << "Distances squared: |" << Distances[PermMap[i]] << " - " << OtherDistances[OtherPermMap[i]] << "| = " << fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) << " ?<? " <<  threshold << endl);
-      if (fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) > threshold*threshold)
-        flag = 1;
-    }
-
-    // free memory
-    delete[](PermMap);
-    delete[](OtherPermMap);
-    delete[](Distances);
-    delete[](OtherDistances);
-    if (flag) { // if not equal
-      delete[](PermutationMap);
-      result = false;
-    }
-  }
-  /// return pointer to map if all distances were below \a threshold
-  DoLog(3) && (Log() << Verbose(3) << "End of IsEqualToWithinThreshold." << endl);
-  if (result) {
-    DoLog(3) && (Log() << Verbose(3) << "Result: Equal." << endl);
-    return PermutationMap;
-  } else {
-    DoLog(3) && (Log() << Verbose(3) << "Result: Not equal." << endl);
-    return NULL;
-  }
 };
 
Index: src/molecule.hpp
===================================================================
--- src/molecule.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/molecule.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -324,5 +324,4 @@
 
   // Recognize doubly appearing molecules in a list of them
-  int * IsEqualToWithinThreshold(molecule *OtherMolecule, double threshold);
   int * GetFatherSonAtomicMap(molecule *OtherMolecule);
 
Index: src/periodentafel.cpp
===================================================================
--- src/periodentafel.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/periodentafel.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -34,5 +34,5 @@
   {
     stringstream input(elementsDB,ios_base::in);
-    bool status = LoadElementsDatabase(&input);
+    bool status = LoadElementsDatabase(input);
     ASSERT(status,  "General element initialization failed");
   }
@@ -72,9 +72,8 @@
  * \return iterator to added element
  */
-periodentafel::iterator periodentafel::AddElement(element * const pointer)
+periodentafel::iterator periodentafel::AddElement(element * pointer)
 {
   atomicNumber_t Z = pointer->getNumber();
   ASSERT(!elements.count(Z), "Element is already present.");
-  pointer->sort = &pointer->Z;
   if (pointer->getNumber() < 1 && pointer->getNumber() >= MAX_ELEMENTS)
     DoeLog(0) && (eLog() << Verbose(0) << "Invalid Z number!\n");
@@ -86,5 +85,5 @@
  * \param *pointer element to be removed
  */
-size_t periodentafel::RemoveElement(element * const pointer)
+size_t periodentafel::RemoveElement(const element * pointer)
 {
   return RemoveElement(pointer->getNumber());
@@ -114,5 +113,5 @@
  * \return pointer to element or NULL if not found
  */
-element * const periodentafel::FindElement(atomicNumber_t Z) const
+const element * periodentafel::FindElement(atomicNumber_t Z) const
 {
   const_iterator res = elements.find(Z);
@@ -125,5 +124,5 @@
  * \return pointer to element
  */
-element * const periodentafel::FindElement(const string &shorthand) const
+const element * periodentafel::FindElement(const string &shorthand) const
 {
   element *res = 0;
@@ -140,7 +139,7 @@
  * \return desired element or NULL
  */
-element * const periodentafel::AskElement() const
-{
-  element * walker = NULL;
+const element * periodentafel::AskElement() const
+{
+  const element * walker = NULL;
   int Z;
   do {
@@ -155,10 +154,10 @@
  * \return pointer to either present or newly created element
  */
-element * const periodentafel::EnterElement()
+const element * periodentafel::EnterElement()
 {
   atomicNumber_t Z = 0;
   DoLog(0) && (Log() << Verbose(0) << "Atomic number: " << Z << endl);
   cin >> Z;
-  element * const res = FindElement(Z);
+  const element *res = FindElement(Z);
   if (!res) {
     // TODO: make this using the constructor
@@ -169,7 +168,7 @@
     cin >> tmp->mass;
     DoLog(0) && (Log() << Verbose(0) << "Name [max 64 chars]: " << endl);
-    cin >> tmp->name;
+    cin >> tmp->getName();
     DoLog(0) && (Log() << Verbose(0) << "Short form [max 3 chars]: " << endl);
-    cin >> tmp->symbol;
+    cin >> tmp->getSymbol();
     AddElement(tmp);
     return tmp;
@@ -180,17 +179,17 @@
 
 /******************** Access to iterators ****************************/
-periodentafel::const_iterator periodentafel::begin(){
+periodentafel::const_iterator periodentafel::begin() const{
   return elements.begin();
 }
 
-periodentafel::const_iterator periodentafel::end(){
+periodentafel::const_iterator periodentafel::end() const{
   return elements.end();
 }
 
-periodentafel::reverse_iterator periodentafel::rbegin(){
+periodentafel::reverse_iterator periodentafel::rbegin() const{
   return reverse_iterator(elements.end());
 }
 
-periodentafel::reverse_iterator periodentafel::rend(){
+periodentafel::reverse_iterator periodentafel::rend() const{
   return reverse_iterator(elements.begin());
 }
@@ -228,5 +227,5 @@
   if (!input.fail())
     DoLog(0) && (Log() << Verbose(0) << "Using " << filename << " as elements database." << endl);
-  status = status && LoadElementsDatabase(&input);
+  status = status && LoadElementsDatabase(input);
   input.close();
   input.clear();
@@ -287,49 +286,41 @@
  * \return true - parsing successful, false - something went wrong
  */
-bool periodentafel::LoadElementsDatabase(istream *input)
+bool periodentafel::LoadElementsDatabase(istream &input)
 {
   bool status = true;
-  int counter = 0;
-  pair< std::map<atomicNumber_t,element*>::iterator, bool > InserterTest;
-  if (!(*input).fail()) {
-    (*input).getline(header1, MAXSTRINGSIZE);
-    (*input).getline(header2, MAXSTRINGSIZE); // skip first two header lines
+  string header1tmp,header2tmp;
+  // first parse into a map, so we can revert to old status in case something goes wront
+  map<atomicNumber_t,element*> parsedElements;
+  if (!input.fail()) {
+    getline(input,header1tmp);
+    getline(input,header2tmp); // skip first two header lines
+    cout << "First header: " << header1tmp << endl;
+    cout << "Second header: " << header2tmp << endl;
     DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
-    while (!(*input).eof()) {
+    while (!input.eof()) {
       element *neues = new element;
-      (*input) >> neues->name;
-      //(*input) >> ws;
-      (*input) >> neues->symbol;
-      //(*input) >> ws;
-      (*input) >> neues->period;
-      //(*input) >> ws;
-      (*input) >> neues->group;
-      //(*input) >> ws;
-      (*input) >> neues->block;
-      //(*input) >> ws;
-      (*input) >> neues->Z;
-      //(*input) >> ws;
-      (*input) >> neues->mass;
-      //(*input) >> ws;
-      (*input) >> neues->CovalentRadius;
-      //(*input) >> ws;
-      (*input) >> neues->VanDerWaalsRadius;
-      //(*input) >> ws;
-      (*input) >> ws;
+      input >> neues->getName();;
+      //(*input) >> ws;
+      input >> neues->getSymbol();
+      //(*input) >> ws;
+      input >> neues->period;
+      //(*input) >> ws;
+      input >> neues->group;
+      //(*input) >> ws;
+      input >> neues->block;
+      //(*input) >> ws;
+      input >> neues->Z;
+      //(*input) >> ws;
+      input >> neues->mass;
+      //(*input) >> ws;
+      input >> neues->CovalentRadius;
+      //(*input) >> ws;
+      input >> neues->VanDerWaalsRadius;
+      //(*input) >> ws;
+      input >> ws;
       //neues->Output((ofstream *)&cout);
       if ((neues->getNumber() > 0) && (neues->getNumber() < MAX_ELEMENTS)) {
-        if (elements.count(neues->getNumber())) {// if element already present, remove and delete old one (i.e. replace it)
-          //cout << neues->symbol << " is present already." << endl;
-          element * const Elemental = FindElement(neues->getNumber());
-          ASSERT(Elemental != NULL, "element should be present but is not??");
-          *Elemental = *neues;
-          delete(neues);
-          neues = Elemental;
-        } else {
-          InserterTest = elements.insert(pair <atomicNumber_t,element*> (neues->getNumber(), neues));
-          ASSERT(InserterTest.second, "Could not insert new element into periodentafel on LoadElementsDatabase().");
-        }
-        DoLog(0) && (Log() << Verbose(0) << " " << elements[neues->getNumber()]->symbol);
-        counter++;
+        parsedElements[neues->Z] = neues;
+        DoLog(0) && (Log() << Verbose(0) << " " << *neues);
       } else {
         DoeLog(2) && (eLog() << Verbose(2) << "Detected empty line or invalid element in elements db, discarding." << endl);
@@ -337,4 +328,10 @@
         delete(neues);
       }
+      // when the input is in failed state, we most likely just read garbage
+      if(input.fail()) {
+        DoeLog(2) && (eLog() << Verbose(2) << "Error parsing elements db." << endl);
+        status = false;
+        break;
+      }
     }
     DoLog(0) && (Log() << Verbose(0) << endl);
@@ -344,6 +341,27 @@
   }
 
-  if (counter == 0)
+  if (!parsedElements.size())
     status = false;
+
+  if(status){
+    for(map<atomicNumber_t,element*>::iterator iter=parsedElements.begin();
+                                               iter!=parsedElements.end();
+                                               ++iter){
+      if (elements.count(iter->first)) {
+        // if element already present, replace the old one
+        // pointer to old element might still be in use, so we have to replace into the old element
+        *(elements[iter->first])=*iter->second;
+      }
+      else {
+        // no such element in periodentafel... we can just insert
+        elements[iter->first] = iter->second;
+      }
+    }
+    // all went well.. we now copy the header
+    strncpy(header1,header1tmp.c_str(),MAXSTRINGSIZE);
+    header1[MAXSTRINGSIZE-1]=0;
+    strncpy(header2,header2tmp.c_str(),MAXSTRINGSIZE);
+    header2[MAXSTRINGSIZE-1]=0;
+  }
 
   return status;
Index: src/periodentafel.hpp
===================================================================
--- src/periodentafel.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/periodentafel.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -43,17 +43,17 @@
   ~periodentafel();
 
-  iterator AddElement(element * const pointer);
-  size_t RemoveElement(element * const pointer);
+  iterator AddElement(element * pointer);
+  size_t RemoveElement(const element * pointer);
   size_t RemoveElement(atomicNumber_t);
   void CleanupPeriodtable();
-  element * const FindElement(atomicNumber_t) const;
-  element * const FindElement(const std::string &shorthand) const;
-  element * const AskElement() const;
-  element * const EnterElement();
+  const element * FindElement(atomicNumber_t) const;
+  const element * FindElement(const std::string &shorthand) const;
+  const element * AskElement() const;
+  const element * EnterElement();
 
-  const_iterator begin();
-  const_iterator end();
-  reverse_iterator rbegin();
-  reverse_iterator rend();
+  const_iterator begin() const;
+  const_iterator end() const;
+  reverse_iterator rbegin() const;
+  reverse_iterator rend() const;
   bool Output(std::ostream * const output) const;
   bool LoadPeriodentafel(const char * const path);
@@ -62,5 +62,5 @@
   private:
 
-  bool LoadElementsDatabase(std::istream *input);
+  bool LoadElementsDatabase(std::istream &input);
   bool LoadValenceDatabase(std::istream *input);
   bool LoadOrbitalsDatabase(std::istream *input);
Index: src/unittests/AnalysisCorrelationToPointUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -46,5 +46,5 @@
 
   // construct element list
-  std::vector<element *> elements;
+  std::vector<const element *> elements;
   hydrogen = World::getInstance().getPeriode()->FindElement(1);
   CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
Index: src/unittests/AnalysisCorrelationToPointUnitTest.hpp
===================================================================
--- src/unittests/AnalysisCorrelationToPointUnitTest.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/unittests/AnalysisCorrelationToPointUnitTest.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -37,5 +37,5 @@
       std::vector<molecule *> allMolecules;
       molecule *TestMolecule;
-      element *hydrogen;
+      const element *hydrogen;
 
       CorrelationToPointMap *pointmap;
Index: src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp
===================================================================
--- src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -45,7 +45,7 @@
       std::vector<molecule *> allMolecules;
       molecule *TestSurfaceMolecule;
-      element *hydrogen;
-      element *carbon;
-      std::vector<element *> elements;
+      const element *hydrogen;
+      const element *carbon;
+      std::vector<const element *> elements;
 
       CorrelationToSurfaceMap *surfacemap;
Index: src/unittests/AnalysisPairCorrelationUnitTest.cpp
===================================================================
--- src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -49,5 +49,5 @@
 
   // construct element list
-  std::vector<element *> elements;
+  std::vector<const element *> elements;
   hydrogen = World::getInstance().getPeriode()->FindElement(1);
   CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
Index: src/unittests/AnalysisPairCorrelationUnitTest.hpp
===================================================================
--- src/unittests/AnalysisPairCorrelationUnitTest.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/unittests/AnalysisPairCorrelationUnitTest.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -37,5 +37,5 @@
       std::vector<molecule *> allMolecules;
       molecule *TestMolecule;
-      element *hydrogen;
+      const element *hydrogen;
 
       PairCorrelationMap *correlationmap;
Index: src/unittests/periodentafelTest.cpp
===================================================================
--- src/unittests/periodentafelTest.cpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/unittests/periodentafelTest.cpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -11,4 +11,7 @@
 #include <cppunit/extensions/TestFactoryRegistry.h>
 #include <cppunit/ui/text/TestRunner.h>
+
+#include <sstream>
+#include <iostream>
 
 #include "Helpers/Assert.hpp"
@@ -67,5 +70,6 @@
 {
   // reload all databases
-  CPPUNIT_ASSERT(tafel->LoadElementsDatabase(new stringstream(elementsDB,ios_base::in)) && "General element initialization failed");
+  stringstream elementsDBstream(elementsDB,ios_base::in);
+  CPPUNIT_ASSERT(tafel->LoadElementsDatabase(elementsDBstream) && "General element initialization failed");
   CPPUNIT_ASSERT(tafel->LoadValenceDatabase(new stringstream(valenceDB,ios_base::in)) && "Valence entry of element initialization failed");
   CPPUNIT_ASSERT(tafel->LoadOrbitalsDatabase(new stringstream(orbitalsDB,ios_base::in)) && "Orbitals entry of element initialization failed");
Index: src/unittests/periodentafelTest.hpp
===================================================================
--- src/unittests/periodentafelTest.hpp	(revision 97b8250638c1abf3f888625d1d3888a08cb06cb2)
+++ src/unittests/periodentafelTest.hpp	(revision b5c53d0007611f38495bf2e4a8c7348258cf1e7e)
@@ -31,6 +31,6 @@
 private:
 
-      element *hydrogen;
-      element *carbon;
+      const element *hydrogen;
+      const element *carbon;
       periodentafel *tafel;
 
