Index: molecuilder/Makefile.am
===================================================================
--- molecuilder/Makefile.am	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/Makefile.am	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -1,4 +1,4 @@
 ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src src/unittests doc tests 
+SUBDIRS = src src/Actions src/unittests doc tests 
 
 EXTRA_DIST = autogen.sh
Index: molecuilder/configure.ac
===================================================================
--- molecuilder/configure.ac	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/configure.ac	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -94,8 +94,19 @@
 # test suite
 AC_CONFIG_TESTDIR(tests)
-AC_CONFIG_FILES([tests/atlocal tests/Makefile])
-AC_CONFIG_FILES([tests/Tesselations/Makefile tests/Tesselations/defs])
+AC_CONFIG_FILES([
+	tests/atlocal 
+	tests/Makefile])
+AC_CONFIG_FILES([
+	tests/Tesselations/Makefile 
+	tests/Tesselations/defs])
 AC_CONFIG_FILES([tests/molecuilder], [chmod +x tests/molecuilder])
-AC_CONFIG_FILES([doc/molecuilder.xml])
-AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile src/unittests/Makefile])
+AC_CONFIG_FILES([
+	doc/molecuilder.xml])
+AC_CONFIG_FILES([
+	Makefile 
+	doc/Makefile 
+	src/Makefile 
+	src/Actions/Makefile
+	src/UIElements/Makefile
+	src/unittests/Makefile])
 AC_OUTPUT
Index: molecuilder/src/Actions/Makefile.am
===================================================================
--- molecuilder/src/Actions/Makefile.am	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/Actions/Makefile.am	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,141 @@
+# PLEASE adhere to the alphabetical ordering in this Makefile!
+# Also indentation by a single tab
+
+INCLUDES = -I$(top_srcdir)/src
+
+AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl
+AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
+
+noinst_LIBRARIES = libMolecuilderActions.a
+libMolecuilderActions_a_SOURCES = ${ACTIONSSOURCE} ${ACTIONSHEADER}
+
+ACTIONSSOURCE = \
+  ${ANALYSISACTIONSOURCE} \
+  ${ATOMACTIONSOURCE} \
+  ${CMDACTIONSOURCE} \
+  ${FRAGMENTATIONACTIONSOURCE} \
+  ${MOLECULEACTIONSOURCE} \
+  ${PARSERACTIONSOURCE} \
+  ${TESSELATIONACTIONSOURCE} \
+  ${WORLDACTIONSOURCE} \
+  MapOfActions.cpp
+
+ACTIONSHEADER = \
+  ${ANALYSISACTIONHEADER} \
+  ${ATOMACTIONHEADER} \
+  ${CMDACTIONHEADER} \
+  ${FRAGMENTATIONACTIONHEADER} \
+  ${MOLECULEACTIONHEADER} \
+  ${PARSERACTIONHEADER} \
+  ${TESSELATIONACTIONHEADER} \
+  ${WORLDACTIONHEADER} \
+  MapOfActions.hpp
+  
+ANALYSISACTIONSOURCE = \
+  AnalysisAction/MolecularVolumeAction.cpp \
+  AnalysisAction/PairCorrelationAction.cpp \
+  AnalysisAction/PairCorrelationToPointAction.cpp \
+  AnalysisAction/PairCorrelationToSurfaceAction.cpp \
+  AnalysisAction/PrincipalAxisSystemAction.cpp
+ANALYSISACTIONHEADER = \
+  AnalysisAction/MolecularVolumeAction.hpp \
+  AnalysisAction/PairCorrelationAction.hpp \
+  AnalysisAction/PairCorrelationToPointAction.hpp \
+  AnalysisAction/PairCorrelationToSurfaceAction.hpp \
+  AnalysisAction/PrincipalAxisSystemAction.hpp
+
+ATOMACTIONSOURCE = \
+  AtomAction/AddAction.cpp \
+  AtomAction/ChangeElementAction.cpp \
+  AtomAction/RemoveAction.cpp
+ATOMACTIONHEADER = \
+  AtomAction/AddAction.hpp \
+  AtomAction/ChangeElementAction.hpp \
+  AtomAction/RemoveAction.cpp
+
+CMDACTIONSOURCE = \
+  CmdAction/BondLengthTableAction.cpp \
+  CmdAction/ElementDbAction.cpp \
+  CmdAction/FastParsingAction.cpp \
+  CmdAction/HelpAction.cpp \
+  CmdAction/VerboseAction.cpp \
+  CmdAction/VersionAction.cpp
+CMDACTIONHEADER = \
+  CmdAction/BondLengthTableAction.hpp \
+  CmdAction/ElementDbAction.hpp \
+  CmdAction/FastParsingAction.hpp \
+  CmdAction/HelpAction.hpp \
+  CmdAction/VerboseAction.hpp \
+  CmdAction/VersionAction.hpp
+
+FRAGMENTATIONACTIONSOURCE = \
+  FragmentationAction/DepthFirstSearchAction.cpp \
+  FragmentationAction/FragmentationAction.cpp \
+  FragmentationAction/SubgraphDissectionAction.cpp               
+FRAGMENTATIONACTIONHEADER = \
+  FragmentationAction/DepthFirstSearchAction.hpp \
+  FragmentationAction/FragmentationAction.hpp \
+  FragmentationAction/SubgraphDissectionAction.hpp
+
+MOLECULEACTIONSOURCE = \
+  MoleculeAction/BondFileAction.cpp \
+  MoleculeAction/ChangeNameAction.cpp \
+  MoleculeAction/FillWithMoleculeAction.cpp \
+  MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \
+  MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \
+  MoleculeAction/SaveAdjacencyAction.cpp \
+  MoleculeAction/SaveBondsAction.cpp \
+  MoleculeAction/SaveTemperatureAction.cpp \
+  MoleculeAction/SuspendInWaterAction.cpp \
+  MoleculeAction/TranslateAction.cpp \
+  MoleculeAction/VerletIntegrationAction.cpp
+MOLECULEACTIONHEADER = \
+  MoleculeAction/BondFileAction.hpp \
+  MoleculeAction/ChangeNameAction.hpp \
+  MoleculeAction/FillWithMoleculeAction.hpp \
+  MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \
+  MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \
+  MoleculeAction/SaveAdjacencyAction.hpp \
+  MoleculeAction/SaveBondsAction.hpp \
+  MoleculeAction/SaveTemperatureAction.hpp \
+  MoleculeAction/SuspendInWaterAction.hpp \
+  MoleculeAction/TranslateAction.hpp \
+  MoleculeAction/VerletIntegrationAction.hpp
+                 
+PARSERACTIONSOURCE = \
+  ParserAction/LoadXyzAction.cpp \
+  ParserAction/SaveXyzAction.cpp       
+PARSERACTIONHEADER = \
+  ParserAction/LoadXyzAction.hpp \
+  ParserAction/SaveXyzAction.hpp
+
+TESSELATIONACTIONSOURCE = \
+  TesselationAction/ConvexEnvelopeAction.cpp \
+  TesselationAction/NonConvexEnvelopeAction.cpp               
+TESSELATIONACTIONHEADER = \
+  TesselationAction/ConvexEnvelopeAction.hpp \
+  TesselationAction/NonConvexEnvelopeAction.hpp
+
+WORLDACTIONSOURCE = \
+  WorldAction/AddEmptyBoundaryAction.cpp \
+  WorldAction/BoundInBoxAction.cpp \
+  WorldAction/CenterInBoxAction.cpp \
+  WorldAction/CenterOnEdgeAction.cpp \
+  WorldAction/ChangeBoxAction.cpp \
+  WorldAction/RemoveSphereOfAtomsAction.cpp \
+  WorldAction/RepeatBoxAction.cpp \
+  WorldAction/ScaleBoxAction.cpp \
+  WorldAction/SetDefaultNameAction.cpp \
+  WorldAction/SetGaussianBasisAction.cpp               
+WORLDACTIONHEADER = \
+  WorldAction/AddEmptyBoundaryAction.hpp \
+  WorldAction/BoundInBoxAction.hpp \
+  WorldAction/CenterInBoxAction.hpp \
+  WorldAction/CenterOnEdgeAction.hpp \
+  WorldAction/ChangeBoxAction.hpp \
+  WorldAction/RemoveSphereOfAtomsAction.hpp \
+  WorldAction/RepeatBoxAction.hpp \
+  WorldAction/ScaleBoxAction.hpp \
+  WorldAction/SetDefaultNameAction.hpp \
+  WorldAction/SetGaussianBasisAction.hpp
+
Index: molecuilder/src/Actions/MapOfActions.cpp
===================================================================
--- molecuilder/src/Actions/MapOfActions.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/Actions/MapOfActions.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -45,5 +45,5 @@
   DescriptionMap["fill-molecule"] = "fill empty space of box with a filler molecule";
   DescriptionMap["fragment-mol"] = "create for a given molecule into fragments up to given order";
-  DescriptionMap["help"] = "produce help message";
+  DescriptionMap["help"] = "Give this help screen";
   DescriptionMap["linear-interpolate"] = "linear interpolation in discrete steps between start and end position of a molecule";
   DescriptionMap["nonconvex-envelope"] = "create the non-convex envelope for a molecule";
@@ -123,7 +123,7 @@
   ShortFormMap["suspend-in-water"] = "U";
   ShortFormMap["translate-mol"] = "t";
-  ShortFormMap["verbose"] = "V";
+  ShortFormMap["verbose"] = "v";
   ShortFormMap["verlet-integrate"] = "P";
-  ShortFormMap["version"] = "v";
+  ShortFormMap["version"] = "V";
 
   // value types for the actions
Index: molecuilder/src/Helpers/MemDebug.cpp
===================================================================
--- molecuilder/src/Helpers/MemDebug.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/Helpers/MemDebug.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -153,4 +153,5 @@
   // build the entry in front of the space
   Memory::entry_t *entry = (Memory::entry_t*) res;
+  memset(res,0,entrySpace);
   entry->info.nbytes = nbytes;
   entry->info.isUsed = true;
Index: molecuilder/src/Makefile.am
===================================================================
--- molecuilder/src/Makefile.am	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/Makefile.am	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -1,4 +1,6 @@
 # PLEASE adhere to the alphabetical ordering in this Makefile!
 # Also indentation by a single tab
+
+SUBDIRS = Actions UIElements
 
 # this includes source files that need to be present at multiple points
@@ -49,13 +51,6 @@
   analysis_correlation.hpp
 
-ACTIONSSOURCE = Actions/Action.cpp \
-  ${ANALYSISACTIONSOURCE} \
-  ${ATOMACTIONSOURCE} \
-  ${CMDACTIONSOURCE} \
-  ${FRAGMENTATIONACTIONSOURCE} \
-  ${MOLECULEACTIONSOURCE} \
-  ${PARSERACTIONSOURCE} \
-  ${TESSELATIONACTIONSOURCE} \
-  ${WORLDACTIONSOURCE} \
+ACTIONSSOURCE = \
+  Actions/Action.cpp \
   Actions/ActionHistory.cpp \
   Actions/ActionRegistry.cpp \
@@ -64,9 +59,8 @@
   Actions/MakroAction.cpp \
   Actions/ManipulateAtomsProcess.cpp \
-  Actions/MapOfActions.cpp \
   Actions/MethodAction.cpp \
   Actions/Process.cpp
 
-ACTIONSHEADER = Actions/Action.hpp \
+ACTIONSHEADER = \
   ${ANALYSISACTIONHEADER} \
   ${ATOMACTIONHEADER} \
@@ -77,4 +71,5 @@
   ${TESSELATIONACTIONHEADER} \
   ${WORLDACTIONHEADER} \
+  Actions/Action.hpp \
   Actions/ActionHistory.hpp \
   Actions/ActionRegistry.hpp \
@@ -89,113 +84,4 @@
   Actions/Process.hpp
   
-ANALYSISACTIONSOURCE = \
-  Actions/AnalysisAction/MolecularVolumeAction.cpp \
-  Actions/AnalysisAction/PairCorrelationAction.cpp \
-  Actions/AnalysisAction/PairCorrelationToPointAction.cpp \
-  Actions/AnalysisAction/PairCorrelationToSurfaceAction.cpp \
-  Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
-ANALYSISACTIONHEADER = \
-  Actions/AnalysisAction/MolecularVolumeAction.hpp \
-  Actions/AnalysisAction/PairCorrelationAction.hpp \
-  Actions/AnalysisAction/PairCorrelationToPointAction.hpp \
-  Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp \
-  Actions/AnalysisAction/PrincipalAxisSystemAction.hpp
-
-ATOMACTIONSOURCE = \
-  Actions/AtomAction/AddAction.cpp \
-  Actions/AtomAction/ChangeElementAction.cpp \
-  Actions/AtomAction/RemoveAction.cpp
-ATOMACTIONHEADER = \
-  Actions/AtomAction/AddAction.hpp \
-  Actions/AtomAction/ChangeElementAction.hpp \
-  Actions/AtomAction/RemoveAction.cpp
-
-CMDACTIONSOURCE = \
-  Actions/CmdAction/BondLengthTableAction.cpp \
-  Actions/CmdAction/ElementDbAction.cpp \
-  Actions/CmdAction/FastParsingAction.cpp \
-  Actions/CmdAction/HelpAction.cpp \
-  Actions/CmdAction/VerboseAction.cpp \
-  Actions/CmdAction/VersionAction.cpp
-CMDACTIONHEADER = \
-  Actions/CmdAction/BondLengthTableAction.hpp \
-  Actions/CmdAction/ElementDbAction.hpp \
-  Actions/CmdAction/FastParsingAction.hpp \
-  Actions/CmdAction/HelpAction.hpp \
-  Actions/CmdAction/VerboseAction.hpp \
-  Actions/CmdAction/VersionAction.hpp
-
-FRAGMENTATIONACTIONSOURCE = \
-  Actions/FragmentationAction/DepthFirstSearchAction.cpp \
-  Actions/FragmentationAction/FragmentationAction.cpp \
-  Actions/FragmentationAction/SubgraphDissectionAction.cpp               
-FRAGMENTATIONACTIONHEADER = \
-  Actions/FragmentationAction/DepthFirstSearchAction.hpp \
-  Actions/FragmentationAction/FragmentationAction.hpp \
-  Actions/FragmentationAction/SubgraphDissectionAction.hpp
-
-MOLECULEACTIONSOURCE = \
-  Actions/MoleculeAction/BondFileAction.cpp \
-  Actions/MoleculeAction/ChangeNameAction.cpp \
-  Actions/MoleculeAction/FillWithMoleculeAction.cpp \
-  Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \
-  Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \
-  Actions/MoleculeAction/SaveAdjacencyAction.cpp \
-  Actions/MoleculeAction/SaveBondsAction.cpp \
-  Actions/MoleculeAction/SaveTemperatureAction.cpp \
-  Actions/MoleculeAction/SuspendInWaterAction.cpp \
-  Actions/MoleculeAction/TranslateAction.cpp \
-  Actions/MoleculeAction/VerletIntegrationAction.cpp
-MOLECULEACTIONHEADER = \
-  Actions/MoleculeAction/BondFileAction.hpp \
-  Actions/MoleculeAction/ChangeNameAction.hpp \
-  Actions/MoleculeAction/FillWithMoleculeAction.hpp \
-  Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \
-  Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \
-  Actions/MoleculeAction/SaveAdjacencyAction.hpp \
-  Actions/MoleculeAction/SaveBondsAction.hpp \
-  Actions/MoleculeAction/SaveTemperatureAction.hpp \
-  Actions/MoleculeAction/SuspendInWaterAction.hpp \
-  Actions/MoleculeAction/TranslateAction.hpp \
-  Actions/MoleculeAction/VerletIntegrationAction.hpp
-                 
-PARSERACTIONSOURCE = \
-  Actions/ParserAction/LoadXyzAction.cpp \
-  Actions/ParserAction/SaveXyzAction.cpp       
-PARSERACTIONHEADER = \
-  Actions/ParserAction/LoadXyzAction.hpp \
-  Actions/ParserAction/SaveXyzAction.hpp
-
-TESSELATIONACTIONSOURCE = \
-  Actions/TesselationAction/ConvexEnvelopeAction.cpp \
-  Actions/TesselationAction/NonConvexEnvelopeAction.cpp               
-TESSELATIONACTIONHEADER = \
-  Actions/TesselationAction/ConvexEnvelopeAction.hpp \
-  Actions/TesselationAction/NonConvexEnvelopeAction.hpp
-
-WORLDACTIONSOURCE = \
-  Actions/WorldAction/AddEmptyBoundaryAction.cpp \
-  Actions/WorldAction/BoundInBoxAction.cpp \
-  Actions/WorldAction/CenterInBoxAction.cpp \
-  Actions/WorldAction/CenterOnEdgeAction.cpp \
-  Actions/WorldAction/ChangeBoxAction.cpp \
-  Actions/WorldAction/RemoveSphereOfAtomsAction.cpp \
-  Actions/WorldAction/RepeatBoxAction.cpp \
-  Actions/WorldAction/ScaleBoxAction.cpp \
-  Actions/WorldAction/SetDefaultNameAction.cpp \
-  Actions/WorldAction/SetGaussianBasisAction.cpp               
-WORLDACTIONHEADER = \
-  Actions/WorldAction/AddEmptyBoundaryAction.hpp \
-  Actions/WorldAction/BoundInBoxAction.hpp \
-  Actions/WorldAction/CenterInBoxAction.hpp \
-  Actions/WorldAction/CenterOnEdgeAction.hpp \
-  Actions/WorldAction/ChangeBoxAction.hpp \
-  Actions/WorldAction/RemoveSphereOfAtomsAction.hpp \
-  Actions/WorldAction/RepeatBoxAction.hpp \
-  Actions/WorldAction/ScaleBoxAction.hpp \
-  Actions/WorldAction/SetDefaultNameAction.hpp \
-  Actions/WorldAction/SetGaussianBasisAction.hpp
-
-
 
 PARSERSOURCE = \
@@ -216,77 +102,4 @@
   Patterns/Observer.hpp \
   Patterns/Singleton.hpp
-
-# Below is all for the User Interface
-
-VIEWSOURCE = \
-  Views/View.cpp \
-  Views/StringView.cpp \
-  Views/MethodStringView.cpp \
-  Views/StreamStringView.cpp
-VIEWHEADER = \
-  Views/View.hpp \
-  Views/StringView.hpp \
-  Views/MethodStringView.hpp \
-  Views/StreamStringView.hpp
-
-MENUSOURCE = \
-  Menu/Menu.cpp \
-  Menu/TextMenu.cpp \
-  Menu/MenuItem.cpp \
-  Menu/SubMenuItem.cpp \
-  Menu/ActionMenuItem.cpp \
-  Menu/SeperatorItem.cpp \
-  Menu/DisplayMenuItem.cpp
-  
-MENUHEADER = \
-  Menu/Menu.hpp \
-  Menu/TextMenu.hpp \
-  Menu/MenuItem.hpp \
-  Menu/SubMenuItem.hpp \
-  Menu/ActionMenuItem.hpp \
-  Menu/SeperatorItem.hpp \
-  Menu/DisplayMenuItem.hpp
-
-UISOURCE = \
-  ${ACTIONSSOURCE} \
-  ${COMMANDLINEUISOURCE} \
-  ${MENUSOURCE} \
-  ${TEXTUISOURCE} \
-  ${VIEWSOURCE} \
-  UIElements/Dialog.cpp \
-  UIElements/MainWindow.cpp \
-  UIElements/UIFactory.cpp
-  
-UIHEADER = \
-  ${ACTIONSHEADER} \
-  ${COMMANDLINEUIHEADER} \
-  ${MENUHEADER} \
-  ${TEXTUIHEADER} \
-  ${VIEWHEADER} \
-  UIElements/Dialog.hpp \
-  UIElements/MainWindow.hpp \
-  UIElements/UIFactory.hpp
-
-TEXTUISOURCE = \
-  UIElements/TextDialog.cpp \
-  UIElements/TextStatusIndicator.cpp \
-  UIElements/TextUIFactory.cpp \
-  UIElements/TextWindow.cpp
-TEXTUIHEADER = \
-  UIElements/TextDialog.hpp \
-  UIElements/TextStatusIndicator.hpp \
-  UIElements/TextUIFactory.hpp \
-  UIElements/TextWindow.hpp
-
-COMMANDLINEUISOURCE = \
-  UIElements/CommandLineDialog.cpp \
-  UIElements/CommandLineStatusIndicator.cpp \
-  UIElements/CommandLineUIFactory.cpp \
-  UIElements/CommandLineWindow.cpp
-COMMANDLINEUIHEADER = \
-  UIElements/CommandLineDialog.hpp \
-  UIElements/CommandLineStatusIndicator.hpp \
-  UIElements/CommandLineUIFactory.hpp \
-  UIElements/CommandLineWindow.hpp
 
 # all these files are only used for legacy reasons while the transition is in progress
@@ -321,8 +134,8 @@
 SOURCE = \
   ${ANALYSISSOURCE} \
+  ${ACTIONSSOURCE} \
   ${ATOMSOURCE} \
   ${PATTERNSOURCE} \
   ${PARSERSOURCE} \
-  ${UISOURCE} \
   ${DESCRIPTORSOURCE} \
   ${HELPERSOURCE} \
@@ -335,4 +148,5 @@
   config.cpp \
   element.cpp \
+  elements_db.cpp \
   ellipsoid.cpp \
   errorlogger.cpp \
@@ -366,8 +180,8 @@
 HEADER = \
   ${ANALYSISHEADER} \
+  ${ACTIONSHEADER} \
   ${ATOMHEADER} \
   ${PARSERHEADER} \
   ${PATTERNHEADER} \
-  ${UIHEADER} \
   ${DESCRIPTORHEADER} \
   ${EXCEPTIONHEADER} \
@@ -380,4 +194,5 @@
   defs.hpp \
   element.hpp \
+  elements_db.hpp \
   ellipsoid.hpp \
   errorlogger.hpp \
@@ -407,5 +222,5 @@
 
 BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB)
-INCLUDES = -I$(top_srcdir)/src/unittests
+INCLUDES = -I$(top_srcdir)/src/unittests -I$(top_srcdir)/src/Actions -I$(top_srcdir)/src/UIElements
 
 noinst_LIBRARIES = libmolecuilder.a libgslwrapper.a
@@ -414,8 +229,7 @@
 libmolecuilder_a_SOURCES = ${SOURCE} ${HEADER}
 libgslwrapper_a_SOURCES = ${LINALGSOURCE} ${LINALGHEADER}
-molecuilder_DATA = elements.db valence.db orbitals.db Hbonddistance.db Hbondangle.db
 molecuilder_LDFLAGS = $(BOOST_LDFLAGS)
 molecuilder_SOURCES = builder.cpp
-molecuilder_LDADD = libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB}
+molecuilder_LDADD =  UIElements/libMolecuilderUI.a Actions/libMolecuilderActions.a libmolecuilder.a libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB} ${BOOST_PROGRAM_OPTIONS_LIB} 
 joiner_SOURCES = joiner.cpp datacreator.cpp parser.cpp datacreator.hpp helpers.hpp parser.hpp periodentafel.hpp
 joiner_LDADD = libmolecuilder.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
Index: lecuilder/src/Menu/ActionMenuItem.cpp
===================================================================
--- molecuilder/src/Menu/ActionMenuItem.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,30 +1,0 @@
-/*
- * ActionMenuItem.cpp
- *
- *  Created on: Dec 11, 2009
- *      Author: crueger
- */
-
-#include <iostream>
-
-#include "Menu/ActionMenuItem.hpp"
-#include "Actions/MethodAction.hpp"
-
-using namespace std;
-
-ActionMenuItem::ActionMenuItem(char _trigger, const char* _description,Menu* _menu,Action* _action)
-: MenuItem(_trigger,_description,_menu),
-  action(_action)
-{
-}
-
-ActionMenuItem::~ActionMenuItem()
-{}
-
-void ActionMenuItem::doTrigger() {
-  action->call();
-}
-
-bool ActionMenuItem::isActive() {
-  return action->isActive();
-}
Index: lecuilder/src/Menu/ActionMenuItem.hpp
===================================================================
--- molecuilder/src/Menu/ActionMenuItem.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/*
- * ActionMenuItem.h
- *
- *  Created on: Dec 11, 2009
- *      Author: crueger
- */
-
-#ifndef ACTIONMENUITEM_H_
-#define ACTIONMENUITEM_H_
-
-#include <string>
-
-#include "Menu/MenuItem.hpp"
-
-class Action;
-
-/**
- * Produce MenuItems that take an appropriate action when called.
- */
-class ActionMenuItem : public MenuItem
-{
-public:
-  ActionMenuItem(char,const char*,Menu*,Action*);
-  virtual ~ActionMenuItem();
-
-  virtual void doTrigger();
-
-  virtual bool isActive();
-
-private:
-  Action* action; //!< this action will be called when the trigger matches
-};
-
-#endif /* ACTIONMENUITEM_H_ */
Index: lecuilder/src/Menu/DisplayMenuItem.cpp
===================================================================
--- molecuilder/src/Menu/DisplayMenuItem.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*
- * DisplayMenuItem.cpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#include <sstream>
-#include <cmath>
-
-#include "Menu/DisplayMenuItem.hpp"
-#include "Views/StringView.hpp"
-
-
-DisplayMenuItem::DisplayMenuItem(Menu* _menu, StringView *_view):
-MenuItem('\0',"",_menu),
-view(_view),
-title("")
-{
-}
-
-DisplayMenuItem::DisplayMenuItem(Menu* _menu, StringView *_view, string _title, char _spacer, int _length ):
-  MenuItem('\0',"",_menu),
-  view(_view),
-  title(_title),
-  length(_length),
-  spacer(_spacer)
-{
-}
-
-DisplayMenuItem::~DisplayMenuItem()
-{}
-
-
-void DisplayMenuItem::doTrigger(){}
-bool DisplayMenuItem::checkTrigger(char c){
-  return false;
-}
-
-const string DisplayMenuItem::formatEntry(){
-  stringstream s;
-  if(title.length()>0) {
-    int pre = floor((length-title.length())/2.0);
-    int post = ceil((length-title.length())/2.0);
-    for(int i=0;i<pre;i++)
-      s << spacer;
-    s << title;
-    for(int i=0;i<post;i++)
-          s << spacer;
-    s << "\n";
-  }
-  s << view->toString();
-  return s.str();
-}
-
-
-const string DisplayMenuItem::getDescription(){
-  return string("");
-}
Index: lecuilder/src/Menu/DisplayMenuItem.hpp
===================================================================
--- molecuilder/src/Menu/DisplayMenuItem.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * DisplayMenuItem.hpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#ifndef DISPLAYMENUITEM_HPP_
-#define DISPLAYMENUITEM_HPP_
-
-#include "Menu/MenuItem.hpp"
-#include "defs.hpp"
-
-class StringView;
-
-/**
- * Display any kind of StringView within a Menu
- *
- * Any trigger are ignored for this type of Item
- */
-class DisplayMenuItem : public MenuItem
-{
-public:
-  DisplayMenuItem(Menu* _menu, StringView *_view);
-  DisplayMenuItem(Menu* _menu, StringView *_view, string _title,
-                  char _spacer=STD_MENU_TITLE_SPACER, int _length=STD_MENU_LENGTH);
-  virtual ~DisplayMenuItem();
-
-  virtual void doTrigger();
-  virtual bool checkTrigger(char);
-
-  virtual const string formatEntry();
-
-  virtual const string getDescription();
-
-private:
-  StringView *view;
-  string title;
-  int length;
-  char spacer;
-};
-
-#endif /* DISPLAYMENUITEM_HPP_ */
Index: lecuilder/src/Menu/Menu.cpp
===================================================================
--- molecuilder/src/Menu/Menu.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,19 +1,0 @@
-/*
- * Menu.cpp
- *
- *  Created on: Dec 10, 2009
- *      Author: crueger
- */
-
-#include "Menu.hpp"
-
-Menu::Menu()
-{
-  // TODO Auto-generated constructor stub
-
-}
-
-Menu::~Menu()
-{
-  // TODO Auto-generated destructor stub
-}
Index: lecuilder/src/Menu/Menu.hpp
===================================================================
--- molecuilder/src/Menu/Menu.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/*
- * Menu.h
- *
- *  Created on: Dec 10, 2009
- *      Author: crueger
- */
-
-#ifndef MENU_MENU_H_
-#define MENU_MENU_H_
-
-using namespace std;
-
-class MenuItem;
-
-/**
- * Base class for all Types of menus
- * contains basic abstract functionality to add Items, remove Items and display the menu
- *
- * TODO: Make sure all items are only added once.
- */
-class Menu
-{
-public:
-  Menu();
-  virtual ~Menu();
-
-
-  /**
-   * Adding and removing should be handled by the items.
-   */
-  virtual void addItem(MenuItem*)=0;
-  /**
-   * Adding and removing should be handled by the items.
-   */
-  virtual void removeItem(MenuItem*)=0;
-  virtual void display()=0;
-
-private:
-};
-
-#endif /* MENU_H_ */
Index: lecuilder/src/Menu/MenuItem.cpp
===================================================================
--- molecuilder/src/Menu/MenuItem.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,83 +1,0 @@
-/*
- * MenuItem.cpp
- *
- *  Created on: Dec 10, 2009
- *      Author: crueger
- */
-
-
-
-#include "Menu/MenuItem.hpp"
-#include "Menu/Menu.hpp"
-#include <sstream>
-#include <iostream>
-
-/**
- * produce a new MenuItem using with a description and a trigger.
- * The MenuItem is then added to the menu passed to it.
- */
-MenuItem::MenuItem(char _trigger, const char* _description,Menu* menu) :
-trigger(_trigger),
-added(false)
-{
-  description = new string(_description);
-  add_to_menu(menu);
-}
-
-MenuItem::~MenuItem()
-{
-  delete description;
-}
-
-/**
- * check if the trigger matches and call doTrigger if it does.
- */
-bool MenuItem::checkTrigger(char key) {
-  if(key == trigger) {
-    doTrigger();
-    return true;
-  }
-  else
-    return false;
-
-}
-
-char MenuItem::getTrigger() {
-  return trigger;
-}
-
-const string MenuItem::getDescription() {
-  return *description;
-}
-
-/**
- * Produce a formated output of this item containing trigger and description
- * Normal format is: "<trigger> - <description>"
- */
-const string MenuItem::formatEntry(){
-  stringstream s;
-  s << getTrigger() << " - " << getDescription();
-
-  return s.str();
-}
-
-
-/**
- * check if this item is within a menu and add to menu if it is not yet contained anywhere
- *
- * TODO: include funtionality to move Items from one menu to another
- */
-void MenuItem::add_to_menu(Menu* menu) {
-  if(!wasAdded()) {
-    menu->addItem(this);
-    added=true;
-  }
-}
-
-bool MenuItem::wasAdded(){
-  return added;
-}
-
-bool MenuItem::isActive(){
-  return true;
-}
Index: lecuilder/src/Menu/MenuItem.hpp
===================================================================
--- molecuilder/src/Menu/MenuItem.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * MenuItem.h
- *
- *  Created on: Dec 10, 2009
- *      Author: crueger
- */
-
-#ifndef MENUITEM_H_
-#define MENUITEM_H_
-
-#include <string>
-
-using namespace std;
-
-class Menu;
-
-/**
- * Base class for all kinds of MenuItems
- *
- * This class takes care of checking the triggers and performing appropriate actions.
- */
-class MenuItem {
-public:
-  MenuItem(char,const char*,Menu*);
-  virtual ~MenuItem();
-
-  virtual void doTrigger()=0;
-  virtual bool checkTrigger(char);
-
-  virtual const string formatEntry();
-
-  virtual const string getDescription();
-  char getTrigger();
-
-  void add_to_menu(Menu*);
-  bool wasAdded();
-
-  virtual bool isActive();
-
-protected:
-  void setDescription(string);
-
-private:
-  char trigger;
-  string *description;
-  bool added;
-};
-
-#endif /* MENUITEM_H_ */
Index: lecuilder/src/Menu/SeperatorItem.cpp
===================================================================
--- molecuilder/src/Menu/SeperatorItem.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
- * SeperatorItem.cpp
- *
- *  Created on: Dec 11, 2009
- *      Author: crueger
- */
-#include <string>
-#include <sstream>
-
-#include "Menu/SeperatorItem.hpp"
-#include "Menu/Menu.hpp"
-#include "defs.hpp"
-
-
-SeperatorItem::SeperatorItem(Menu* menu):
-MenuItem('\0',"",menu),
-spacer(STD_SEPERATOR_SPACER),
-length(STD_MENU_LENGTH)
-{
-  // TODO Auto-generated constructor stub
-
-}
-
-SeperatorItem::SeperatorItem(Menu* menu,char _spacer, int _length):
-MenuItem('\0',"",menu),
-spacer(_spacer),
-length(_length)
-{
-  // TODO Auto-generated constructor stub
-
-}
-
-SeperatorItem::~SeperatorItem()
-{
-  // TODO Auto-generated destructor stub
-}
-
-
-void SeperatorItem::doTrigger(){}
-bool SeperatorItem::checkTrigger(char){
-  return false;
-}
-
-const string SeperatorItem::getDescription() {
-  return string("");
-}
-
-const string SeperatorItem::formatEntry(){
-  stringstream s;
-  for(int i=0; i<length;i++)
-    s << spacer;
-  return s.str();
-}
Index: lecuilder/src/Menu/SeperatorItem.hpp
===================================================================
--- molecuilder/src/Menu/SeperatorItem.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,36 +1,0 @@
-/*
- * SeperatorItem.h
- *
- *  Created on: Dec 11, 2009
- *      Author: crueger
- */
-
-#ifndef SEPERATORITEM_H_
-#define SEPERATORITEM_H_
-
-#include "Menu/MenuItem.hpp"
-
-/**
- * Produce a Seperator within a Menu.
- *
- * All triggers are ignored for this Item.
- */
-class SeperatorItem : public MenuItem
-{
-public:
-  SeperatorItem(Menu*);
-  SeperatorItem(Menu*,char,int);
-  virtual ~SeperatorItem();
-
-  virtual void doTrigger();
-  virtual bool checkTrigger(char);
-
-  virtual const string getDescription();
-
-  virtual const string formatEntry();
-private:
-  char spacer;
-  int length;
-};
-
-#endif /* SEPERATORITEM_H_ */
Index: lecuilder/src/Menu/SubMenuItem.cpp
===================================================================
--- molecuilder/src/Menu/SubMenuItem.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,23 +1,0 @@
-/*
- * SubMenuItem.cpp
- *
- *  Created on: Dec 10, 2009
- *      Author: crueger
- */
-
-#include "SubMenuItem.hpp"
-
-SubMenuItem::SubMenuItem(char _trigger,const char* _description,Menu* _parent, Menu* _theMenu) :
-MenuItem(_trigger,_description,_parent),
-theMenu(_theMenu)
-{
-}
-
-SubMenuItem::~SubMenuItem()
-{
-  delete theMenu;
-}
-
-void SubMenuItem::doTrigger() {
-  theMenu->display();
-}
Index: lecuilder/src/Menu/SubMenuItem.hpp
===================================================================
--- molecuilder/src/Menu/SubMenuItem.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,20 +1,0 @@
-#ifndef SUBMENUITEM_H_
-#define SUBMENUITEM_H_
-
-#include "MenuItem.hpp"
-#include "TextMenu.hpp"
-
-class Menu;
-
-class SubMenuItem : public MenuItem
-{
-public:
-  SubMenuItem(char,const char*,Menu*,Menu*);
-  virtual ~SubMenuItem();
-
-  virtual void doTrigger();
-private:
-  Menu* theMenu;
-};
-
-#endif /* SUBMENUITEM_H_ */
Index: lecuilder/src/Menu/TextMenu.cpp
===================================================================
--- molecuilder/src/Menu/TextMenu.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,141 +1,0 @@
-/*
- * TextMenu.cpp
- *
- *  Created on: Dec 10, 2009
- *      Author: crueger
- */
-
-#include <boost/bind.hpp>
-#include <iostream>
-#include <cmath>
-#include "Menu/TextMenu.hpp"
-#include "Menu/MenuItem.hpp"
-#include "Helpers/Assert.hpp"
-
-
-/**
- * produce a text menu with a given title.
- * The text will later be displayed using the stream passed to the constructor.
- */
-TextMenu::TextMenu(ostream& _outputter, string _title, char _spacer,int _length) :
-  defaultItem(0),
-  outputter(_outputter),
-  title(_title),
-  spacer(_spacer),
-  length(_length),
-  quit(false)
-{
-}
-
-TextMenu::~TextMenu()
-{
-  for(list<MenuItem*>::iterator it=items.begin(); it != items.end(); it++)
-    delete (*it);
-}
-
-
-void TextMenu::addItem(MenuItem* item) {
-  items.push_back(item);
-}
-
-void TextMenu::removeItem(MenuItem* item) {
-  items.remove(item);
-}
-
-void TextMenu::doQuit(){
-  quit = true;
-}
-
-bool TextMenu::hasQuit(){
-  return quit;
-}
-
-void TextMenu::showEntry(MenuItem* entry){
-  if(entry->isActive()==false){
-    outputter << "(";
-  }
-  outputter << entry->formatEntry();
-  if(entry->isActive()==false){
-    outputter << ")";
-  }
-  outputter << "\n";
-}
-
-void TextMenu::display() {
-  char choice;
-  bool somethingChosen = false;
-  quit = false;
-  do {
-    int pre = floor((length - title.length()) /2.0);
-    int post = ceil((length - title.length()) /2.0);
-    for(int i=0;i<pre;i++)
-      outputter << spacer;
-    outputter << title;
-    for(int i=0;i<post;i++)
-          outputter << spacer;
-    outputter << '\n';
-    for_each(items.begin(), items.end(), boost::bind(&TextMenu::showEntry,this,_1));
-    outputter.flush();
-
-    cin >> choice;
-
-    list<MenuItem*>::iterator iter;
-    for(iter = items.begin(); iter!=items.end();iter++){
-      if((*iter)->isActive()){
-        somethingChosen |= (*iter)->checkTrigger(choice);
-      }
-    }
-    // see if something was chosen and call default Item if not
-    if(!somethingChosen) {
-      if(defaultItem){
-        defaultItem->doTrigger();
-      }
-      else{
-        outputter << "Invalid Choice!" <<  endl;
-      }
-    }
-  }while (!hasQuit());
-}
-
-string TextMenu::getTitle(){
-  return title;
-}
-
-void TextMenu::addDefault(MenuItem* _defaultItem) {
-  defaultItem = _defaultItem;
-}
-
-/****************************** Contained Actions ****************/
-
-const string TextMenu::LeaveAction::nameBase = "Leave menu: ";
-
-TextMenu::LeaveAction::LeaveAction(TextMenu* _menu) :
-Action(nameBase+_menu->getTitle()),
-menu(_menu)
-{}
-
-TextMenu::LeaveAction::~LeaveAction(){}
-
-bool TextMenu::LeaveAction::canUndo(){
-  return false;
-}
-
-bool TextMenu::LeaveAction::shouldUndo(){
-  return false;
-}
-
-Action::state_ptr TextMenu::LeaveAction::performCall(){
-  menu->doQuit();
-  return Action::success;
-}
-
-
-Action::state_ptr TextMenu::LeaveAction::performUndo(Action::state_ptr){
-  ASSERT(0,"Cannot undo leaving a menu");
-  return Action::success;
-}
-
-Action::state_ptr TextMenu::LeaveAction::performRedo(Action::state_ptr){
-  ASSERT(0,"Cannot redo leaving a menu");
-  return Action::success;
-}
Index: lecuilder/src/Menu/TextMenu.hpp
===================================================================
--- molecuilder/src/Menu/TextMenu.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,82 +1,0 @@
-/*
- * TextMenu.h
- *
- *  Created on: Dec 10, 2009
- *      Author: crueger
- */
-
-#ifndef TEXTMENU_H_
-#define TEXTMENU_H_
-
-#include <list>
-#include <ostream>
-#include <string>
-
-#include "Menu/Menu.hpp"
-#include "Actions/Action.hpp"
-#include "defs.hpp"
-
-class MenuItem;
-
-/**
- * Used to produce any kind of text menu
- *
- * All Items are displayed and user is prompted for a key. The item corresponding to that key is then activated.
- */
-class TextMenu : public Menu
-{
-public:
-  class LeaveAction : public Action {
-  public:
-    LeaveAction(TextMenu*);
-    virtual ~LeaveAction();
-
-    bool canUndo();
-    bool shouldUndo();
-
-  private:
-    virtual Action::state_ptr performCall();
-    virtual Action::state_ptr performUndo(Action::state_ptr);
-    virtual Action::state_ptr performRedo(Action::state_ptr);
-
-    TextMenu* menu;
-
-    static const string nameBase;
-  };
-
-  TextMenu(ostream& _outputter, string _title, char _spacer=STD_MENU_TITLE_SPACER,int _length=STD_MENU_LENGTH);
-  virtual ~TextMenu();
-
-  virtual void addItem(MenuItem*);
-  virtual void removeItem(MenuItem*);
-  virtual void display();
-  virtual string getTitle();
-
-  /**
-   * Call doQuit if you want to return from this menu.
-   */
-  virtual void doQuit();
-  /**
-   * Check whether someone has chosen to quit
-   */
-  virtual bool hasQuit();
-
-  virtual void addDefault(MenuItem*);
-
-protected:
-  virtual void showEntry(MenuItem*);
-
-private:
-  list<MenuItem*> items;
-
-  MenuItem* defaultItem;
-
-  ostream& outputter;
-  string title;
-  char spacer;
-  int length;
-
-  bool quit;
-};
-
-#endif /* TEXTMENU_H_ */
Index: lecuilder/src/UIElements/CommandLineDialog.cpp
===================================================================
--- molecuilder/src/UIElements/CommandLineDialog.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,259 +1,0 @@
-/*
- * CommandLineDialog.cpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-
-#include <cassert>
-#include <iostream>
-
-#include <Descriptors/AtomDescriptor.hpp>
-#include <Descriptors/AtomIdDescriptor.hpp>
-#include <Descriptors/MoleculeDescriptor.hpp>
-#include <Descriptors/MoleculeIdDescriptor.hpp>
-#include "UIElements/CommandLineDialog.hpp"
-
-#include "element.hpp"
-#include "periodentafel.hpp"
-#include "CommandLineParser.hpp"
-#include "defs.hpp"
-#include "log.hpp"
-#include "periodentafel.hpp"
-#include "verbose.hpp"
-#include "World.hpp"
-
-#include "atom.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "vector.hpp"
-
-using namespace std;
-
-
-CommandLineDialog::CommandLineDialog()
-{
-}
-
-CommandLineDialog::~CommandLineDialog()
-{
-}
-
-
-void CommandLineDialog::queryEmpty(const char* title, string _description){
-  registerQuery(new EmptyCommandLineQuery(title, _description));
-}
-
-void CommandLineDialog::queryInt(const char* title, int* target, string _description){
-  registerQuery(new IntCommandLineQuery(title,target, _description));
-}
-
-void CommandLineDialog::queryBoolean(const char* title, bool* target, string _description){
-  registerQuery(new BooleanCommandLineQuery(title,target, _description));
-}
-
-void CommandLineDialog::queryDouble(const char* title, double* target, string _description){
-  registerQuery(new DoubleCommandLineQuery(title,target, _description));
-}
-
-void CommandLineDialog::queryString(const char* title, string* target, string _description){
-  registerQuery(new StringCommandLineQuery(title,target, _description));
-}
-
-void CommandLineDialog::queryAtom(const char* title, atom **target, string _description) {
-  registerQuery(new AtomCommandLineQuery(title,target, _description));
-}
-
-void CommandLineDialog::queryMolecule(const char* title, molecule **target, string _description) {
-  registerQuery(new MoleculeCommandLineQuery(title,target, _description));
-}
-
-void CommandLineDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string _description) {
-  registerQuery(new VectorCommandLineQuery(title,target,cellSize,check, _description));
-}
-
-void CommandLineDialog::queryBox(const char* title, double ** const cellSize, string _description) {
-  registerQuery(new BoxCommandLineQuery(title,cellSize,_description));
-}
-
-void CommandLineDialog::queryElement(const char* title, const element **target, string _description){
-  registerQuery(new ElementCommandLineQuery(title,target, _description));
-}
-
-/************************** Query Infrastructure ************************/
-
-CommandLineDialog::EmptyCommandLineQuery::EmptyCommandLineQuery(string title, string _description) :
-    Dialog::EmptyQuery(title, _description)
-{}
-
-CommandLineDialog::EmptyCommandLineQuery::~EmptyCommandLineQuery() {}
-
-bool CommandLineDialog::EmptyCommandLineQuery::handle() {
-  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
-  return true;
-}
-
-CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(string title,int *_target, string _description) :
-    Dialog::IntQuery(title,_target, _description)
-{}
-
-CommandLineDialog::IntCommandLineQuery::~IntCommandLineQuery() {}
-
-bool CommandLineDialog::IntCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    return true;
-  } else
-    return false;
-}
-
-CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title,bool *_target, string _description) :
-    Dialog::BooleanQuery(title,_target, _description)
-{}
-
-CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
-
-bool CommandLineDialog::BooleanCommandLineQuery::handle() {
-  bool badInput = false;
-  char input = ' ';
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> input;
-    if ((input == 'y' ) || (input == 'Y')) {
-      tmp = true;
-    } else if ((input == 'n' ) || (input == 'N')) {
-      tmp = false;
-    } else {
-      badInput=true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
-    }
-  } while(badInput);
-  // clear the input buffer of anything still in the line
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title,string *_target, string _description) :
-    Dialog::StringQuery(title,_target, _description)
-{}
-
-CommandLineDialog::StringCommandLineQuery::~StringCommandLineQuery() {}
-
-bool CommandLineDialog::StringCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
-    return true;
-  } else
-    return false;
-}
-
-CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(string title,double *_target, string _description) :
-    Dialog::DoubleQuery(title,_target, _description)
-{}
-
-CommandLineDialog::DoubleCommandLineQuery::~DoubleCommandLineQuery() {}
-
-bool CommandLineDialog::DoubleCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
-    return true;
-  } else
-    return false;
-}
-
-CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, atom **_target, string _description) :
-    Dialog::AtomQuery(title,_target, _description)
-{}
-
-CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
-
-bool CommandLineDialog::AtomCommandLineQuery::handle() {
-  int IdxOfAtom = -1;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
-    return true;
-  } else
-    return false;
-}
-
-CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, string _description) :
-    Dialog::MoleculeQuery(title,_target, _description)
-{}
-
-CommandLineDialog::MoleculeCommandLineQuery::~MoleculeCommandLineQuery() {}
-
-bool CommandLineDialog::MoleculeCommandLineQuery::handle() {
-  int IdxOfMol = -1;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
-    return true;
-  } else
-    return false;
-}
-
-CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(string title, Vector *_target, const double *const _cellSize, bool _check, string _description) :
-    Dialog::VectorQuery(title,_target,_cellSize,_check, _description)
-{}
-
-CommandLineDialog::VectorCommandLineQuery::~VectorCommandLineQuery()
-{}
-
-bool CommandLineDialog::VectorCommandLineQuery::handle() {
-  vector<double> temp;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
-    assert((temp.size() == 3) && "Vector from command line does not have three components.");
-    for (int i=0;i<NDIM;i++)
-      tmp->at(i) = temp[i];
-    return true;
-  } else
-    return false;
-}
-
-
-CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, double ** const _cellSize, string _description) :
-    Dialog::BoxQuery(title,_cellSize, _description)
-{}
-
-CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
-{}
-
-bool CommandLineDialog::BoxCommandLineQuery::handle() {
-  vector<double> temp;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
-    assert((temp.size() == 6) && "Symmetric box matrix from command line does not have six components.");
-    for (int i=0;i<6;i++)
-      tmp[i] = temp[i];
-    return true;
-  } else
-    return false;
-}
-
-CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, const element **target, string _description) :
-    Dialog::ElementQuery(title,target, _description)
-{}
-
-CommandLineDialog::ElementCommandLineQuery::~ElementCommandLineQuery()
-{}
-
-bool CommandLineDialog::ElementCommandLineQuery::handle() {
-  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
-  int Z;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
-    vector<int>::iterator ElementRunner = AllElements.begin();
-    Z = *ElementRunner;
-    // TODO: So far, this does not really erase the element in the parsed list.
-    AllElements.erase(ElementRunner);
-    tmp = World::getInstance().getPeriode()->FindElement(Z);
-    return true;
-  } else
-    return false;
-}
Index: lecuilder/src/UIElements/CommandLineDialog.hpp
===================================================================
--- molecuilder/src/UIElements/CommandLineDialog.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,113 +1,0 @@
-/*
- * CommandLineDialog.hpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-#ifndef COMMANDLINEDIALOG_HPP_
-#define COMMANDLINEDIALOG_HPP_
-
-#include <string>
-
-class atom;
-class element;
-class molecule;
-class Vector;
-
-#include "UIElements/Dialog.hpp"
-
-/** CommandLineUIFactory implementation of the Dialog.
- * The idea here is that for each query the parsed command line options are used instead.
- */
-class CommandLineDialog : public Dialog
-{
-public:
-  CommandLineDialog();
-  virtual ~CommandLineDialog();
-
-  virtual void queryEmpty(const char *, std::string = "");
-  virtual void queryInt(const char *, int *, std::string = "");
-  virtual void queryBoolean(const char *, bool *, std::string = "");
-  virtual void queryString(const char*, std::string *, std::string = "");
-  virtual void queryDouble(const char*, double*, std::string = "");
-  virtual void queryAtom(const char*,atom**, std::string = "");
-  virtual void queryMolecule(const char*,molecule**,std::string = "");
-  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
-  virtual void queryBox(const char*,double ** const, std::string = "");
-  virtual void queryElement(const char*,const element **, std::string = "");
-
-protected:
-  // specialized stuff for text queries
-  class EmptyCommandLineQuery : public Dialog::EmptyQuery {
-  public:
-    EmptyCommandLineQuery(std::string title, std::string _description = "");
-    virtual ~EmptyCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class IntCommandLineQuery : public Dialog::IntQuery {
-  public:
-    IntCommandLineQuery(std::string title, int *_target, std::string _description = "");
-    virtual ~IntCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class BooleanCommandLineQuery : public Dialog::BooleanQuery {
-  public:
-    BooleanCommandLineQuery(std::string title, bool *_target, std::string _description = "");
-    virtual ~BooleanCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class DoubleCommandLineQuery : public Dialog::DoubleQuery {
-  public:
-    DoubleCommandLineQuery(std::string title, double *_target, std::string _description = "");
-    virtual ~DoubleCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class StringCommandLineQuery : public Dialog::StringQuery {
-  public:
-    StringCommandLineQuery(std::string title, std::string *_target, std::string _description = "");
-    virtual ~StringCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class AtomCommandLineQuery : public Dialog::AtomQuery {
-  public:
-    AtomCommandLineQuery(std::string title, atom **_target, std::string _description = "");
-    virtual ~AtomCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class MoleculeCommandLineQuery : public Dialog::MoleculeQuery {
-  public:
-    MoleculeCommandLineQuery(std::string title, molecule **_target, std::string _description = "");
-    virtual ~MoleculeCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class VectorCommandLineQuery : public Dialog::VectorQuery {
-  public:
-    VectorCommandLineQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
-    virtual ~VectorCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class BoxCommandLineQuery : public Dialog::BoxQuery {
-  public:
-    BoxCommandLineQuery(std::string title,double ** const _cellSize, std::string _description = "");
-    virtual ~BoxCommandLineQuery();
-    virtual bool handle();
-  };
-
-  class ElementCommandLineQuery : public Dialog::ElementQuery {
-  public:
-    ElementCommandLineQuery(std::string title, const element **_target, std::string _description = "");
-    virtual ~ElementCommandLineQuery();
-    virtual bool handle();
-  };
-};
-
-#endif /* COMMANDLINEDIALOG_HPP_ */
Index: lecuilder/src/UIElements/CommandLineStatusIndicator.cpp
===================================================================
--- molecuilder/src/UIElements/CommandLineStatusIndicator.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/*
- * CommandLineStatusIndicator.cpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-
-#include "CommandLineStatusIndicator.hpp"
-
-#include <iostream>
-
-#include "Actions/Process.hpp"
-
-using namespace std;
-
-CommandLineStatusIndicator::CommandLineStatusIndicator()
-{
-  Process::AddObserver(this);
-}
-
-CommandLineStatusIndicator::~CommandLineStatusIndicator()
-{
-  Process::RemoveObserver(this);
-}
-
-void CommandLineStatusIndicator::update(Observable *subject){
-  Process *proc;
-  // we are only observing Processes
-  if((proc=dynamic_cast<Process*>(subject))){
-    // see what kind of progress we have to display
-    if(proc->getMaxSteps()>0){
-      if(!proc->doesStop()){
-        cout << "Busy (" << proc->getName() << ") ";
-        // we can show a percentage done
-        cout << (int)proc->getDoneRatio() << "% done" << endl;
-      }
-    }
-    else{
-      // we only show some kind of busy animation
-      if(proc->doesStart()){
-        cout << "Busy (" << proc->getName() << ")";
-      }
-      if(!proc->doesStop()){
-        cout << ".";
-      }
-      else {
-        cout << endl;
-      }
-    }
-  }
-}
-
-void CommandLineStatusIndicator::subjectKilled(Observable *subject){
-
-}
-
Index: lecuilder/src/UIElements/CommandLineStatusIndicator.hpp
===================================================================
--- molecuilder/src/UIElements/CommandLineStatusIndicator.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/*
- * CommandLineStatusIndicator.hpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-#ifndef COMMANDLINESTATUSINDICATOR_HPP_
-#define COMMANDLINESTATUSINDICATOR_HPP_
-
-#include "Patterns/Observer.hpp"
-
-class CommandLineStatusIndicator : public Observer
-{
-public:
-  CommandLineStatusIndicator();
-  virtual ~CommandLineStatusIndicator();
-
-  void update(Observable *subject);
-  void subjectKilled(Observable *subject);
-
-private:
-
-};
-
-#endif /* COMMANDLINESTATUSINDICATOR_HPP_ */
Index: molecuilder/src/UIElements/CommandLineUI/CommandLineDialog.cpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUI/CommandLineDialog.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/CommandLineUI/CommandLineDialog.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,259 @@
+/*
+ * CommandLineDialog.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+
+#include <cassert>
+#include <iostream>
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "CommandLineParser.hpp"
+#include "defs.hpp"
+#include "log.hpp"
+#include "periodentafel.hpp"
+#include "verbose.hpp"
+#include "World.hpp"
+
+#include "atom.hpp"
+#include "element.hpp"
+#include "molecule.hpp"
+#include "vector.hpp"
+
+using namespace std;
+
+
+CommandLineDialog::CommandLineDialog()
+{
+}
+
+CommandLineDialog::~CommandLineDialog()
+{
+}
+
+
+void CommandLineDialog::queryEmpty(const char* title, string _description){
+  registerQuery(new EmptyCommandLineQuery(title, _description));
+}
+
+void CommandLineDialog::queryInt(const char* title, int* target, string _description){
+  registerQuery(new IntCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryBoolean(const char* title, bool* target, string _description){
+  registerQuery(new BooleanCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryDouble(const char* title, double* target, string _description){
+  registerQuery(new DoubleCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryString(const char* title, string* target, string _description){
+  registerQuery(new StringCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryAtom(const char* title, atom **target, string _description) {
+  registerQuery(new AtomCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryMolecule(const char* title, molecule **target, string _description) {
+  registerQuery(new MoleculeCommandLineQuery(title,target, _description));
+}
+
+void CommandLineDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string _description) {
+  registerQuery(new VectorCommandLineQuery(title,target,cellSize,check, _description));
+}
+
+void CommandLineDialog::queryBox(const char* title, double ** const cellSize, string _description) {
+  registerQuery(new BoxCommandLineQuery(title,cellSize,_description));
+}
+
+void CommandLineDialog::queryElement(const char* title, const element **target, string _description){
+  registerQuery(new ElementCommandLineQuery(title,target, _description));
+}
+
+/************************** Query Infrastructure ************************/
+
+CommandLineDialog::EmptyCommandLineQuery::EmptyCommandLineQuery(string title, string _description) :
+    Dialog::EmptyQuery(title, _description)
+{}
+
+CommandLineDialog::EmptyCommandLineQuery::~EmptyCommandLineQuery() {}
+
+bool CommandLineDialog::EmptyCommandLineQuery::handle() {
+  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
+  return true;
+}
+
+CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(string title,int *_target, string _description) :
+    Dialog::IntQuery(title,_target, _description)
+{}
+
+CommandLineDialog::IntCommandLineQuery::~IntCommandLineQuery() {}
+
+bool CommandLineDialog::IntCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title,bool *_target, string _description) :
+    Dialog::BooleanQuery(title,_target, _description)
+{}
+
+CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
+
+bool CommandLineDialog::BooleanCommandLineQuery::handle() {
+  bool badInput = false;
+  char input = ' ';
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> input;
+    if ((input == 'y' ) || (input == 'Y')) {
+      tmp = true;
+    } else if ((input == 'n' ) || (input == 'N')) {
+      tmp = false;
+    } else {
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
+CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title,string *_target, string _description) :
+    Dialog::StringQuery(title,_target, _description)
+{}
+
+CommandLineDialog::StringCommandLineQuery::~StringCommandLineQuery() {}
+
+bool CommandLineDialog::StringCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(string title,double *_target, string _description) :
+    Dialog::DoubleQuery(title,_target, _description)
+{}
+
+CommandLineDialog::DoubleCommandLineQuery::~DoubleCommandLineQuery() {}
+
+bool CommandLineDialog::DoubleCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, atom **_target, string _description) :
+    Dialog::AtomQuery(title,_target, _description)
+{}
+
+CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
+
+bool CommandLineDialog::AtomCommandLineQuery::handle() {
+  int IdxOfAtom = -1;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, molecule **_target, string _description) :
+    Dialog::MoleculeQuery(title,_target, _description)
+{}
+
+CommandLineDialog::MoleculeCommandLineQuery::~MoleculeCommandLineQuery() {}
+
+bool CommandLineDialog::MoleculeCommandLineQuery::handle() {
+  int IdxOfMol = -1;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(string title, Vector *_target, const double *const _cellSize, bool _check, string _description) :
+    Dialog::VectorQuery(title,_target,_cellSize,_check, _description)
+{}
+
+CommandLineDialog::VectorCommandLineQuery::~VectorCommandLineQuery()
+{}
+
+bool CommandLineDialog::VectorCommandLineQuery::handle() {
+  vector<double> temp;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
+    assert((temp.size() == 3) && "Vector from command line does not have three components.");
+    for (int i=0;i<NDIM;i++)
+      tmp->at(i) = temp[i];
+    return true;
+  } else
+    return false;
+}
+
+
+CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, double ** const _cellSize, string _description) :
+    Dialog::BoxQuery(title,_cellSize, _description)
+{}
+
+CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
+{}
+
+bool CommandLineDialog::BoxCommandLineQuery::handle() {
+  vector<double> temp;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temp = CommandLineParser::getInstance().vm[getTitle()].as<vector<double> >();
+    assert((temp.size() == 6) && "Symmetric box matrix from command line does not have six components.");
+    for (int i=0;i<6;i++)
+      tmp[i] = temp[i];
+    return true;
+  } else
+    return false;
+}
+
+CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, const element **target, string _description) :
+    Dialog::ElementQuery(title,target, _description)
+{}
+
+CommandLineDialog::ElementCommandLineQuery::~ElementCommandLineQuery()
+{}
+
+bool CommandLineDialog::ElementCommandLineQuery::handle() {
+  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
+  int Z;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
+    vector<int>::iterator ElementRunner = AllElements.begin();
+    Z = *ElementRunner;
+    // TODO: So far, this does not really erase the element in the parsed list.
+    AllElements.erase(ElementRunner);
+    tmp = World::getInstance().getPeriode()->FindElement(Z);
+    return true;
+  } else
+    return false;
+}
Index: molecuilder/src/UIElements/CommandLineUI/CommandLineDialog.hpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUI/CommandLineDialog.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/CommandLineUI/CommandLineDialog.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,113 @@
+/*
+ * CommandLineDialog.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINEDIALOG_HPP_
+#define COMMANDLINEDIALOG_HPP_
+
+#include <string>
+
+class atom;
+class element;
+class molecule;
+class Vector;
+
+#include "Dialog.hpp"
+
+/** CommandLineUIFactory implementation of the Dialog.
+ * The idea here is that for each query the parsed command line options are used instead.
+ */
+class CommandLineDialog : public Dialog
+{
+public:
+  CommandLineDialog();
+  virtual ~CommandLineDialog();
+
+  virtual void queryEmpty(const char *, std::string = "");
+  virtual void queryInt(const char *, int *, std::string = "");
+  virtual void queryBoolean(const char *, bool *, std::string = "");
+  virtual void queryString(const char*, std::string *, std::string = "");
+  virtual void queryDouble(const char*, double*, std::string = "");
+  virtual void queryAtom(const char*,atom**, std::string = "");
+  virtual void queryMolecule(const char*,molecule**,std::string = "");
+  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
+  virtual void queryBox(const char*,double ** const, std::string = "");
+  virtual void queryElement(const char*,const element **, std::string = "");
+
+protected:
+  // specialized stuff for text queries
+  class EmptyCommandLineQuery : public Dialog::EmptyQuery {
+  public:
+    EmptyCommandLineQuery(std::string title, std::string _description = "");
+    virtual ~EmptyCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class IntCommandLineQuery : public Dialog::IntQuery {
+  public:
+    IntCommandLineQuery(std::string title, int *_target, std::string _description = "");
+    virtual ~IntCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class BooleanCommandLineQuery : public Dialog::BooleanQuery {
+  public:
+    BooleanCommandLineQuery(std::string title, bool *_target, std::string _description = "");
+    virtual ~BooleanCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class DoubleCommandLineQuery : public Dialog::DoubleQuery {
+  public:
+    DoubleCommandLineQuery(std::string title, double *_target, std::string _description = "");
+    virtual ~DoubleCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class StringCommandLineQuery : public Dialog::StringQuery {
+  public:
+    StringCommandLineQuery(std::string title, std::string *_target, std::string _description = "");
+    virtual ~StringCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class AtomCommandLineQuery : public Dialog::AtomQuery {
+  public:
+    AtomCommandLineQuery(std::string title, atom **_target, std::string _description = "");
+    virtual ~AtomCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class MoleculeCommandLineQuery : public Dialog::MoleculeQuery {
+  public:
+    MoleculeCommandLineQuery(std::string title, molecule **_target, std::string _description = "");
+    virtual ~MoleculeCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class VectorCommandLineQuery : public Dialog::VectorQuery {
+  public:
+    VectorCommandLineQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = "");
+    virtual ~VectorCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class BoxCommandLineQuery : public Dialog::BoxQuery {
+  public:
+    BoxCommandLineQuery(std::string title,double ** const _cellSize, std::string _description = "");
+    virtual ~BoxCommandLineQuery();
+    virtual bool handle();
+  };
+
+  class ElementCommandLineQuery : public Dialog::ElementQuery {
+  public:
+    ElementCommandLineQuery(std::string title, const element **_target, std::string _description = "");
+    virtual ~ElementCommandLineQuery();
+    virtual bool handle();
+  };
+};
+
+#endif /* COMMANDLINEDIALOG_HPP_ */
Index: molecuilder/src/UIElements/CommandLineUI/CommandLineStatusIndicator.cpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUI/CommandLineStatusIndicator.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/CommandLineUI/CommandLineStatusIndicator.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,57 @@
+/*
+ * CommandLineStatusIndicator.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+
+#include "CommandLineUI/CommandLineStatusIndicator.hpp"
+
+#include <iostream>
+
+#include "Actions/Process.hpp"
+
+using namespace std;
+
+CommandLineStatusIndicator::CommandLineStatusIndicator()
+{
+  Process::AddObserver(this);
+}
+
+CommandLineStatusIndicator::~CommandLineStatusIndicator()
+{
+  Process::RemoveObserver(this);
+}
+
+void CommandLineStatusIndicator::update(Observable *subject){
+  Process *proc;
+  // we are only observing Processes
+  if((proc=dynamic_cast<Process*>(subject))){
+    // see what kind of progress we have to display
+    if(proc->getMaxSteps()>0){
+      if(!proc->doesStop()){
+        cout << "Busy (" << proc->getName() << ") ";
+        // we can show a percentage done
+        cout << (int)proc->getDoneRatio() << "% done" << endl;
+      }
+    }
+    else{
+      // we only show some kind of busy animation
+      if(proc->doesStart()){
+        cout << "Busy (" << proc->getName() << ")";
+      }
+      if(!proc->doesStop()){
+        cout << ".";
+      }
+      else {
+        cout << endl;
+      }
+    }
+  }
+}
+
+void CommandLineStatusIndicator::subjectKilled(Observable *subject){
+
+}
+
Index: molecuilder/src/UIElements/CommandLineUI/CommandLineStatusIndicator.hpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUI/CommandLineStatusIndicator.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/CommandLineUI/CommandLineStatusIndicator.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,26 @@
+/*
+ * CommandLineStatusIndicator.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINESTATUSINDICATOR_HPP_
+#define COMMANDLINESTATUSINDICATOR_HPP_
+
+#include "Patterns/Observer.hpp"
+
+class CommandLineStatusIndicator : public Observer
+{
+public:
+  CommandLineStatusIndicator();
+  virtual ~CommandLineStatusIndicator();
+
+  void update(Observable *subject);
+  void subjectKilled(Observable *subject);
+
+private:
+
+};
+
+#endif /* COMMANDLINESTATUSINDICATOR_HPP_ */
Index: molecuilder/src/UIElements/CommandLineUI/CommandLineUIFactory.cpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUI/CommandLineUIFactory.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/CommandLineUI/CommandLineUIFactory.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,32 @@
+/*
+ * CommandLineUIFactory.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+
+#include "CommandLineUI/CommandLineUIFactory.hpp"
+#include "CommandLineUI/CommandLineWindow.hpp"
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+
+CommandLineUIFactory::CommandLineUIFactory()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+CommandLineUIFactory::~CommandLineUIFactory()
+{
+  // TODO Auto-generated destructor stub
+}
+
+
+Dialog* CommandLineUIFactory::makeDialog() {
+  return new CommandLineDialog();
+}
+
+MainWindow* CommandLineUIFactory::makeMainWindow() {
+  return new CommandLineWindow();
+}
Index: molecuilder/src/UIElements/CommandLineUI/CommandLineUIFactory.hpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUI/CommandLineUIFactory.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/CommandLineUI/CommandLineUIFactory.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,28 @@
+/*
+ * CommandLineUIFactory.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINEUIFACTORY_HPP_
+#define COMMANDLINEUIFACTORY_HPP_
+
+#include "UIFactory.hpp"
+
+class CommandLineUIFactory : public UIFactory
+{
+friend class UIFactory;
+
+public:
+  virtual ~CommandLineUIFactory();
+
+  virtual Dialog* makeDialog();
+  virtual MainWindow* makeMainWindow();
+
+protected:
+  CommandLineUIFactory();
+};
+
+
+#endif /* COMMANDLINEUIFACTORY_HPP_ */
Index: molecuilder/src/UIElements/CommandLineUI/CommandLineWindow.cpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUI/CommandLineWindow.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/CommandLineUI/CommandLineWindow.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,159 @@
+/*
+ * CommandLineWindow.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#include <boost/bind.hpp>
+
+#include "CommandLineUI/CommandLineWindow.hpp"
+#include "CommandLineUI/CommandLineStatusIndicator.hpp"
+
+#include "Actions/ActionRegistry.hpp"
+#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
+#include "Actions/AnalysisAction/PairCorrelationToPointAction.hpp"
+#include "Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp"
+#include "Actions/AtomAction/AddAction.hpp"
+#include "Actions/AtomAction/ChangeElementAction.hpp"
+#include "Actions/AtomAction/RemoveAction.hpp"
+#include "Actions/CmdAction/BondLengthTableAction.hpp"
+#include "Actions/CmdAction/ElementDbAction.hpp"
+#include "Actions/CmdAction/FastParsingAction.hpp"
+#include "Actions/CmdAction/HelpAction.hpp"
+#include "Actions/CmdAction/VerboseAction.hpp"
+#include "Actions/CmdAction/VersionAction.hpp"
+#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
+#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
+#include "Actions/MoleculeAction/BondFileAction.hpp"
+#include "Actions/MoleculeAction/ChangeNameAction.hpp"
+#include "Actions/MoleculeAction/FillWithMoleculeAction.hpp"
+#include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp"
+#include "Actions/MoleculeAction/SaveAdjacencyAction.hpp"
+#include "Actions/MoleculeAction/SaveBondsAction.hpp"
+#include "Actions/MoleculeAction/SaveTemperatureAction.hpp"
+#include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
+#include "Actions/ParserAction/LoadXyzAction.hpp"
+#include "Actions/ParserAction/SaveXyzAction.hpp"
+#include "Actions/TesselationAction/ConvexEnvelopeAction.hpp"
+#include "Actions/TesselationAction/NonConvexEnvelopeAction.hpp"
+#include "Actions/WorldAction/AddEmptyBoundaryAction.hpp"
+#include "Actions/WorldAction/BoundInBoxAction.hpp"
+#include "Actions/WorldAction/CenterInBoxAction.hpp"
+#include "Actions/WorldAction/CenterOnEdgeAction.hpp"
+#include "Actions/WorldAction/ChangeBoxAction.hpp"
+#include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
+#include "Actions/WorldAction/RepeatBoxAction.hpp"
+#include "Actions/WorldAction/ScaleBoxAction.hpp"
+#include "Actions/WorldAction/SetDefaultNameAction.hpp"
+#include "Actions/WorldAction/SetGaussianBasisAction.hpp"
+#include "CommandLineParser.hpp"
+
+#include <iostream>
+
+using namespace std;
+
+// TODO: see what code can be moved to a base class for Graphic and CommandLine Windows
+CommandLineWindow::CommandLineWindow()
+{
+  // create and register all command line callable actions
+  populateAnalysisActions();
+  populateAtomActions();
+  populateCmdActions();
+  populateFragmentationActions();
+  populateMoleculeActions();
+  populateParserActions();
+  populateTesselationActions();
+  populateWorldActions();
+
+  // Add status indicators etc...
+  statusIndicator = new CommandLineStatusIndicator();
+}
+
+CommandLineWindow::~CommandLineWindow()
+{
+//  // go through all possible actions
+//  for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRegistry::getInstance().getBeginIter() != ActionRegistry::getInstance().getEndIter(); ActionRunner = ActionRegistry::getInstance().getBeginIter()) {
+//    ActionRegistry::getInstance().unregisterAction(ActionRunner->second);
+//    delete(ActionRunner->second);
+//  }
+
+  delete statusIndicator;
+}
+
+void CommandLineWindow::display() {
+  // go through all possible actions
+  for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRunner != ActionRegistry::getInstance().getEndIter(); ActionRunner++) {
+    // check whether action is present in command line
+    if (CommandLineParser::getInstance().vm.count(ActionRunner->first)) {
+      ActionRunner->second->call();
+    }
+  }
+}
+
+void CommandLineWindow::populateAnalysisActions()
+{
+  new AnalysisPairCorrelationAction();
+  new AnalysisPairCorrelationToPointAction();
+  new AnalysisPairCorrelationToSurfaceAction();
+}
+
+void CommandLineWindow::populateAtomActions()
+{
+  new AtomAddAction();
+  new AtomChangeElementAction();
+  new AtomRemoveAction();
+}
+
+void CommandLineWindow::populateCmdActions()
+{
+  new CommandLineBondLengthTableAction();
+  new CommandLineElementDbAction();
+  new CommandLineFastParsingAction();
+  new CommandLineHelpAction();
+  new CommandLineVerboseAction();
+  new CommandLineVersionAction();
+}
+
+void CommandLineWindow::populateFragmentationActions()
+{
+  new FragmentationDepthFirstSearchAction();
+}
+
+void CommandLineWindow::populateMoleculeActions()
+{
+  new MoleculeBondFileAction();
+  new MoleculeChangeNameAction();
+  new MoleculeFillWithMoleculeAction();
+  new MoleculeLinearInterpolationofTrajectoriesAction();
+  new MoleculeSaveAdjacencyAction();
+  new MoleculeSaveBondsAction();
+  new MoleculeSaveTemperatureAction();
+  new MoleculeVerletIntegrationAction();
+}
+
+void CommandLineWindow::populateParserActions()
+{
+  new ParserLoadXyzAction();
+  new ParserSaveXyzAction();
+}
+
+void CommandLineWindow::populateTesselationActions()
+{
+  new TesselationConvexEnvelopeAction();
+  new TesselationNonConvexEnvelopeAction();
+}
+
+void CommandLineWindow::populateWorldActions()
+{
+  new WorldAddEmptyBoundaryAction();
+  new WorldBoundInBoxAction();
+  new WorldCenterInBoxAction();
+  new WorldCenterOnEdgeAction();
+  new WorldChangeBoxAction();
+  new WorldRemoveSphereOfAtomsAction();
+  new WorldRepeatBoxAction();
+  new WorldScaleBoxAction();
+  new WorldSetDefaultNameAction();
+  new WorldSetGaussianBasisAction();
+}
Index: molecuilder/src/UIElements/CommandLineUI/CommandLineWindow.hpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUI/CommandLineWindow.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/CommandLineUI/CommandLineWindow.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,38 @@
+/*
+ * CommandLineWindow.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINEWINDOW_HPP_
+#define COMMANDLINEWINDOW_HPP_
+
+#include "MainWindow.hpp"
+
+class CommandLineStatusIndicator;
+
+class CommandLineWindow : public MainWindow
+{
+public:
+  CommandLineWindow();
+  virtual ~CommandLineWindow();
+
+  virtual void display();
+
+private:
+  // populaters
+  void populateAnalysisActions();
+  void populateAtomActions();
+  void populateCmdActions();
+  void populateFragmentationActions();
+  void populateMoleculeActions();
+  void populateParserActions();
+  void populateTesselationActions();
+  void populateWorldActions();
+
+  CommandLineStatusIndicator *statusIndicator;
+
+};
+
+#endif /* COMMANDLINEWINDOW_HPP_ */
Index: lecuilder/src/UIElements/CommandLineUIFactory.cpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUIFactory.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,32 +1,0 @@
-/*
- * CommandLineUIFactory.cpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-
-#include "UIElements/CommandLineUIFactory.hpp"
-#include "UIElements/CommandLineWindow.hpp"
-#include "UIElements/CommandLineDialog.hpp"
-
-
-CommandLineUIFactory::CommandLineUIFactory()
-{
-  // TODO Auto-generated constructor stub
-
-}
-
-CommandLineUIFactory::~CommandLineUIFactory()
-{
-  // TODO Auto-generated destructor stub
-}
-
-
-Dialog* CommandLineUIFactory::makeDialog() {
-  return new CommandLineDialog();
-}
-
-MainWindow* CommandLineUIFactory::makeMainWindow() {
-  return new CommandLineWindow();
-}
Index: lecuilder/src/UIElements/CommandLineUIFactory.hpp
===================================================================
--- molecuilder/src/UIElements/CommandLineUIFactory.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/*
- * CommandLineUIFactory.hpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-#ifndef COMMANDLINEUIFACTORY_HPP_
-#define COMMANDLINEUIFACTORY_HPP_
-
-#include "UIElements/UIFactory.hpp"
-
-class CommandLineUIFactory : public UIFactory
-{
-friend class UIFactory;
-
-public:
-  virtual ~CommandLineUIFactory();
-
-  virtual Dialog* makeDialog();
-  virtual MainWindow* makeMainWindow();
-
-protected:
-  CommandLineUIFactory();
-};
-
-
-#endif /* COMMANDLINEUIFACTORY_HPP_ */
Index: lecuilder/src/UIElements/CommandLineWindow.cpp
===================================================================
--- molecuilder/src/UIElements/CommandLineWindow.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,159 +1,0 @@
-/*
- * CommandLineWindow.cpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-#include <boost/bind.hpp>
-
-#include "UIElements/CommandLineWindow.hpp"
-#include "UIElements/CommandLineStatusIndicator.hpp"
-
-#include "Actions/ActionRegistry.hpp"
-#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
-#include "Actions/AnalysisAction/PairCorrelationToPointAction.hpp"
-#include "Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp"
-#include "Actions/AtomAction/AddAction.hpp"
-#include "Actions/AtomAction/ChangeElementAction.hpp"
-#include "Actions/AtomAction/RemoveAction.hpp"
-#include "Actions/CmdAction/BondLengthTableAction.hpp"
-#include "Actions/CmdAction/ElementDbAction.hpp"
-#include "Actions/CmdAction/FastParsingAction.hpp"
-#include "Actions/CmdAction/HelpAction.hpp"
-#include "Actions/CmdAction/VerboseAction.hpp"
-#include "Actions/CmdAction/VersionAction.hpp"
-#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
-#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
-#include "Actions/MoleculeAction/BondFileAction.hpp"
-#include "Actions/MoleculeAction/ChangeNameAction.hpp"
-#include "Actions/MoleculeAction/FillWithMoleculeAction.hpp"
-#include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp"
-#include "Actions/MoleculeAction/SaveAdjacencyAction.hpp"
-#include "Actions/MoleculeAction/SaveBondsAction.hpp"
-#include "Actions/MoleculeAction/SaveTemperatureAction.hpp"
-#include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
-#include "Actions/ParserAction/LoadXyzAction.hpp"
-#include "Actions/ParserAction/SaveXyzAction.hpp"
-#include "Actions/TesselationAction/ConvexEnvelopeAction.hpp"
-#include "Actions/TesselationAction/NonConvexEnvelopeAction.hpp"
-#include "Actions/WorldAction/AddEmptyBoundaryAction.hpp"
-#include "Actions/WorldAction/BoundInBoxAction.hpp"
-#include "Actions/WorldAction/CenterInBoxAction.hpp"
-#include "Actions/WorldAction/CenterOnEdgeAction.hpp"
-#include "Actions/WorldAction/ChangeBoxAction.hpp"
-#include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
-#include "Actions/WorldAction/RepeatBoxAction.hpp"
-#include "Actions/WorldAction/ScaleBoxAction.hpp"
-#include "Actions/WorldAction/SetDefaultNameAction.hpp"
-#include "Actions/WorldAction/SetGaussianBasisAction.hpp"
-#include "CommandLineParser.hpp"
-
-#include <iostream>
-
-using namespace std;
-
-// TODO: see what code can be moved to a base class for Graphic and CommandLine Windows
-CommandLineWindow::CommandLineWindow()
-{
-  // create and register all command line callable actions
-  populateAnalysisActions();
-  populateAtomActions();
-  populateCmdActions();
-  populateFragmentationActions();
-  populateMoleculeActions();
-  populateParserActions();
-  populateTesselationActions();
-  populateWorldActions();
-
-  // Add status indicators etc...
-  statusIndicator = new CommandLineStatusIndicator();
-}
-
-CommandLineWindow::~CommandLineWindow()
-{
-  // go through all possible actions
-  for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRegistry::getInstance().getBeginIter() != ActionRegistry::getInstance().getEndIter(); ActionRunner = ActionRegistry::getInstance().getBeginIter()) {
-    ActionRegistry::getInstance().unregisterAction(ActionRunner->second);
-    delete(ActionRunner->second);
-  }
-
-  delete statusIndicator;
-}
-
-void CommandLineWindow::display() {
-  // go through all possible actions
-  for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRunner != ActionRegistry::getInstance().getEndIter(); ActionRunner++) {
-    // check whether action is present in command line
-    if (CommandLineParser::getInstance().vm.count(ActionRunner->first)) {
-      ActionRunner->second->call();
-    }
-  }
-}
-
-void CommandLineWindow::populateAnalysisActions()
-{
-  new AnalysisPairCorrelationAction();
-  new AnalysisPairCorrelationToPointAction();
-  new AnalysisPairCorrelationToSurfaceAction();
-}
-
-void CommandLineWindow::populateAtomActions()
-{
-  new AtomAddAction();
-  new AtomChangeElementAction();
-  new AtomRemoveAction();
-}
-
-void CommandLineWindow::populateCmdActions()
-{
-  new CommandLineBondLengthTableAction();
-  new CommandLineElementDbAction();
-  new CommandLineFastParsingAction();
-  new CommandLineHelpAction();
-  new CommandLineVerboseAction();
-  new CommandLineVersionAction();
-}
-
-void CommandLineWindow::populateFragmentationActions()
-{
-  new FragmentationDepthFirstSearchAction();
-}
-
-void CommandLineWindow::populateMoleculeActions()
-{
-  new MoleculeBondFileAction();
-  new MoleculeChangeNameAction();
-  new MoleculeFillWithMoleculeAction();
-  new MoleculeLinearInterpolationofTrajectoriesAction();
-  new MoleculeSaveAdjacencyAction();
-  new MoleculeSaveBondsAction();
-  new MoleculeSaveTemperatureAction();
-  new MoleculeVerletIntegrationAction();
-}
-
-void CommandLineWindow::populateParserActions()
-{
-  new ParserLoadXyzAction();
-  new ParserSaveXyzAction();
-}
-
-void CommandLineWindow::populateTesselationActions()
-{
-  new TesselationConvexEnvelopeAction();
-  new TesselationNonConvexEnvelopeAction();
-}
-
-void CommandLineWindow::populateWorldActions()
-{
-  new WorldAddEmptyBoundaryAction();
-  new WorldBoundInBoxAction();
-  new WorldCenterInBoxAction();
-  new WorldCenterOnEdgeAction();
-  new WorldChangeBoxAction();
-  new WorldRemoveSphereOfAtomsAction();
-  new WorldRepeatBoxAction();
-  new WorldScaleBoxAction();
-  new WorldSetDefaultNameAction();
-  new WorldSetGaussianBasisAction();
-}
Index: lecuilder/src/UIElements/CommandLineWindow.hpp
===================================================================
--- molecuilder/src/UIElements/CommandLineWindow.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,38 +1,0 @@
-/*
- * CommandLineWindow.hpp
- *
- *  Created on: May 8, 2010
- *      Author: heber
- */
-
-#ifndef COMMANDLINEWINDOW_HPP_
-#define COMMANDLINEWINDOW_HPP_
-
-#include "UIElements/MainWindow.hpp"
-
-class CommandLineStatusIndicator;
-
-class CommandLineWindow : public MainWindow
-{
-public:
-  CommandLineWindow();
-  virtual ~CommandLineWindow();
-
-  virtual void display();
-
-private:
-  // populaters
-  void populateAnalysisActions();
-  void populateAtomActions();
-  void populateCmdActions();
-  void populateFragmentationActions();
-  void populateMoleculeActions();
-  void populateParserActions();
-  void populateTesselationActions();
-  void populateWorldActions();
-
-  CommandLineStatusIndicator *statusIndicator;
-
-};
-
-#endif /* COMMANDLINEWINDOW_HPP_ */
Index: molecuilder/src/UIElements/Dialog.cpp
===================================================================
--- molecuilder/src/UIElements/Dialog.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/UIElements/Dialog.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -8,5 +8,5 @@
 #include <cassert>
 
-#include "UIElements/Dialog.hpp"
+#include "Dialog.hpp"
 
 #include "atom.hpp"
Index: molecuilder/src/UIElements/MainWindow.cpp
===================================================================
--- molecuilder/src/UIElements/MainWindow.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/UIElements/MainWindow.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -6,5 +6,5 @@
  */
 
-#include "UIElements/MainWindow.hpp"
+#include "MainWindow.hpp"
 
 MainWindow::MainWindow()
Index: molecuilder/src/UIElements/Makefile.am
===================================================================
--- molecuilder/src/UIElements/Makefile.am	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Makefile.am	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,82 @@
+# Below is all for the User Interface
+
+INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/UIElements
+
+AM_LDFLAGS = $(CPPUNIT_LIBS) -ldl
+AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
+
+noinst_LIBRARIES = libMolecuilderUI.a
+libMolecuilderUI_a_SOURCES = ${UISOURCE} ${UIHEADER}
+
+VIEWSOURCE = \
+  Views/View.cpp \
+  Views/StringView.cpp \
+  Views/MethodStringView.cpp \
+  Views/StreamStringView.cpp
+VIEWHEADER = \
+  Views/View.hpp \
+  Views/StringView.hpp \
+  Views/MethodStringView.hpp \
+  Views/StreamStringView.hpp
+
+MENUSOURCE = \
+  Menu/Menu.cpp \
+  Menu/TextMenu.cpp \
+  Menu/MenuItem.cpp \
+  Menu/SubMenuItem.cpp \
+  Menu/ActionMenuItem.cpp \
+  Menu/SeperatorItem.cpp \
+  Menu/DisplayMenuItem.cpp
+  
+MENUHEADER = \
+  Menu/Menu.hpp \
+  Menu/TextMenu.hpp \
+  Menu/MenuItem.hpp \
+  Menu/SubMenuItem.hpp \
+  Menu/ActionMenuItem.hpp \
+  Menu/SeperatorItem.hpp \
+  Menu/DisplayMenuItem.hpp
+
+UISOURCE = \
+  ${ACTIONSSOURCE} \
+  ${COMMANDLINEUISOURCE} \
+  ${MENUSOURCE} \
+  ${TEXTUISOURCE} \
+  ${VIEWSOURCE} \
+  Dialog.cpp \
+  MainWindow.cpp \
+  UIFactory.cpp
+  
+UIHEADER = \
+  ${ACTIONSHEADER} \
+  ${COMMANDLINEUIHEADER} \
+  ${MENUHEADER} \
+  ${TEXTUIHEADER} \
+  ${VIEWHEADER} \
+  Dialog.hpp \
+  MainWindow.hpp \
+  UIFactory.hpp
+
+TEXTUISOURCE = \
+  TextUI/TextDialog.cpp \
+  TextUI/TextStatusIndicator.cpp \
+  TextUI/TextUIFactory.cpp \
+  TextUI/TextWindow.cpp
+TEXTUIHEADER = \
+  TextUI/TextDialog.hpp \
+  TextUI/TextStatusIndicator.hpp \
+  TextUI/TextUIFactory.hpp \
+  TextUI/TextWindow.hpp
+
+COMMANDLINEUISOURCE = \
+  CommandLineUI/CommandLineDialog.cpp \
+  CommandLineUI/CommandLineStatusIndicator.cpp \
+  CommandLineUI/CommandLineUIFactory.cpp \
+  CommandLineUI/CommandLineWindow.cpp
+COMMANDLINEUIHEADER = \
+  CommandLineUI/CommandLineDialog.hpp \
+  CommandLineUI/CommandLineStatusIndicator.hpp \
+  CommandLineUI/CommandLineUIFactory.hpp \
+  CommandLineUI/CommandLineWindow.hpp
+
+
Index: molecuilder/src/UIElements/Menu/ActionMenuItem.cpp
===================================================================
--- molecuilder/src/UIElements/Menu/ActionMenuItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/ActionMenuItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,30 @@
+/*
+ * ActionMenuItem.cpp
+ *
+ *  Created on: Dec 11, 2009
+ *      Author: crueger
+ */
+
+#include <iostream>
+
+#include "Menu/ActionMenuItem.hpp"
+#include "Actions/MethodAction.hpp"
+
+using namespace std;
+
+ActionMenuItem::ActionMenuItem(char _trigger, const char* _description,Menu* _menu,Action* _action)
+: MenuItem(_trigger,_description,_menu),
+  action(_action)
+{
+}
+
+ActionMenuItem::~ActionMenuItem()
+{}
+
+void ActionMenuItem::doTrigger() {
+  action->call();
+}
+
+bool ActionMenuItem::isActive() {
+  return action->isActive();
+}
Index: molecuilder/src/UIElements/Menu/ActionMenuItem.hpp
===================================================================
--- molecuilder/src/UIElements/Menu/ActionMenuItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/ActionMenuItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,34 @@
+/*
+ * ActionMenuItem.h
+ *
+ *  Created on: Dec 11, 2009
+ *      Author: crueger
+ */
+
+#ifndef ACTIONMENUITEM_H_
+#define ACTIONMENUITEM_H_
+
+#include <string>
+
+#include "Menu/MenuItem.hpp"
+
+class Action;
+
+/**
+ * Produce MenuItems that take an appropriate action when called.
+ */
+class ActionMenuItem : public MenuItem
+{
+public:
+  ActionMenuItem(char,const char*,Menu*,Action*);
+  virtual ~ActionMenuItem();
+
+  virtual void doTrigger();
+
+  virtual bool isActive();
+
+private:
+  Action* action; //!< this action will be called when the trigger matches
+};
+
+#endif /* ACTIONMENUITEM_H_ */
Index: molecuilder/src/UIElements/Menu/DisplayMenuItem.cpp
===================================================================
--- molecuilder/src/UIElements/Menu/DisplayMenuItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/DisplayMenuItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,59 @@
+/*
+ * DisplayMenuItem.cpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#include <sstream>
+#include <cmath>
+
+#include "Menu/DisplayMenuItem.hpp"
+#include "Views/StringView.hpp"
+
+
+DisplayMenuItem::DisplayMenuItem(Menu* _menu, StringView *_view):
+MenuItem('\0',"",_menu),
+view(_view),
+title("")
+{
+}
+
+DisplayMenuItem::DisplayMenuItem(Menu* _menu, StringView *_view, string _title, char _spacer, int _length ):
+  MenuItem('\0',"",_menu),
+  view(_view),
+  title(_title),
+  length(_length),
+  spacer(_spacer)
+{
+}
+
+DisplayMenuItem::~DisplayMenuItem()
+{}
+
+
+void DisplayMenuItem::doTrigger(){}
+bool DisplayMenuItem::checkTrigger(char c){
+  return false;
+}
+
+const string DisplayMenuItem::formatEntry(){
+  stringstream s;
+  if(title.length()>0) {
+    int pre = floor((length-title.length())/2.0);
+    int post = ceil((length-title.length())/2.0);
+    for(int i=0;i<pre;i++)
+      s << spacer;
+    s << title;
+    for(int i=0;i<post;i++)
+          s << spacer;
+    s << "\n";
+  }
+  s << view->toString();
+  return s.str();
+}
+
+
+const string DisplayMenuItem::getDescription(){
+  return string("");
+}
Index: molecuilder/src/UIElements/Menu/DisplayMenuItem.hpp
===================================================================
--- molecuilder/src/UIElements/Menu/DisplayMenuItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/DisplayMenuItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,43 @@
+/*
+ * DisplayMenuItem.hpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#ifndef DISPLAYMENUITEM_HPP_
+#define DISPLAYMENUITEM_HPP_
+
+#include "Menu/MenuItem.hpp"
+#include "defs.hpp"
+
+class StringView;
+
+/**
+ * Display any kind of StringView within a Menu
+ *
+ * Any trigger are ignored for this type of Item
+ */
+class DisplayMenuItem : public MenuItem
+{
+public:
+  DisplayMenuItem(Menu* _menu, StringView *_view);
+  DisplayMenuItem(Menu* _menu, StringView *_view, string _title,
+                  char _spacer=STD_MENU_TITLE_SPACER, int _length=STD_MENU_LENGTH);
+  virtual ~DisplayMenuItem();
+
+  virtual void doTrigger();
+  virtual bool checkTrigger(char);
+
+  virtual const string formatEntry();
+
+  virtual const string getDescription();
+
+private:
+  StringView *view;
+  string title;
+  int length;
+  char spacer;
+};
+
+#endif /* DISPLAYMENUITEM_HPP_ */
Index: molecuilder/src/UIElements/Menu/Menu.cpp
===================================================================
--- molecuilder/src/UIElements/Menu/Menu.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/Menu.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,19 @@
+/*
+ * Menu.cpp
+ *
+ *  Created on: Dec 10, 2009
+ *      Author: crueger
+ */
+
+#include "Menu.hpp"
+
+Menu::Menu()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+Menu::~Menu()
+{
+  // TODO Auto-generated destructor stub
+}
Index: molecuilder/src/UIElements/Menu/Menu.hpp
===================================================================
--- molecuilder/src/UIElements/Menu/Menu.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/Menu.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,41 @@
+/*
+ * Menu.h
+ *
+ *  Created on: Dec 10, 2009
+ *      Author: crueger
+ */
+
+#ifndef MENU_MENU_H_
+#define MENU_MENU_H_
+
+using namespace std;
+
+class MenuItem;
+
+/**
+ * Base class for all Types of menus
+ * contains basic abstract functionality to add Items, remove Items and display the menu
+ *
+ * TODO: Make sure all items are only added once.
+ */
+class Menu
+{
+public:
+  Menu();
+  virtual ~Menu();
+
+
+  /**
+   * Adding and removing should be handled by the items.
+   */
+  virtual void addItem(MenuItem*)=0;
+  /**
+   * Adding and removing should be handled by the items.
+   */
+  virtual void removeItem(MenuItem*)=0;
+  virtual void display()=0;
+
+private:
+};
+
+#endif /* MENU_H_ */
Index: molecuilder/src/UIElements/Menu/MenuItem.cpp
===================================================================
--- molecuilder/src/UIElements/Menu/MenuItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/MenuItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,83 @@
+/*
+ * MenuItem.cpp
+ *
+ *  Created on: Dec 10, 2009
+ *      Author: crueger
+ */
+
+
+
+#include "Menu/MenuItem.hpp"
+#include "Menu/Menu.hpp"
+#include <sstream>
+#include <iostream>
+
+/**
+ * produce a new MenuItem using with a description and a trigger.
+ * The MenuItem is then added to the menu passed to it.
+ */
+MenuItem::MenuItem(char _trigger, const char* _description,Menu* menu) :
+trigger(_trigger),
+added(false)
+{
+  description = new string(_description);
+  add_to_menu(menu);
+}
+
+MenuItem::~MenuItem()
+{
+  delete description;
+}
+
+/**
+ * check if the trigger matches and call doTrigger if it does.
+ */
+bool MenuItem::checkTrigger(char key) {
+  if(key == trigger) {
+    doTrigger();
+    return true;
+  }
+  else
+    return false;
+
+}
+
+char MenuItem::getTrigger() {
+  return trigger;
+}
+
+const string MenuItem::getDescription() {
+  return *description;
+}
+
+/**
+ * Produce a formated output of this item containing trigger and description
+ * Normal format is: "<trigger> - <description>"
+ */
+const string MenuItem::formatEntry(){
+  stringstream s;
+  s << getTrigger() << " - " << getDescription();
+
+  return s.str();
+}
+
+
+/**
+ * check if this item is within a menu and add to menu if it is not yet contained anywhere
+ *
+ * TODO: include funtionality to move Items from one menu to another
+ */
+void MenuItem::add_to_menu(Menu* menu) {
+  if(!wasAdded()) {
+    menu->addItem(this);
+    added=true;
+  }
+}
+
+bool MenuItem::wasAdded(){
+  return added;
+}
+
+bool MenuItem::isActive(){
+  return true;
+}
Index: molecuilder/src/UIElements/Menu/MenuItem.hpp
===================================================================
--- molecuilder/src/UIElements/Menu/MenuItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/MenuItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,49 @@
+/*
+ * MenuItem.h
+ *
+ *  Created on: Dec 10, 2009
+ *      Author: crueger
+ */
+
+#ifndef MENUITEM_H_
+#define MENUITEM_H_
+
+#include <string>
+
+using namespace std;
+
+class Menu;
+
+/**
+ * Base class for all kinds of MenuItems
+ *
+ * This class takes care of checking the triggers and performing appropriate actions.
+ */
+class MenuItem {
+public:
+  MenuItem(char,const char*,Menu*);
+  virtual ~MenuItem();
+
+  virtual void doTrigger()=0;
+  virtual bool checkTrigger(char);
+
+  virtual const string formatEntry();
+
+  virtual const string getDescription();
+  char getTrigger();
+
+  void add_to_menu(Menu*);
+  bool wasAdded();
+
+  virtual bool isActive();
+
+protected:
+  void setDescription(string);
+
+private:
+  char trigger;
+  string *description;
+  bool added;
+};
+
+#endif /* MENUITEM_H_ */
Index: molecuilder/src/UIElements/Menu/SeperatorItem.cpp
===================================================================
--- molecuilder/src/UIElements/Menu/SeperatorItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/SeperatorItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,53 @@
+/*
+ * SeperatorItem.cpp
+ *
+ *  Created on: Dec 11, 2009
+ *      Author: crueger
+ */
+#include <string>
+#include <sstream>
+
+#include "Menu/SeperatorItem.hpp"
+#include "Menu/Menu.hpp"
+#include "defs.hpp"
+
+
+SeperatorItem::SeperatorItem(Menu* menu):
+MenuItem('\0',"",menu),
+spacer(STD_SEPERATOR_SPACER),
+length(STD_MENU_LENGTH)
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+SeperatorItem::SeperatorItem(Menu* menu,char _spacer, int _length):
+MenuItem('\0',"",menu),
+spacer(_spacer),
+length(_length)
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+SeperatorItem::~SeperatorItem()
+{
+  // TODO Auto-generated destructor stub
+}
+
+
+void SeperatorItem::doTrigger(){}
+bool SeperatorItem::checkTrigger(char){
+  return false;
+}
+
+const string SeperatorItem::getDescription() {
+  return string("");
+}
+
+const string SeperatorItem::formatEntry(){
+  stringstream s;
+  for(int i=0; i<length;i++)
+    s << spacer;
+  return s.str();
+}
Index: molecuilder/src/UIElements/Menu/SeperatorItem.hpp
===================================================================
--- molecuilder/src/UIElements/Menu/SeperatorItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/SeperatorItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,36 @@
+/*
+ * SeperatorItem.h
+ *
+ *  Created on: Dec 11, 2009
+ *      Author: crueger
+ */
+
+#ifndef SEPERATORITEM_H_
+#define SEPERATORITEM_H_
+
+#include "Menu/MenuItem.hpp"
+
+/**
+ * Produce a Seperator within a Menu.
+ *
+ * All triggers are ignored for this Item.
+ */
+class SeperatorItem : public MenuItem
+{
+public:
+  SeperatorItem(Menu*);
+  SeperatorItem(Menu*,char,int);
+  virtual ~SeperatorItem();
+
+  virtual void doTrigger();
+  virtual bool checkTrigger(char);
+
+  virtual const string getDescription();
+
+  virtual const string formatEntry();
+private:
+  char spacer;
+  int length;
+};
+
+#endif /* SEPERATORITEM_H_ */
Index: molecuilder/src/UIElements/Menu/SubMenuItem.cpp
===================================================================
--- molecuilder/src/UIElements/Menu/SubMenuItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/SubMenuItem.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,23 @@
+/*
+ * SubMenuItem.cpp
+ *
+ *  Created on: Dec 10, 2009
+ *      Author: crueger
+ */
+
+#include "SubMenuItem.hpp"
+
+SubMenuItem::SubMenuItem(char _trigger,const char* _description,Menu* _parent, Menu* _theMenu) :
+MenuItem(_trigger,_description,_parent),
+theMenu(_theMenu)
+{
+}
+
+SubMenuItem::~SubMenuItem()
+{
+  delete theMenu;
+}
+
+void SubMenuItem::doTrigger() {
+  theMenu->display();
+}
Index: molecuilder/src/UIElements/Menu/SubMenuItem.hpp
===================================================================
--- molecuilder/src/UIElements/Menu/SubMenuItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/SubMenuItem.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,20 @@
+#ifndef SUBMENUITEM_H_
+#define SUBMENUITEM_H_
+
+#include "MenuItem.hpp"
+#include "TextMenu.hpp"
+
+class Menu;
+
+class SubMenuItem : public MenuItem
+{
+public:
+  SubMenuItem(char,const char*,Menu*,Menu*);
+  virtual ~SubMenuItem();
+
+  virtual void doTrigger();
+private:
+  Menu* theMenu;
+};
+
+#endif /* SUBMENUITEM_H_ */
Index: molecuilder/src/UIElements/Menu/TextMenu.cpp
===================================================================
--- molecuilder/src/UIElements/Menu/TextMenu.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/TextMenu.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,141 @@
+/*
+ * TextMenu.cpp
+ *
+ *  Created on: Dec 10, 2009
+ *      Author: crueger
+ */
+
+#include <boost/bind.hpp>
+#include <iostream>
+#include <cmath>
+#include "Menu/TextMenu.hpp"
+#include "Menu/MenuItem.hpp"
+#include "Helpers/Assert.hpp"
+
+
+/**
+ * produce a text menu with a given title.
+ * The text will later be displayed using the stream passed to the constructor.
+ */
+TextMenu::TextMenu(ostream& _outputter, string _title, char _spacer,int _length) :
+  defaultItem(0),
+  outputter(_outputter),
+  title(_title),
+  spacer(_spacer),
+  length(_length),
+  quit(false)
+{
+}
+
+TextMenu::~TextMenu()
+{
+  for(list<MenuItem*>::iterator it=items.begin(); it != items.end(); it++)
+    delete (*it);
+}
+
+
+void TextMenu::addItem(MenuItem* item) {
+  items.push_back(item);
+}
+
+void TextMenu::removeItem(MenuItem* item) {
+  items.remove(item);
+}
+
+void TextMenu::doQuit(){
+  quit = true;
+}
+
+bool TextMenu::hasQuit(){
+  return quit;
+}
+
+void TextMenu::showEntry(MenuItem* entry){
+  if(entry->isActive()==false){
+    outputter << "(";
+  }
+  outputter << entry->formatEntry();
+  if(entry->isActive()==false){
+    outputter << ")";
+  }
+  outputter << "\n";
+}
+
+void TextMenu::display() {
+  char choice;
+  bool somethingChosen = false;
+  quit = false;
+  do {
+    int pre = floor((length - title.length()) /2.0);
+    int post = ceil((length - title.length()) /2.0);
+    for(int i=0;i<pre;i++)
+      outputter << spacer;
+    outputter << title;
+    for(int i=0;i<post;i++)
+          outputter << spacer;
+    outputter << '\n';
+    for_each(items.begin(), items.end(), boost::bind(&TextMenu::showEntry,this,_1));
+    outputter.flush();
+
+    cin >> choice;
+
+    list<MenuItem*>::iterator iter;
+    for(iter = items.begin(); iter!=items.end();iter++){
+      if((*iter)->isActive()){
+        somethingChosen |= (*iter)->checkTrigger(choice);
+      }
+    }
+    // see if something was chosen and call default Item if not
+    if(!somethingChosen) {
+      if(defaultItem){
+        defaultItem->doTrigger();
+      }
+      else{
+        outputter << "Invalid Choice!" <<  endl;
+      }
+    }
+  }while (!hasQuit());
+}
+
+string TextMenu::getTitle(){
+  return title;
+}
+
+void TextMenu::addDefault(MenuItem* _defaultItem) {
+  defaultItem = _defaultItem;
+}
+
+/****************************** Contained Actions ****************/
+
+const string TextMenu::LeaveAction::nameBase = "Leave menu: ";
+
+TextMenu::LeaveAction::LeaveAction(TextMenu* _menu) :
+Action(nameBase+_menu->getTitle()),
+menu(_menu)
+{}
+
+TextMenu::LeaveAction::~LeaveAction(){}
+
+bool TextMenu::LeaveAction::canUndo(){
+  return false;
+}
+
+bool TextMenu::LeaveAction::shouldUndo(){
+  return false;
+}
+
+Action::state_ptr TextMenu::LeaveAction::performCall(){
+  menu->doQuit();
+  return Action::success;
+}
+
+
+Action::state_ptr TextMenu::LeaveAction::performUndo(Action::state_ptr){
+  ASSERT(0,"Cannot undo leaving a menu");
+  return Action::success;
+}
+
+Action::state_ptr TextMenu::LeaveAction::performRedo(Action::state_ptr){
+  ASSERT(0,"Cannot redo leaving a menu");
+  return Action::success;
+}
Index: molecuilder/src/UIElements/Menu/TextMenu.hpp
===================================================================
--- molecuilder/src/UIElements/Menu/TextMenu.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Menu/TextMenu.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,82 @@
+/*
+ * TextMenu.h
+ *
+ *  Created on: Dec 10, 2009
+ *      Author: crueger
+ */
+
+#ifndef TEXTMENU_H_
+#define TEXTMENU_H_
+
+#include <list>
+#include <ostream>
+#include <string>
+
+#include "Menu/Menu.hpp"
+#include "Actions/Action.hpp"
+#include "defs.hpp"
+
+class MenuItem;
+
+/**
+ * Used to produce any kind of text menu
+ *
+ * All Items are displayed and user is prompted for a key. The item corresponding to that key is then activated.
+ */
+class TextMenu : public Menu
+{
+public:
+  class LeaveAction : public Action {
+  public:
+    LeaveAction(TextMenu*);
+    virtual ~LeaveAction();
+
+    bool canUndo();
+    bool shouldUndo();
+
+  private:
+    virtual Action::state_ptr performCall();
+    virtual Action::state_ptr performUndo(Action::state_ptr);
+    virtual Action::state_ptr performRedo(Action::state_ptr);
+
+    TextMenu* menu;
+
+    static const string nameBase;
+  };
+
+  TextMenu(ostream& _outputter, string _title, char _spacer=STD_MENU_TITLE_SPACER,int _length=STD_MENU_LENGTH);
+  virtual ~TextMenu();
+
+  virtual void addItem(MenuItem*);
+  virtual void removeItem(MenuItem*);
+  virtual void display();
+  virtual string getTitle();
+
+  /**
+   * Call doQuit if you want to return from this menu.
+   */
+  virtual void doQuit();
+  /**
+   * Check whether someone has chosen to quit
+   */
+  virtual bool hasQuit();
+
+  virtual void addDefault(MenuItem*);
+
+protected:
+  virtual void showEntry(MenuItem*);
+
+private:
+  list<MenuItem*> items;
+
+  MenuItem* defaultItem;
+
+  ostream& outputter;
+  string title;
+  char spacer;
+  int length;
+
+  bool quit;
+};
+
+#endif /* TEXTMENU_H_ */
Index: lecuilder/src/UIElements/TextDialog.cpp
===================================================================
--- molecuilder/src/UIElements/TextDialog.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,344 +1,0 @@
-/*
- * TextDialog.cpp
- *
- *  Created on: Jan 5, 2010
- *      Author: crueger
- */
-
-#include <iostream>
-
-#include <Descriptors/AtomDescriptor.hpp>
-#include <Descriptors/AtomIdDescriptor.hpp>
-#include <Descriptors/MoleculeDescriptor.hpp>
-#include <Descriptors/MoleculeIdDescriptor.hpp>
-#include "UIElements/TextDialog.hpp"
-
-#include "World.hpp"
-#include "periodentafel.hpp"
-#include "log.hpp"
-#include "verbose.hpp"
-
-#include "atom.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "vector.hpp"
-
-using namespace std;
-
-
-TextDialog::TextDialog()
-{
-}
-
-TextDialog::~TextDialog()
-{
-}
-
-
-void TextDialog::queryEmpty(const char* title, string description){
-  registerQuery(new EmptyTextQuery(title,description));
-}
-
-void TextDialog::queryBoolean(const char* title, bool* target, string description){
-  registerQuery(new BooleanTextQuery(title,target,description));
-}
-
-void TextDialog::queryInt(const char* title, int* target, string description){
-  registerQuery(new IntTextQuery(title,target,description));
-}
-
-void TextDialog::queryDouble(const char* title, double* target, string description){
-  registerQuery(new DoubleTextQuery(title,target,description));
-}
-
-void TextDialog::queryString(const char* title, string* target, string description){
-  registerQuery(new StringTextQuery(title,target,description));
-}
-
-void TextDialog::queryAtom(const char* title, atom **target, string description) {
-  registerQuery(new AtomTextQuery(title,target,description));
-}
-
-void TextDialog::queryMolecule(const char* title, molecule **target, string description) {
-  registerQuery(new MoleculeTextQuery(title,target,description));
-}
-
-void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) {
-  registerQuery(new VectorTextQuery(title,target,cellSize,check,description));
-}
-
-void TextDialog::queryBox(const char* title,double ** const cellSize, string description) {
-  registerQuery(new BoxTextQuery(title,cellSize,description));
-}
-
-void TextDialog::queryElement(const char* title, const element **target, string description){
-  registerQuery(new ElementTextQuery(title,target,description));
-}
-
-/************************** Query Infrastructure ************************/
-
-TextDialog::EmptyTextQuery::EmptyTextQuery(string title, std::string _description) :
-    Dialog::EmptyQuery(title,_description)
-{}
-
-TextDialog::EmptyTextQuery::~EmptyTextQuery() {}
-
-bool TextDialog::EmptyTextQuery::handle() {
-  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
-  return true;
-}
-
-TextDialog::IntTextQuery::IntTextQuery(string title, int * _target, std::string _description) :
-    Dialog::IntQuery(title,_target,_description)
-{}
-
-TextDialog::IntTextQuery::~IntTextQuery() {}
-
-bool TextDialog::IntTextQuery::handle() {
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> tmp;
-    if(cin.fail()){
-      badInput=true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-    }
-  } while(badInput);
-  // clear the input buffer of anything still in the line
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-TextDialog::BooleanTextQuery::BooleanTextQuery(string title, bool * _target, std::string _description) :
-    Dialog::BooleanQuery(title,_target,_description)
-{}
-
-TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
-
-bool TextDialog::BooleanTextQuery::handle() {
-  bool badInput = false;
-  char input = ' ';
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> input;
-    if ((input == 'y' ) || (input == 'Y')) {
-      tmp = true;
-    } else if ((input == 'n' ) || (input == 'N')) {
-      tmp = false;
-    } else {
-      badInput=true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
-    }
-  } while(badInput);
-  // clear the input buffer of anything still in the line
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) :
-    Dialog::StringQuery(title,_target,_description)
-{}
-
-TextDialog::StringTextQuery::~StringTextQuery() {}
-
-bool TextDialog::StringTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  getline(cin,tmp);
-  return true;
-}
-
-TextDialog::DoubleTextQuery::DoubleTextQuery(string title,double *_target, std::string _description) :
-    Dialog::DoubleQuery(title,_target,_description)
-{}
-
-TextDialog::DoubleTextQuery::~DoubleTextQuery() {}
-
-bool TextDialog::DoubleTextQuery::handle() {
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> tmp;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-    }
-  }while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-TextDialog::AtomTextQuery::AtomTextQuery(string title, atom **_target, std::string _description) :
-    Dialog::AtomQuery(title,_target,_description)
-{}
-
-TextDialog::AtomTextQuery::~AtomTextQuery() {}
-
-bool TextDialog::AtomTextQuery::handle() {
-  int idxOfAtom=0;
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> idxOfAtom;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-      continue;
-    }
-
-    tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
-    if(!tmp && idxOfAtom!=-1){
-      Log() << Verbose(0) << "Invalid Atom Index" << endl;
-      badInput = true;
-    }
-
-  } while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return (idxOfAtom!=-1);
-}
-
-TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, std::string _description) :
-    Dialog::MoleculeQuery(title,_target,_description)
-{}
-
-TextDialog::MoleculeTextQuery::~MoleculeTextQuery() {}
-
-bool TextDialog::MoleculeTextQuery::handle() {
-  int idxOfMol=0;
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> idxOfMol;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-      continue;
-    }
-
-    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
-    if(!tmp && idxOfMol!=-1){
-      Log() << Verbose(0) << "Invalid Molecule Index" << endl;
-      badInput = true;
-    }
-
-  } while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return (idxOfMol!=-1);
-}
-
-TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check, std::string _description) :
-    Dialog::VectorQuery(title,_target,_cellSize,_check,_description)
-{}
-
-TextDialog::VectorTextQuery::~VectorTextQuery()
-{}
-
-bool TextDialog::VectorTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-
-  char coords[3] = {'x','y','z'};
-  int j = -1;
-  for (int i=0;i<3;i++) {
-    j += i+1;
-    do {
-      Log() << Verbose(0) << coords[i] << "[0.." << cellSize[j] << "]: ";
-      cin >> (*tmp)[i];
-    } while ((((*tmp)[i] < 0) || ((*tmp)[i] >= cellSize[j])) && (check));
-  }
-  return true;
-}
-
-TextDialog::BoxTextQuery::BoxTextQuery(std::string title, double ** const _cellSize, std::string _description) :
-    Dialog::BoxQuery(title,_cellSize,_description)
-{}
-
-TextDialog::BoxTextQuery::~BoxTextQuery()
-{}
-
-bool TextDialog::BoxTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-
-  std::string coords[6] = {"xx","xy","xz", "yy", "yz", "zz"};
-  for (int i=0;i<6;i++) {
-    Log() << Verbose(0) << coords[i] << ": ";
-    cin >> tmp[i];
-  }
-  return true;
-}
-
-TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) :
-    Dialog::ElementQuery(title,target,_description)
-{}
-
-TextDialog::ElementTextQuery::~ElementTextQuery()
-{}
-
-bool TextDialog::ElementTextQuery::handle() {
-  bool badInput=false;
-  bool aborted = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-
-    // try to read as Atomic number
-    int Z;
-    cin >> Z;
-    if(!cin.fail()){
-      if(Z==-1){
-        aborted = true;
-      }
-      else{
-        tmp = World::getInstance().getPeriode()->FindElement(Z);
-        if(!tmp){
-          Log() << Verbose(0) << "No element with this atomic number!" << endl;
-          badInput = true;
-        }
-      }
-      continue;
-    }
-    else{
-      cin.clear();
-    }
-
-    // Try to read as shorthand
-    // the last buffer content was not removed, so we read the
-    // same thing again, this time as a string
-    string shorthand;
-    cin >> shorthand;
-    if(!cin.fail()){
-      if(shorthand.empty()){
-        aborted = true;
-      }
-      else{
-        tmp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
-        if(!tmp){
-          Log() << Verbose(0) << "No element with this shorthand!" << endl;
-          badInput = true;
-        }
-      }
-    }
-    else{
-      Log() << Verbose(0) << "Could not read input. Try Again." << endl;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      badInput = true;
-    }
-
-  }while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return !aborted;
-}
Index: lecuilder/src/UIElements/TextDialog.hpp
===================================================================
--- molecuilder/src/UIElements/TextDialog.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,110 +1,0 @@
-/*
- * TextDialog.hpp
- *
- *  Created on: Jan 5, 2010
- *      Author: crueger
- */
-
-#ifndef TEXTDIALOG_HPP_
-#define TEXTDIALOG_HPP_
-
-#include <string>
-
-#include "UIElements/Dialog.hpp"
-
-class atom;
-class element;
-class molecule;
-class Vector;
-
-class TextDialog : public Dialog
-{
-public:
-  TextDialog();
-  virtual ~TextDialog();
-
-  virtual void queryEmpty(const char *, std::string = "");
-  virtual void queryBoolean(const char *, bool *, std::string = "");
-  virtual void queryInt(const char *, int *, std::string = "");
-  virtual void queryString(const char*, std::string *, std::string = "");
-  virtual void queryDouble(const char*, double*, std::string = "");
-  virtual void queryAtom(const char*,atom**,std::string = "");
-  virtual void queryMolecule(const char*,molecule**,std::string = "");
-  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
-  virtual void queryBox(const char*,double ** const, std::string = "");
-  virtual void queryElement(const char*,const element **, std::string = "");
-
-protected:
-  // specialized stuff for text queries
-  class EmptyTextQuery : public Dialog::EmptyQuery {
-  public:
-    EmptyTextQuery(std::string title, std::string _description = NULL);
-    virtual ~EmptyTextQuery();
-    virtual bool handle();
-  };
-
-  class BooleanTextQuery : public Dialog::BooleanQuery {
-  public:
-    BooleanTextQuery(std::string title, bool *_target, std::string _description = NULL);
-    virtual ~BooleanTextQuery();
-    virtual bool handle();
-  };
-
-  class IntTextQuery : public Dialog::IntQuery {
-  public:
-    IntTextQuery(std::string title, int *_target, std::string _description = NULL);
-    virtual ~IntTextQuery();
-    virtual bool handle();
-  };
-
-  class DoubleTextQuery : public Dialog::DoubleQuery {
-  public:
-    DoubleTextQuery(std::string title, double *_target, std::string _description = NULL);
-    virtual ~DoubleTextQuery();
-    virtual bool handle();
-  };
-
-  class StringTextQuery : public Dialog::StringQuery {
-  public:
-    StringTextQuery(std::string title, std::string *_target, std::string _description = NULL);
-    virtual ~StringTextQuery();
-    virtual bool handle();
-  };
-
-  class AtomTextQuery : public Dialog::AtomQuery {
-  public:
-    AtomTextQuery(std::string title, atom **_target, std::string _description = NULL);
-    virtual ~AtomTextQuery();
-    virtual bool handle();
-  };
-
-  class MoleculeTextQuery : public Dialog::MoleculeQuery {
-  public:
-    MoleculeTextQuery(std::string title, molecule **_target, std::string _description = NULL);
-    virtual ~MoleculeTextQuery();
-    virtual bool handle();
-  };
-
-  class VectorTextQuery : public Dialog::VectorQuery {
-  public:
-    VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL);
-    virtual ~VectorTextQuery();
-    virtual bool handle();
-  };
-
-  class BoxTextQuery : public Dialog::BoxQuery {
-  public:
-    BoxTextQuery(std::string title,double ** const _cellSize, std::string _description = NULL);
-    virtual ~BoxTextQuery();
-    virtual bool handle();
-  };
-
-  class ElementTextQuery : public Dialog::ElementQuery {
-  public:
-    ElementTextQuery(std::string title, const element **_target, std::string _description = NULL);
-    virtual ~ElementTextQuery();
-    virtual bool handle();
-  };
-};
-
-#endif /* TEXTDIALOG_HPP_ */
Index: lecuilder/src/UIElements/TextStatusIndicator.cpp
===================================================================
--- molecuilder/src/UIElements/TextStatusIndicator.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/*
- * TextStatusIndicator.cpp
- *
- *  Created on: Feb 18, 2010
- *      Author: crueger
- */
-
-#include "TextStatusIndicator.hpp"
-
-#include <iostream>
-
-#include "Actions/Process.hpp"
-
-using namespace std;
-
-TextStatusIndicator::TextStatusIndicator()
-{
-  Process::AddObserver(this);
-}
-
-TextStatusIndicator::~TextStatusIndicator()
-{
-  Process::RemoveObserver(this);
-}
-
-void TextStatusIndicator::update(Observable *subject){
-  Process *proc;
-  // we are only observing Processes
-  if((proc=dynamic_cast<Process*>(subject))){
-    // see what kind of progress we have to display
-    if(proc->getMaxSteps()>0){
-      if(!proc->doesStop()){
-        cout << "Busy (" << proc->getName() << ") ";
-        // we can show a percentage done
-        cout << (int)proc->getDoneRatio() << "% done" << endl;
-      }
-    }
-    else{
-      // we only show some kind of busy animation
-      if(proc->doesStart()){
-        cout << "Busy (" << proc->getName() << ")";
-      }
-      if(!proc->doesStop()){
-        cout << ".";
-      }
-      else {
-        cout << endl;
-      }
-    }
-  }
-}
-
-void TextStatusIndicator::subjectKilled(Observable *subject){
-
-}
-
Index: lecuilder/src/UIElements/TextStatusIndicator.hpp
===================================================================
--- molecuilder/src/UIElements/TextStatusIndicator.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/*
- * TextStatusIndicator.hpp
- *
- *  Created on: Feb 18, 2010
- *      Author: crueger
- */
-
-#ifndef TEXTSTATUSINDICATOR_HPP_
-#define TEXTSTATUSINDICATOR_HPP_
-
-#include "Patterns/Observer.hpp"
-
-class TextStatusIndicator : public Observer
-{
-public:
-  TextStatusIndicator();
-  virtual ~TextStatusIndicator();
-
-  void update(Observable *subject);
-  void subjectKilled(Observable *subject);
-
-private:
-
-};
-
-#endif /* TEXTSTATUSINDICATOR_HPP_ */
Index: molecuilder/src/UIElements/TextUI/TextDialog.cpp
===================================================================
--- molecuilder/src/UIElements/TextUI/TextDialog.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/TextUI/TextDialog.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,344 @@
+/*
+ * TextDialog.cpp
+ *
+ *  Created on: Jan 5, 2010
+ *      Author: crueger
+ */
+
+#include <iostream>
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "World.hpp"
+#include "periodentafel.hpp"
+#include "log.hpp"
+#include "verbose.hpp"
+
+#include "atom.hpp"
+#include "element.hpp"
+#include "molecule.hpp"
+#include "vector.hpp"
+
+using namespace std;
+
+
+TextDialog::TextDialog()
+{
+}
+
+TextDialog::~TextDialog()
+{
+}
+
+
+void TextDialog::queryEmpty(const char* title, string description){
+  registerQuery(new EmptyTextQuery(title,description));
+}
+
+void TextDialog::queryBoolean(const char* title, bool* target, string description){
+  registerQuery(new BooleanTextQuery(title,target,description));
+}
+
+void TextDialog::queryInt(const char* title, int* target, string description){
+  registerQuery(new IntTextQuery(title,target,description));
+}
+
+void TextDialog::queryDouble(const char* title, double* target, string description){
+  registerQuery(new DoubleTextQuery(title,target,description));
+}
+
+void TextDialog::queryString(const char* title, string* target, string description){
+  registerQuery(new StringTextQuery(title,target,description));
+}
+
+void TextDialog::queryAtom(const char* title, atom **target, string description) {
+  registerQuery(new AtomTextQuery(title,target,description));
+}
+
+void TextDialog::queryMolecule(const char* title, molecule **target, string description) {
+  registerQuery(new MoleculeTextQuery(title,target,description));
+}
+
+void TextDialog::queryVector(const char* title, Vector *target,const double *const cellSize, bool check, string description) {
+  registerQuery(new VectorTextQuery(title,target,cellSize,check,description));
+}
+
+void TextDialog::queryBox(const char* title,double ** const cellSize, string description) {
+  registerQuery(new BoxTextQuery(title,cellSize,description));
+}
+
+void TextDialog::queryElement(const char* title, const element **target, string description){
+  registerQuery(new ElementTextQuery(title,target,description));
+}
+
+/************************** Query Infrastructure ************************/
+
+TextDialog::EmptyTextQuery::EmptyTextQuery(string title, std::string _description) :
+    Dialog::EmptyQuery(title,_description)
+{}
+
+TextDialog::EmptyTextQuery::~EmptyTextQuery() {}
+
+bool TextDialog::EmptyTextQuery::handle() {
+  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
+  return true;
+}
+
+TextDialog::IntTextQuery::IntTextQuery(string title, int * _target, std::string _description) :
+    Dialog::IntQuery(title,_target,_description)
+{}
+
+TextDialog::IntTextQuery::~IntTextQuery() {}
+
+bool TextDialog::IntTextQuery::handle() {
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> tmp;
+    if(cin.fail()){
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
+TextDialog::BooleanTextQuery::BooleanTextQuery(string title, bool * _target, std::string _description) :
+    Dialog::BooleanQuery(title,_target,_description)
+{}
+
+TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
+
+bool TextDialog::BooleanTextQuery::handle() {
+  bool badInput = false;
+  char input = ' ';
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> input;
+    if ((input == 'y' ) || (input == 'Y')) {
+      tmp = true;
+    } else if ((input == 'n' ) || (input == 'N')) {
+      tmp = false;
+    } else {
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
+TextDialog::StringTextQuery::StringTextQuery(string title,string *_target, std::string _description) :
+    Dialog::StringQuery(title,_target,_description)
+{}
+
+TextDialog::StringTextQuery::~StringTextQuery() {}
+
+bool TextDialog::StringTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  getline(cin,tmp);
+  return true;
+}
+
+TextDialog::DoubleTextQuery::DoubleTextQuery(string title,double *_target, std::string _description) :
+    Dialog::DoubleQuery(title,_target,_description)
+{}
+
+TextDialog::DoubleTextQuery::~DoubleTextQuery() {}
+
+bool TextDialog::DoubleTextQuery::handle() {
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> tmp;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+    }
+  }while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
+TextDialog::AtomTextQuery::AtomTextQuery(string title, atom **_target, std::string _description) :
+    Dialog::AtomQuery(title,_target,_description)
+{}
+
+TextDialog::AtomTextQuery::~AtomTextQuery() {}
+
+bool TextDialog::AtomTextQuery::handle() {
+  int idxOfAtom=0;
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> idxOfAtom;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+      continue;
+    }
+
+    tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
+    if(!tmp && idxOfAtom!=-1){
+      Log() << Verbose(0) << "Invalid Atom Index" << endl;
+      badInput = true;
+    }
+
+  } while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return (idxOfAtom!=-1);
+}
+
+TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, molecule **_target, std::string _description) :
+    Dialog::MoleculeQuery(title,_target,_description)
+{}
+
+TextDialog::MoleculeTextQuery::~MoleculeTextQuery() {}
+
+bool TextDialog::MoleculeTextQuery::handle() {
+  int idxOfMol=0;
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> idxOfMol;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+      continue;
+    }
+
+    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
+    if(!tmp && idxOfMol!=-1){
+      Log() << Verbose(0) << "Invalid Molecule Index" << endl;
+      badInput = true;
+    }
+
+  } while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return (idxOfMol!=-1);
+}
+
+TextDialog::VectorTextQuery::VectorTextQuery(std::string title, Vector *_target, const double *const _cellSize, bool _check, std::string _description) :
+    Dialog::VectorQuery(title,_target,_cellSize,_check,_description)
+{}
+
+TextDialog::VectorTextQuery::~VectorTextQuery()
+{}
+
+bool TextDialog::VectorTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+
+  char coords[3] = {'x','y','z'};
+  int j = -1;
+  for (int i=0;i<3;i++) {
+    j += i+1;
+    do {
+      Log() << Verbose(0) << coords[i] << "[0.." << cellSize[j] << "]: ";
+      cin >> (*tmp)[i];
+    } while ((((*tmp)[i] < 0) || ((*tmp)[i] >= cellSize[j])) && (check));
+  }
+  return true;
+}
+
+TextDialog::BoxTextQuery::BoxTextQuery(std::string title, double ** const _cellSize, std::string _description) :
+    Dialog::BoxQuery(title,_cellSize,_description)
+{}
+
+TextDialog::BoxTextQuery::~BoxTextQuery()
+{}
+
+bool TextDialog::BoxTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+
+  std::string coords[6] = {"xx","xy","xz", "yy", "yz", "zz"};
+  for (int i=0;i<6;i++) {
+    Log() << Verbose(0) << coords[i] << ": ";
+    cin >> tmp[i];
+  }
+  return true;
+}
+
+TextDialog::ElementTextQuery::ElementTextQuery(std::string title, const element **target, std::string _description) :
+    Dialog::ElementQuery(title,target,_description)
+{}
+
+TextDialog::ElementTextQuery::~ElementTextQuery()
+{}
+
+bool TextDialog::ElementTextQuery::handle() {
+  bool badInput=false;
+  bool aborted = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+
+    // try to read as Atomic number
+    int Z;
+    cin >> Z;
+    if(!cin.fail()){
+      if(Z==-1){
+        aborted = true;
+      }
+      else{
+        tmp = World::getInstance().getPeriode()->FindElement(Z);
+        if(!tmp){
+          Log() << Verbose(0) << "No element with this atomic number!" << endl;
+          badInput = true;
+        }
+      }
+      continue;
+    }
+    else{
+      cin.clear();
+    }
+
+    // Try to read as shorthand
+    // the last buffer content was not removed, so we read the
+    // same thing again, this time as a string
+    string shorthand;
+    cin >> shorthand;
+    if(!cin.fail()){
+      if(shorthand.empty()){
+        aborted = true;
+      }
+      else{
+        tmp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
+        if(!tmp){
+          Log() << Verbose(0) << "No element with this shorthand!" << endl;
+          badInput = true;
+        }
+      }
+    }
+    else{
+      Log() << Verbose(0) << "Could not read input. Try Again." << endl;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      badInput = true;
+    }
+
+  }while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return !aborted;
+}
Index: molecuilder/src/UIElements/TextUI/TextDialog.hpp
===================================================================
--- molecuilder/src/UIElements/TextUI/TextDialog.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/TextUI/TextDialog.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,110 @@
+/*
+ * TextDialog.hpp
+ *
+ *  Created on: Jan 5, 2010
+ *      Author: crueger
+ */
+
+#ifndef TEXTDIALOG_HPP_
+#define TEXTDIALOG_HPP_
+
+#include <string>
+
+#include "Dialog.hpp"
+
+class atom;
+class element;
+class molecule;
+class Vector;
+
+class TextDialog : public Dialog
+{
+public:
+  TextDialog();
+  virtual ~TextDialog();
+
+  virtual void queryEmpty(const char *, std::string = "");
+  virtual void queryBoolean(const char *, bool *, std::string = "");
+  virtual void queryInt(const char *, int *, std::string = "");
+  virtual void queryString(const char*, std::string *, std::string = "");
+  virtual void queryDouble(const char*, double*, std::string = "");
+  virtual void queryAtom(const char*,atom**,std::string = "");
+  virtual void queryMolecule(const char*,molecule**,std::string = "");
+  virtual void queryVector(const char*,Vector *,const double * const,bool, std::string = "");
+  virtual void queryBox(const char*,double ** const, std::string = "");
+  virtual void queryElement(const char*,const element **, std::string = "");
+
+protected:
+  // specialized stuff for text queries
+  class EmptyTextQuery : public Dialog::EmptyQuery {
+  public:
+    EmptyTextQuery(std::string title, std::string _description = NULL);
+    virtual ~EmptyTextQuery();
+    virtual bool handle();
+  };
+
+  class BooleanTextQuery : public Dialog::BooleanQuery {
+  public:
+    BooleanTextQuery(std::string title, bool *_target, std::string _description = NULL);
+    virtual ~BooleanTextQuery();
+    virtual bool handle();
+  };
+
+  class IntTextQuery : public Dialog::IntQuery {
+  public:
+    IntTextQuery(std::string title, int *_target, std::string _description = NULL);
+    virtual ~IntTextQuery();
+    virtual bool handle();
+  };
+
+  class DoubleTextQuery : public Dialog::DoubleQuery {
+  public:
+    DoubleTextQuery(std::string title, double *_target, std::string _description = NULL);
+    virtual ~DoubleTextQuery();
+    virtual bool handle();
+  };
+
+  class StringTextQuery : public Dialog::StringQuery {
+  public:
+    StringTextQuery(std::string title, std::string *_target, std::string _description = NULL);
+    virtual ~StringTextQuery();
+    virtual bool handle();
+  };
+
+  class AtomTextQuery : public Dialog::AtomQuery {
+  public:
+    AtomTextQuery(std::string title, atom **_target, std::string _description = NULL);
+    virtual ~AtomTextQuery();
+    virtual bool handle();
+  };
+
+  class MoleculeTextQuery : public Dialog::MoleculeQuery {
+  public:
+    MoleculeTextQuery(std::string title, molecule **_target, std::string _description = NULL);
+    virtual ~MoleculeTextQuery();
+    virtual bool handle();
+  };
+
+  class VectorTextQuery : public Dialog::VectorQuery {
+  public:
+    VectorTextQuery(std::string title,Vector *_target,const double *const _cellSize,bool _check, std::string _description = NULL);
+    virtual ~VectorTextQuery();
+    virtual bool handle();
+  };
+
+  class BoxTextQuery : public Dialog::BoxQuery {
+  public:
+    BoxTextQuery(std::string title,double ** const _cellSize, std::string _description = NULL);
+    virtual ~BoxTextQuery();
+    virtual bool handle();
+  };
+
+  class ElementTextQuery : public Dialog::ElementQuery {
+  public:
+    ElementTextQuery(std::string title, const element **_target, std::string _description = NULL);
+    virtual ~ElementTextQuery();
+    virtual bool handle();
+  };
+};
+
+#endif /* TEXTDIALOG_HPP_ */
Index: molecuilder/src/UIElements/TextUI/TextStatusIndicator.cpp
===================================================================
--- molecuilder/src/UIElements/TextUI/TextStatusIndicator.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/TextUI/TextStatusIndicator.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,56 @@
+/*
+ * TextStatusIndicator.cpp
+ *
+ *  Created on: Feb 18, 2010
+ *      Author: crueger
+ */
+
+#include "TextUI/TextStatusIndicator.hpp"
+
+#include <iostream>
+
+#include "Actions/Process.hpp"
+
+using namespace std;
+
+TextStatusIndicator::TextStatusIndicator()
+{
+  Process::AddObserver(this);
+}
+
+TextStatusIndicator::~TextStatusIndicator()
+{
+  Process::RemoveObserver(this);
+}
+
+void TextStatusIndicator::update(Observable *subject){
+  Process *proc;
+  // we are only observing Processes
+  if((proc=dynamic_cast<Process*>(subject))){
+    // see what kind of progress we have to display
+    if(proc->getMaxSteps()>0){
+      if(!proc->doesStop()){
+        cout << "Busy (" << proc->getName() << ") ";
+        // we can show a percentage done
+        cout << (int)proc->getDoneRatio() << "% done" << endl;
+      }
+    }
+    else{
+      // we only show some kind of busy animation
+      if(proc->doesStart()){
+        cout << "Busy (" << proc->getName() << ")";
+      }
+      if(!proc->doesStop()){
+        cout << ".";
+      }
+      else {
+        cout << endl;
+      }
+    }
+  }
+}
+
+void TextStatusIndicator::subjectKilled(Observable *subject){
+
+}
+
Index: molecuilder/src/UIElements/TextUI/TextStatusIndicator.hpp
===================================================================
--- molecuilder/src/UIElements/TextUI/TextStatusIndicator.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/TextUI/TextStatusIndicator.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,26 @@
+/*
+ * TextStatusIndicator.hpp
+ *
+ *  Created on: Feb 18, 2010
+ *      Author: crueger
+ */
+
+#ifndef TEXTSTATUSINDICATOR_HPP_
+#define TEXTSTATUSINDICATOR_HPP_
+
+#include "Patterns/Observer.hpp"
+
+class TextStatusIndicator : public Observer
+{
+public:
+  TextStatusIndicator();
+  virtual ~TextStatusIndicator();
+
+  void update(Observable *subject);
+  void subjectKilled(Observable *subject);
+
+private:
+
+};
+
+#endif /* TEXTSTATUSINDICATOR_HPP_ */
Index: molecuilder/src/UIElements/TextUI/TextUIFactory.cpp
===================================================================
--- molecuilder/src/UIElements/TextUI/TextUIFactory.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/TextUI/TextUIFactory.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,32 @@
+/*
+ * TextUIFactory.cpp
+ *
+ *  Created on: Jan 5, 2010
+ *      Author: crueger
+ */
+
+#include "TextUI/TextUIFactory.hpp"
+#include "TextUI/TextWindow.hpp"
+#include "TextUI/TextDialog.hpp"
+
+
+TextUIFactory::TextUIFactory()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+TextUIFactory::~TextUIFactory()
+{
+  // TODO Auto-generated destructor stub
+}
+
+
+Dialog* TextUIFactory::makeDialog() {
+  return new TextDialog();
+}
+
+MainWindow* TextUIFactory::makeMainWindow() {
+  return new TextWindow();
+}
+
Index: molecuilder/src/UIElements/TextUI/TextUIFactory.hpp
===================================================================
--- molecuilder/src/UIElements/TextUI/TextUIFactory.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/TextUI/TextUIFactory.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,27 @@
+/*
+ * TextUIFactory.h
+ *
+ *  Created on: Jan 5, 2010
+ *      Author: crueger
+ */
+
+#ifndef TEXTUIFACTORY_HPP_
+#define TEXTUIFACTORY_HPP_
+
+#include "UIFactory.hpp"
+
+class TextUIFactory : public UIFactory
+{
+friend class UIFactory;
+
+public:
+  virtual ~TextUIFactory();
+
+  virtual Dialog* makeDialog();
+  virtual MainWindow* makeMainWindow();
+
+protected:
+  TextUIFactory();
+};
+
+#endif /* TEXTUIFACTORY_HPP_ */
Index: molecuilder/src/UIElements/TextUI/TextWindow.cpp
===================================================================
--- molecuilder/src/UIElements/TextUI/TextWindow.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/TextUI/TextWindow.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,158 @@
+/*
+ * TextWindow.cpp
+ *
+ *  Created on: Jan 7, 2010
+ *      Author: crueger
+ */
+
+#include "TextUI/TextWindow.hpp"
+
+#include <boost/bind.hpp>
+
+
+// TODO: When done with refactoring most of these wont be needed anymore
+#include "analysis_correlation.hpp"
+#include "atom.hpp"
+#include "bond.hpp"
+#include "bondgraph.hpp"
+#include "boundary.hpp"
+#include "config.hpp"
+#include "element.hpp"
+#include "ellipsoid.hpp"
+#include "helpers.hpp"
+#include "leastsquaremin.hpp"
+#include "linkedcell.hpp"
+#include "log.hpp"
+#include "memoryusageobserver.hpp"
+#include "molecule.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+#include "Legacy/oldmenu.hpp"
+
+#include "Menu/Menu.hpp"
+#include "Menu/TextMenu.hpp"
+#include "Menu/ActionMenuItem.hpp"
+#include "Menu/SeperatorItem.hpp"
+#include "Menu/DisplayMenuItem.hpp"
+#include "Menu/SubMenuItem.hpp"
+#include "TextUI/TextStatusIndicator.hpp"
+#include "Actions/MethodAction.hpp"
+#include "Actions/MoleculeAction/ChangeNameAction.hpp"
+#include "Actions/ErrorAction.hpp"
+#include "Actions/ActionRegistry.hpp"
+#include "Views/StreamStringView.hpp"
+#include "Views/MethodStringView.hpp"
+
+#include <iostream>
+
+using namespace std;
+
+// TODO: see what code can be moved to a base class for Graphic and Text Windows
+TextWindow::TextWindow()
+{
+  MoleculeListClass *molecules = World::getInstance().getMolecules();
+  config *configuration = World::getInstance().getConfig();
+  periodentafel *periode = World::getInstance().getPeriode();
+  char *ConfigFileName = NULL;
+  old_menu = new oldmenu;
+
+  // build the main menu
+  main_menu = new TextMenu(Log() << Verbose(0), "Main Menu");
+
+  moleculeView = new StreamStringView(boost::bind(&MoleculeListClass::Enumerate,molecules,_1));
+  new DisplayMenuItem(main_menu,moleculeView,"Molecule List");
+
+  new SeperatorItem(main_menu);
+
+  Action* undoAction = ActionRegistry::getInstance().getActionByName("Undo");
+  new ActionMenuItem('u',"Undo last operation",main_menu,undoAction);
+
+  Action* redoAction = ActionRegistry::getInstance().getActionByName("Redo");
+  new ActionMenuItem('r',"Redo last operation",main_menu,redoAction);
+
+  new SeperatorItem(main_menu);
+
+  Action *setMoleculeAction = new MethodAction("setMoleculeAction",boost::bind(&MoleculeListClass::flipChosen,molecules));
+  new ActionMenuItem('a',"set molecule (in)active",main_menu,setMoleculeAction);
+
+  TextMenu *editMoleculesMenu = new TextMenu(Log() << Verbose(0), "Edit Molecules");
+  new SubMenuItem('e',"edit molecules (load, parse, save)",main_menu,editMoleculesMenu);
+
+  Action *manipulateMoleculeAction = new MethodAction("manipulateMoleculeAction",boost::bind(&oldmenu::ManipulateMolecules,old_menu,periode, molecules, configuration));
+  new ActionMenuItem('g',"globally manipulate atoms in molecule",main_menu,manipulateMoleculeAction);
+
+  Action *mergeMoleculeAction = new MethodAction("mergeMoleculeAction",boost::bind(&oldmenu::MergeMolecules,old_menu,periode, molecules));
+  new ActionMenuItem('M',"Merge molecules",main_menu,mergeMoleculeAction);
+
+  Action *manipulateAtomsAction = new MethodAction("manipulateAtomsAction",boost::bind(&oldmenu::ManipulateAtoms,old_menu,periode, molecules, configuration));
+  new ActionMenuItem('m',"manipulate atoms",main_menu,manipulateAtomsAction);
+
+  new SeperatorItem(main_menu);
+
+  Action *editConfigAction = new MethodAction("editConfigAction",boost::bind(&config::Edit,configuration));
+  new ActionMenuItem('c',"edit the current configuration",main_menu,editConfigAction);
+
+  new SeperatorItem(main_menu);
+
+  Action *saveConfigAction = new MethodAction("saveConfigAction",boost::bind(&config::SaveAll,configuration, ConfigFileName, periode, molecules));
+  new ActionMenuItem('s',"save current setup to config file",main_menu,saveConfigAction);
+
+  Action *doTestAction = new MethodAction("doTestAction",boost::bind(&oldmenu::testroutine,old_menu,molecules));
+  new ActionMenuItem('T',"call the current test routine",main_menu,doTestAction);
+
+  quitAction = new MethodAction("quitAction",boost::bind(&TextMenu::doQuit,main_menu),false);
+  new ActionMenuItem('q',"quit",main_menu,quitAction);
+
+  // call all functions used to build the submenus
+
+  populateEditMoleculesMenu(editMoleculesMenu);
+
+  Action *returnFromEditMoleculeAction = new TextMenu::LeaveAction(editMoleculesMenu);
+  MenuItem *returnItem = new ActionMenuItem('q',"return to Main menu",editMoleculesMenu,returnFromEditMoleculeAction);
+
+  editMoleculesMenu->addDefault(returnItem);
+
+  // Add status indicators etc...
+
+  statusIndicator = new TextStatusIndicator();
+}
+
+TextWindow::~TextWindow()
+{
+  delete old_menu;
+  delete quitAction;
+  delete moleculeView;
+  delete statusIndicator;
+  delete main_menu;
+}
+
+void TextWindow::display() {
+  main_menu->display();
+}
+
+void TextWindow::populateEditMoleculesMenu(Menu* editMoleculesMenu)
+{
+  MoleculeListClass *molecules = World::getInstance().getMolecules();
+  periodentafel *periode = World::getInstance().getPeriode();
+
+  // build the EditMoleculesMenu
+  Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode));
+  new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction);
+
+  Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode));
+  new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction);
+
+  Action *changeFilenameAction = new MoleculeChangeNameAction();
+  new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction);
+
+  Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules));
+  new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction);
+
+  Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules));
+  new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction);
+
+  Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules));
+  new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction);
+
+}
Index: molecuilder/src/UIElements/TextUI/TextWindow.hpp
===================================================================
--- molecuilder/src/UIElements/TextUI/TextWindow.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/TextUI/TextWindow.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,43 @@
+/*
+ * TextWindow.hpp
+ *
+ *  Created on: Jan 7, 2010
+ *      Author: crueger
+ */
+
+#ifndef TEXTWINDOW_HPP_
+#define TEXTWINDOW_HPP_
+
+#include "MainWindow.hpp"
+
+class TextMenu;
+class Action;
+class oldmenu;
+class StringView;
+class TextStatusIndicator;
+
+
+class TextWindow : public MainWindow
+{
+public:
+  TextWindow();
+  virtual ~TextWindow();
+
+  virtual void display();
+private:
+  // populaters
+  void populateEditMoleculesMenu(Menu* editMoleculesMenu);
+
+  TextMenu *main_menu;
+
+  // some actions only needed in textMenus
+  Action *quitAction;
+  // all views that are contained in the main Menu
+  StringView *moleculeView;
+  TextStatusIndicator *statusIndicator;
+
+  // This class still contains a lot of scattered functionality
+  oldmenu *old_menu;
+};
+
+#endif /* TEXTWINDOW_HPP_ */
Index: lecuilder/src/UIElements/TextUIFactory.cpp
===================================================================
--- molecuilder/src/UIElements/TextUIFactory.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,32 +1,0 @@
-/*
- * TextUIFactory.cpp
- *
- *  Created on: Jan 5, 2010
- *      Author: crueger
- */
-
-#include "UIElements/TextUIFactory.hpp"
-#include "UIElements/TextWindow.hpp"
-#include "UIElements/TextDialog.hpp"
-
-
-TextUIFactory::TextUIFactory()
-{
-  // TODO Auto-generated constructor stub
-
-}
-
-TextUIFactory::~TextUIFactory()
-{
-  // TODO Auto-generated destructor stub
-}
-
-
-Dialog* TextUIFactory::makeDialog() {
-  return new TextDialog();
-}
-
-MainWindow* TextUIFactory::makeMainWindow() {
-  return new TextWindow();
-}
-
Index: lecuilder/src/UIElements/TextUIFactory.hpp
===================================================================
--- molecuilder/src/UIElements/TextUIFactory.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,27 +1,0 @@
-/*
- * TextUIFactory.h
- *
- *  Created on: Jan 5, 2010
- *      Author: crueger
- */
-
-#ifndef TEXTUIFACTORY_HPP_
-#define TEXTUIFACTORY_HPP_
-
-#include "UIElements/UIFactory.hpp"
-
-class TextUIFactory : public UIFactory
-{
-friend class UIFactory;
-
-public:
-  virtual ~TextUIFactory();
-
-  virtual Dialog* makeDialog();
-  virtual MainWindow* makeMainWindow();
-
-protected:
-  TextUIFactory();
-};
-
-#endif /* TEXTUIFACTORY_HPP_ */
Index: lecuilder/src/UIElements/TextWindow.cpp
===================================================================
--- molecuilder/src/UIElements/TextWindow.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,158 +1,0 @@
-/*
- * TextWindow.cpp
- *
- *  Created on: Jan 7, 2010
- *      Author: crueger
- */
-
-#include "UIElements/TextWindow.hpp"
-
-#include <boost/bind.hpp>
-
-
-// TODO: When done with refactoring most of these wont be needed anymore
-#include "analysis_correlation.hpp"
-#include "atom.hpp"
-#include "bond.hpp"
-#include "bondgraph.hpp"
-#include "boundary.hpp"
-#include "config.hpp"
-#include "element.hpp"
-#include "ellipsoid.hpp"
-#include "helpers.hpp"
-#include "leastsquaremin.hpp"
-#include "linkedcell.hpp"
-#include "log.hpp"
-#include "memoryusageobserverunittest.hpp"
-#include "molecule.hpp"
-#include "periodentafel.hpp"
-#include "World.hpp"
-
-#include "Legacy/oldmenu.hpp"
-
-#include "Menu/Menu.hpp"
-#include "Menu/TextMenu.hpp"
-#include "Menu/ActionMenuItem.hpp"
-#include "Menu/SeperatorItem.hpp"
-#include "Menu/DisplayMenuItem.hpp"
-#include "Menu/SubMenuItem.hpp"
-#include "UIElements/TextStatusIndicator.hpp"
-#include "Actions/MethodAction.hpp"
-#include "Actions/MoleculeAction/ChangeNameAction.hpp"
-#include "Actions/ErrorAction.hpp"
-#include "Actions/ActionRegistry.hpp"
-#include "Views/StreamStringView.hpp"
-#include "Views/MethodStringView.hpp"
-
-#include <iostream>
-
-using namespace std;
-
-// TODO: see what code can be moved to a base class for Graphic and Text Windows
-TextWindow::TextWindow()
-{
-  MoleculeListClass *molecules = World::getInstance().getMolecules();
-  config *configuration = World::getInstance().getConfig();
-  periodentafel *periode = World::getInstance().getPeriode();
-  char *ConfigFileName = NULL;
-  old_menu = new oldmenu;
-
-  // build the main menu
-  main_menu = new TextMenu(Log() << Verbose(0), "Main Menu");
-
-  moleculeView = new StreamStringView(boost::bind(&MoleculeListClass::Enumerate,molecules,_1));
-  new DisplayMenuItem(main_menu,moleculeView,"Molecule List");
-
-  new SeperatorItem(main_menu);
-
-  Action* undoAction = ActionRegistry::getInstance().getActionByName("Undo");
-  new ActionMenuItem('u',"Undo last operation",main_menu,undoAction);
-
-  Action* redoAction = ActionRegistry::getInstance().getActionByName("Redo");
-  new ActionMenuItem('r',"Redo last operation",main_menu,redoAction);
-
-  new SeperatorItem(main_menu);
-
-  Action *setMoleculeAction = new MethodAction("setMoleculeAction",boost::bind(&MoleculeListClass::flipChosen,molecules));
-  new ActionMenuItem('a',"set molecule (in)active",main_menu,setMoleculeAction);
-
-  TextMenu *editMoleculesMenu = new TextMenu(Log() << Verbose(0), "Edit Molecules");
-  new SubMenuItem('e',"edit molecules (load, parse, save)",main_menu,editMoleculesMenu);
-
-  Action *manipulateMoleculeAction = new MethodAction("manipulateMoleculeAction",boost::bind(&oldmenu::ManipulateMolecules,old_menu,periode, molecules, configuration));
-  new ActionMenuItem('g',"globally manipulate atoms in molecule",main_menu,manipulateMoleculeAction);
-
-  Action *mergeMoleculeAction = new MethodAction("mergeMoleculeAction",boost::bind(&oldmenu::MergeMolecules,old_menu,periode, molecules));
-  new ActionMenuItem('M',"Merge molecules",main_menu,mergeMoleculeAction);
-
-  Action *manipulateAtomsAction = new MethodAction("manipulateAtomsAction",boost::bind(&oldmenu::ManipulateAtoms,old_menu,periode, molecules, configuration));
-  new ActionMenuItem('m',"manipulate atoms",main_menu,manipulateAtomsAction);
-
-  new SeperatorItem(main_menu);
-
-  Action *editConfigAction = new MethodAction("editConfigAction",boost::bind(&config::Edit,configuration));
-  new ActionMenuItem('c',"edit the current configuration",main_menu,editConfigAction);
-
-  new SeperatorItem(main_menu);
-
-  Action *saveConfigAction = new MethodAction("saveConfigAction",boost::bind(&config::SaveAll,configuration, ConfigFileName, periode, molecules));
-  new ActionMenuItem('s',"save current setup to config file",main_menu,saveConfigAction);
-
-  Action *doTestAction = new MethodAction("doTestAction",boost::bind(&oldmenu::testroutine,old_menu,molecules));
-  new ActionMenuItem('T',"call the current test routine",main_menu,doTestAction);
-
-  quitAction = new MethodAction("quitAction",boost::bind(&TextMenu::doQuit,main_menu),false);
-  new ActionMenuItem('q',"quit",main_menu,quitAction);
-
-  // call all functions used to build the submenus
-
-  populateEditMoleculesMenu(editMoleculesMenu);
-
-  Action *returnFromEditMoleculeAction = new TextMenu::LeaveAction(editMoleculesMenu);
-  MenuItem *returnItem = new ActionMenuItem('q',"return to Main menu",editMoleculesMenu,returnFromEditMoleculeAction);
-
-  editMoleculesMenu->addDefault(returnItem);
-
-  // Add status indicators etc...
-
-  statusIndicator = new TextStatusIndicator();
-}
-
-TextWindow::~TextWindow()
-{
-  delete old_menu;
-  delete quitAction;
-  delete moleculeView;
-  delete statusIndicator;
-  delete main_menu;
-}
-
-void TextWindow::display() {
-  main_menu->display();
-}
-
-void TextWindow::populateEditMoleculesMenu(Menu* editMoleculesMenu)
-{
-  MoleculeListClass *molecules = World::getInstance().getMolecules();
-  periodentafel *periode = World::getInstance().getPeriode();
-
-  // build the EditMoleculesMenu
-  Action *createMoleculeAction = new MethodAction("createMoleculeAction",boost::bind(&MoleculeListClass::createNewMolecule,molecules,periode));
-  new ActionMenuItem('c',"create new molecule",editMoleculesMenu,createMoleculeAction);
-
-  Action *loadMoleculeAction = new MethodAction("loadMoleculeAction",boost::bind(&MoleculeListClass::loadFromXYZ,molecules,periode));
-  new ActionMenuItem('l',"load molecule from xyz file",editMoleculesMenu,loadMoleculeAction);
-
-  Action *changeFilenameAction = new MoleculeChangeNameAction();
-  new ActionMenuItem('n',"change molecule's name",editMoleculesMenu,changeFilenameAction);
-
-  Action *giveFilenameAction = new MethodAction("giveFilenameAction",boost::bind(&MoleculeListClass::setMoleculeFilename,molecules));
-  new ActionMenuItem('N',"give molecules filename",editMoleculesMenu,giveFilenameAction);
-
-  Action *parseAtomsAction = new MethodAction("parseAtomsAction",boost::bind(&MoleculeListClass::parseXYZIntoMolecule,molecules));
-  new ActionMenuItem('p',"parse atoms in xyz file into molecule",editMoleculesMenu,parseAtomsAction);
-
-  Action *eraseMoleculeAction = new MethodAction("eraseMoleculeAction",boost::bind(&MoleculeListClass::eraseMolecule,molecules));
-  new ActionMenuItem('r',"remove a molecule",editMoleculesMenu,eraseMoleculeAction);
-
-}
Index: lecuilder/src/UIElements/TextWindow.hpp
===================================================================
--- molecuilder/src/UIElements/TextWindow.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * TextWindow.hpp
- *
- *  Created on: Jan 7, 2010
- *      Author: crueger
- */
-
-#ifndef TEXTWINDOW_HPP_
-#define TEXTWINDOW_HPP_
-
-#include "UIElements/MainWindow.hpp"
-
-class TextMenu;
-class Action;
-class oldmenu;
-class StringView;
-class TextStatusIndicator;
-
-
-class TextWindow : public MainWindow
-{
-public:
-  TextWindow();
-  virtual ~TextWindow();
-
-  virtual void display();
-private:
-  // populaters
-  void populateEditMoleculesMenu(Menu* editMoleculesMenu);
-
-  TextMenu *main_menu;
-
-  // some actions only needed in textMenus
-  Action *quitAction;
-  // all views that are contained in the main Menu
-  StringView *moleculeView;
-  TextStatusIndicator *statusIndicator;
-
-  // This class still contains a lot of scattered functionality
-  oldmenu *old_menu;
-};
-
-#endif /* TEXTWINDOW_HPP_ */
Index: molecuilder/src/UIElements/UIFactory.cpp
===================================================================
--- molecuilder/src/UIElements/UIFactory.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/UIElements/UIFactory.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -9,9 +9,9 @@
 #include <cassert>
 #include "Patterns/Singleton_impl.hpp"
-#include "UIElements/UIFactory.hpp"
+#include "UIFactory.hpp"
 
 // all factories that can be used:
-#include "UIElements/TextUIFactory.hpp"
-#include "UIElements/CommandLineUIFactory.hpp"
+#include "TextUI/TextUIFactory.hpp"
+#include "CommandLineUI/CommandLineUIFactory.hpp"
 
 UIFactory::UIFactory()
Index: molecuilder/src/UIElements/Views/MethodStringView.cpp
===================================================================
--- molecuilder/src/UIElements/Views/MethodStringView.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Views/MethodStringView.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,28 @@
+/*
+ * MethodStringView.cpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#include "MethodStringView.hpp"
+
+using namespace std;
+
+MethodStringView::MethodStringView(boost::function<string()> _displayMethod) :
+StringView(),
+displayMethod(_displayMethod)
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+MethodStringView::~MethodStringView()
+{
+  // TODO Auto-generated destructor stub
+}
+
+
+const string MethodStringView::toString() {
+  return displayMethod();
+}
Index: molecuilder/src/UIElements/Views/MethodStringView.hpp
===================================================================
--- molecuilder/src/UIElements/Views/MethodStringView.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Views/MethodStringView.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,30 @@
+/*
+ * MethodStringView.hpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#ifndef METHODSTRINGVIEW_HPP_
+#define METHODSTRINGVIEW_HPP_
+
+#include <boost/function.hpp>
+
+#include "Views/StringView.hpp"
+
+/**
+ * Wrapper to produce a StringView from any method that returns a String.
+ */
+class MethodStringView : public StringView
+{
+public:
+  MethodStringView(boost::function<std::string()>);
+  virtual ~MethodStringView();
+
+  virtual const std::string toString();
+
+private:
+  boost::function<std::string()> displayMethod;
+};
+
+#endif /* METHODSTRINGVIEW_HPP_ */
Index: molecuilder/src/UIElements/Views/StreamStringView.cpp
===================================================================
--- molecuilder/src/UIElements/Views/StreamStringView.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Views/StreamStringView.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,27 @@
+/*
+ * StreamStringView.cpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#include <sstream>
+#include <iostream>
+
+#include "StreamStringView.hpp"
+
+using namespace std;
+
+StreamStringView::StreamStringView(boost::function<void(ostream *)> _displayMethod) :
+StringView(),
+displayMethod(_displayMethod)
+{}
+
+StreamStringView::~StreamStringView()
+{}
+
+const string StreamStringView::toString() {
+  stringstream s;
+  displayMethod(dynamic_cast<ostream *>(&s));
+  return s.str();
+}
Index: molecuilder/src/UIElements/Views/StreamStringView.hpp
===================================================================
--- molecuilder/src/UIElements/Views/StreamStringView.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Views/StreamStringView.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,36 @@
+/*
+ * StreamStringView.hpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#ifndef STREAMSTRINGVIEW_HPP_
+#define STREAMSTRINGVIEW_HPP_
+
+#include <boost/function.hpp>
+#include <iostream>
+
+#include "Views/StringView.hpp"
+
+/**
+ * Wrapper to produce a StringView from any method that uses a stream to display something.
+ *
+ * The function is called with a stringstream which then is turned into a string later.
+ *
+ * Caveat: Make sure the stream passed to the method is actually used. Some methods seem to use a stream parameter for
+ * legacy reasons. These methods internally use the "Log() << Verbose()" mechanism instead of the stream.
+ */
+class StreamStringView : public StringView
+{
+public:
+  StreamStringView(boost::function<void(std::ostream *)>);
+  virtual ~StreamStringView();
+
+  virtual const std::string toString();
+
+private:
+  boost::function<void(std::ostream *)> displayMethod;
+};
+
+#endif /* STREAMSTRINGVIEW_HPP_ */
Index: molecuilder/src/UIElements/Views/StringView.cpp
===================================================================
--- molecuilder/src/UIElements/Views/StringView.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Views/StringView.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,19 @@
+/*
+ * StringView.cpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#include "StringView.hpp"
+
+StringView::StringView()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+StringView::~StringView()
+{
+  // TODO Auto-generated destructor stub
+}
Index: molecuilder/src/UIElements/Views/StringView.hpp
===================================================================
--- molecuilder/src/UIElements/Views/StringView.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Views/StringView.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,29 @@
+/*
+ * StringView.hpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#ifndef STRINGVIEW_HPP_
+#define STRINGVIEW_HPP_
+
+#include <string>
+#include "Views/View.hpp"
+
+/**
+ * View to show something as a string
+ *
+ * This View is used by calling the toString method.
+ * This View does *not* use the observer pattern.
+ */
+class StringView : public View
+{
+public:
+  StringView();
+  virtual ~StringView();
+
+  virtual const std::string toString()=0;
+};
+
+#endif /* STRINGVIEW_HPP_ */
Index: molecuilder/src/UIElements/Views/View.cpp
===================================================================
--- molecuilder/src/UIElements/Views/View.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Views/View.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,19 @@
+/*
+ * View.cpp
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#include "View.hpp"
+
+View::View()
+{
+  // TODO Auto-generated constructor stub
+
+}
+
+View::~View()
+{
+  // TODO Auto-generated destructor stub
+}
Index: molecuilder/src/UIElements/Views/View.hpp
===================================================================
--- molecuilder/src/UIElements/Views/View.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/UIElements/Views/View.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,23 @@
+/*
+ * View.h
+ *
+ *  Created on: Dec 14, 2009
+ *      Author: crueger
+ */
+
+#ifndef VIEW_H_
+#define VIEW_H_
+
+/**
+ * Base class for all Views
+ *
+ * TODO: is this really needed or helpfull at all?
+ */
+class View
+{
+public:
+  View();
+  virtual ~View();
+};
+
+#endif /* VIEW_H_ */
Index: lecuilder/src/Views/MethodStringView.cpp
===================================================================
--- molecuilder/src/Views/MethodStringView.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/*
- * MethodStringView.cpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#include "MethodStringView.hpp"
-
-using namespace std;
-
-MethodStringView::MethodStringView(boost::function<string()> _displayMethod) :
-StringView(),
-displayMethod(_displayMethod)
-{
-  // TODO Auto-generated constructor stub
-
-}
-
-MethodStringView::~MethodStringView()
-{
-  // TODO Auto-generated destructor stub
-}
-
-
-const string MethodStringView::toString() {
-  return displayMethod();
-}
Index: lecuilder/src/Views/MethodStringView.hpp
===================================================================
--- molecuilder/src/Views/MethodStringView.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,30 +1,0 @@
-/*
- * MethodStringView.hpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#ifndef METHODSTRINGVIEW_HPP_
-#define METHODSTRINGVIEW_HPP_
-
-#include <boost/function.hpp>
-
-#include "Views/StringView.hpp"
-
-/**
- * Wrapper to produce a StringView from any method that returns a String.
- */
-class MethodStringView : public StringView
-{
-public:
-  MethodStringView(boost::function<std::string()>);
-  virtual ~MethodStringView();
-
-  virtual const std::string toString();
-
-private:
-  boost::function<std::string()> displayMethod;
-};
-
-#endif /* METHODSTRINGVIEW_HPP_ */
Index: lecuilder/src/Views/StreamStringView.cpp
===================================================================
--- molecuilder/src/Views/StreamStringView.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,27 +1,0 @@
-/*
- * StreamStringView.cpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#include <sstream>
-#include <iostream>
-
-#include "StreamStringView.hpp"
-
-using namespace std;
-
-StreamStringView::StreamStringView(boost::function<void(ostream *)> _displayMethod) :
-StringView(),
-displayMethod(_displayMethod)
-{}
-
-StreamStringView::~StreamStringView()
-{}
-
-const string StreamStringView::toString() {
-  stringstream s;
-  displayMethod(dynamic_cast<ostream *>(&s));
-  return s.str();
-}
Index: lecuilder/src/Views/StreamStringView.hpp
===================================================================
--- molecuilder/src/Views/StreamStringView.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,36 +1,0 @@
-/*
- * StreamStringView.hpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#ifndef STREAMSTRINGVIEW_HPP_
-#define STREAMSTRINGVIEW_HPP_
-
-#include <boost/function.hpp>
-#include <iostream>
-
-#include "Views/StringView.hpp"
-
-/**
- * Wrapper to produce a StringView from any method that uses a stream to display something.
- *
- * The function is called with a stringstream which then is turned into a string later.
- *
- * Caveat: Make sure the stream passed to the method is actually used. Some methods seem to use a stream parameter for
- * legacy reasons. These methods internally use the "Log() << Verbose()" mechanism instead of the stream.
- */
-class StreamStringView : public StringView
-{
-public:
-  StreamStringView(boost::function<void(std::ostream *)>);
-  virtual ~StreamStringView();
-
-  virtual const std::string toString();
-
-private:
-  boost::function<void(std::ostream *)> displayMethod;
-};
-
-#endif /* STREAMSTRINGVIEW_HPP_ */
Index: lecuilder/src/Views/StringView.cpp
===================================================================
--- molecuilder/src/Views/StringView.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,19 +1,0 @@
-/*
- * StringView.cpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#include "StringView.hpp"
-
-StringView::StringView()
-{
-  // TODO Auto-generated constructor stub
-
-}
-
-StringView::~StringView()
-{
-  // TODO Auto-generated destructor stub
-}
Index: lecuilder/src/Views/StringView.hpp
===================================================================
--- molecuilder/src/Views/StringView.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/*
- * StringView.hpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#ifndef STRINGVIEW_HPP_
-#define STRINGVIEW_HPP_
-
-#include <string>
-#include "Views/View.hpp"
-
-/**
- * View to show something as a string
- *
- * This View is used by calling the toString method.
- * This View does *not* use the observer pattern.
- */
-class StringView : public View
-{
-public:
-  StringView();
-  virtual ~StringView();
-
-  virtual const std::string toString()=0;
-};
-
-#endif /* STRINGVIEW_HPP_ */
Index: lecuilder/src/Views/View.cpp
===================================================================
--- molecuilder/src/Views/View.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,19 +1,0 @@
-/*
- * View.cpp
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#include "View.hpp"
-
-View::View()
-{
-  // TODO Auto-generated constructor stub
-
-}
-
-View::~View()
-{
-  // TODO Auto-generated destructor stub
-}
Index: lecuilder/src/Views/View.hpp
===================================================================
--- molecuilder/src/Views/View.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ 	(revision )
@@ -1,23 +1,0 @@
-/*
- * View.h
- *
- *  Created on: Dec 14, 2009
- *      Author: crueger
- */
-
-#ifndef VIEW_H_
-#define VIEW_H_
-
-/**
- * Base class for all Views
- *
- * TODO: is this really needed or helpfull at all?
- */
-class View
-{
-public:
-  View();
-  virtual ~View();
-};
-
-#endif /* VIEW_H_ */
Index: molecuilder/src/analysis_bonds.cpp
===================================================================
--- molecuilder/src/analysis_bonds.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/analysis_bonds.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -51,5 +51,5 @@
  * \param &Max maximum distance on return, 0 if no bond between the two elements
  */
-void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, element *type1, element *type2, double &Min, double &Mean, double &Max)
+void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, const element *type1, const element *type2, double &Min, double &Mean, double &Max)
 {
   Min = 2e+6;
@@ -124,5 +124,5 @@
  * \param *InterfaceElement or NULL
  */
-int CountHydrogenBridgeBonds(MoleculeListClass *molecules, element * InterfaceElement = NULL)
+int CountHydrogenBridgeBonds(MoleculeListClass *molecules, const element * InterfaceElement = NULL)
 {
   atom *Walker = NULL;
@@ -181,5 +181,5 @@
                     // check angle
                     if (CheckHydrogenBridgeBondAngle(Walker, OtherAtom, Runner)) {
-                      DoLog(1) && (Log() << Verbose(1) << Walker->Name << ", " << OtherAtom->Name << " and " << Runner->Name << " has a hydrogen bridge bond with distance " << sqrt(distance) << " and angle " << CalculateAngle(&OtherAtom->x, &Walker->x, &Runner->x)*(180./M_PI) << "." << endl);
+                      DoLog(1) && (Log() << Verbose(1) << Walker->getName() << ", " << OtherAtom->getName() << " and " << Runner->getName() << " has a hydrogen bridge bond with distance " << sqrt(distance) << " and angle " << CalculateAngle(&OtherAtom->x, &Walker->x, &Runner->x)*(180./M_PI) << "." << endl);
                       count++;
                       break;
Index: molecuilder/src/analysis_bonds.hpp
===================================================================
--- molecuilder/src/analysis_bonds.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/analysis_bonds.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -31,7 +31,7 @@
 
 void GetMaxMinMeanBondCount(const molecule * const mol, double &Min, double &Mean, double &Max);
-void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, element *type1, element *type2, double &Min, double &Mean, double &Max);
+void MinMeanMaxBondDistanceBetweenElements(const molecule *mol, const element *type1, const element *type2, double &Min, double &Mean, double &Max);
 
-int CountHydrogenBridgeBonds(MoleculeListClass * const molecules, element * InterfaceElement);
+int CountHydrogenBridgeBonds(MoleculeListClass * const molecules, const element * InterfaceElement);
 int CountBondsOfTwo(MoleculeListClass * const molecules, const element * const first, const element * const second);
 int CountBondsOfThree(MoleculeListClass * const molecules, const element * const first, const element * const second, const element * const third);
Index: molecuilder/src/atom.cpp
===================================================================
--- molecuilder/src/atom.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/atom.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -40,5 +40,5 @@
 
 atom *atom::clone(){
-  atom *res = new atom();
+  atom *res = new atom(this);
   res->previous=0;
   res->next=0;
Index: molecuilder/src/atom_bondedparticle.cpp
===================================================================
--- molecuilder/src/atom_bondedparticle.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/atom_bondedparticle.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -44,5 +44,5 @@
 void BondedParticle::OutputBondOfAtom() const
 {
-  DoLog(4) && (Log() << Verbose(4) << "Atom " << Name << "/" << nr << " with " << ListOfBonds.size() << " bonds: " << endl);
+  DoLog(4) && (Log() << Verbose(4) << "Atom " << getName() << "/" << nr << " with " << ListOfBonds.size() << " bonds: " << endl);
   int TotalDegree = 0;
   for (BondList::const_iterator Runner = ListOfBonds.begin(); Runner != ListOfBonds.end(); ++Runner) {
Index: molecuilder/src/atom_graphnode.cpp
===================================================================
--- molecuilder/src/atom_graphnode.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/atom_graphnode.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -27,5 +27,5 @@
 void GraphNode::OutputGraphInfo() const
 {
-  DoLog(2) && (Log() << Verbose(2) << "Atom " << Name << " is " << ((SeparationVertex) ? "a" : "not a") << " separation vertex, components are ");
+  DoLog(2) && (Log() << Verbose(2) << "Atom " << getName() << " is " << ((SeparationVertex) ? "a" : "not a") << " separation vertex, components are ");
   OutputComponentNumber();
   DoLog(3) && (Log() << Verbose(3) << " with Lowpoint " << LowpointNr << " and Graph Nr. " << GraphNr << "." << endl);
Index: molecuilder/src/atom_particleinfo.cpp
===================================================================
--- molecuilder/src/atom_particleinfo.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/atom_particleinfo.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -11,13 +11,11 @@
 /** Constructor of ParticleInfo.
  */
-ParticleInfo::ParticleInfo() : nr(-1), Name(NULL) {};
+ParticleInfo::ParticleInfo() : nr(-1), name("Unknown") {
+};
 
 ParticleInfo::ParticleInfo(ParticleInfo *pointer) :
     nr(pointer->nr),
-    Name(pointer->Name)
-    {
-      if (Name == NULL)
-        Name = " ";
-    }
+    name(pointer->name)
+    {}
 
 
@@ -25,14 +23,17 @@
  */
 ParticleInfo::~ParticleInfo()
-{
-  Free(&Name);
-};
+{};
+
+const string& ParticleInfo::getName() const{
+  return name;
+}
+
+void ParticleInfo::setName(const string& _name){
+  name = _name;
+}
 
 ostream & operator << (ostream &ost, const ParticleInfo &a)
 {
-  if (a.Name == NULL)
-    ost << "[NULL]";
-  else
-    ost << "[" << a.Name << "|" << &a << "]";
+  ost << "[" << a.getName() << "|" << &a << "]";
   return ost;
 };
@@ -40,8 +41,5 @@
 ostream & ParticleInfo::operator << (ostream &ost) const
 {
-  if (Name == NULL)
-    ost << "[NULL]";
-  else
-    ost << "[" << Name << "|" << this << "]";
+  ost << "[" << name << "|" << this << "]";
   return ost;
 };
Index: molecuilder/src/atom_particleinfo.hpp
===================================================================
--- molecuilder/src/atom_particleinfo.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/atom_particleinfo.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -28,5 +28,4 @@
 public:
   int nr;       // index to easierly identify
-  char *Name;   // some name to reference to on output
 
   ParticleInfo();
@@ -34,7 +33,11 @@
   ~ParticleInfo();
 
+  const std::string& getName() const;
+  void setName(const std::string&);
+
   ostream & operator << (ostream &ost) const;
 
 private:
+  std::string name;   // some name to reference to on output
 };
 
Index: molecuilder/src/bond.cpp
===================================================================
--- molecuilder/src/bond.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/bond.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -53,5 +53,5 @@
 ostream & operator << (ostream &ost, const bond &b)
 {
-  ost << "[" << b.leftatom->Name << " <" << b.BondDegree << "(H" << b.HydrogenBond << ")>" << b.rightatom->Name << "]";
+  ost << "[" << b.leftatom->getName() << " <" << b.BondDegree << "(H" << b.HydrogenBond << ")>" << b.rightatom->getName() << "]";
   return ost;
 };
Index: molecuilder/src/builder.cpp
===================================================================
--- molecuilder/src/builder.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/builder.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -53,4 +53,5 @@
 
 #include <cstring>
+#include <cstdlib>
 
 #include "analysis_bonds.hpp"
@@ -1494,5 +1495,5 @@
  */
 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode,
-                                   config& configuration, char *&ConfigFileName, list<int> &ArgcList)
+                                   config& configuration, char *&ConfigFileName, set<int> &ArgcList)
 {
   Vector x,y,z,n;  // coordinates for absolute point in cell volume
@@ -1525,15 +1526,16 @@
           case 'H':
           case '?':
-            ArgcList.push_back(argptr-1);
+            ArgcList.insert(argptr-1);
             return(1);
             break;
           case 'v':
-            ArgcList.push_back(argptr-1);
-            return(1);
+            setVerbosity(atoi(argv[argptr]));
+            ArgcList.insert(argptr-1);
+            ArgcList.insert(argptr);
+            argptr++;
             break;
           case 'V':
-            ArgcList.push_back(argptr-1);
-            ArgcList.push_back(argptr);
-            argptr++;
+            ArgcList.insert(argptr-1);
+            return(1);
             break;
           case 'B':
@@ -2488,4 +2490,5 @@
   ActionRegistry::purgeInstance();
   ActionHistory::purgeInstance();
+  Memory::getState();
 }
 
@@ -2502,5 +2505,13 @@
     bool ArgumentsCopied = false;
 
+    // print version check whether arguments are present at all
     cout << ESPACKVersion << endl;
+    if (argc < 2) {
+      cout << "Obtain help with " << argv[0] << " -h." << endl;
+      cleanUp();
+      Memory::getState();
+      return(1);
+    }
+
 
     setVerbosity(0);
@@ -2508,9 +2519,13 @@
     ActionHistory::init();
 
+    // from this moment on, we need to be sure to deeinitialize in the correct order
+    // this is handled by the cleanup function
+    atexit(cleanUp);
+
     // Parse command line options and if present create respective UI
     {
-      list<int> ArgcList;
-      ArgcList.push_back(0); // push back program!
-      ArgcList.push_back(1); // push back config file name
+      set<int> ArgcList;
+      ArgcList.insert(0); // push back program!
+      ArgcList.insert(1); // push back config file name
       char ConfigFileName[MAXSTRINGSIZE];
       // handle arguments by ParseCommandLineOptions()
@@ -2519,5 +2534,5 @@
       Arguments = Malloc<char *>(ArgcList.size(), "main - **Arguments");
       cout << "The following arguments are handled by CommandLineParser: ";
-      for (list<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
+      for (set<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
         Arguments[ArgcSize] = Malloc<char>(strlen(argv[*ArgcRunner])+2, "main - *Arguments[]");
         strcpy(Arguments[ArgcSize], argv[*ArgcRunner]);
@@ -2558,6 +2573,4 @@
   }
 
-  cleanUp();
-  Memory::getState();
   return (ExitFlag == 1 ? 0 : ExitFlag);
 }
Index: molecuilder/src/config.cpp
===================================================================
--- molecuilder/src/config.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/config.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -1680,5 +1680,5 @@
     Walker = Walker->next;
     *output << Walker->nr << "\t";
-    *output << Walker->Name << "\t";
+    *output << Walker->getName() << "\t";
     *output << mol->name << "\t";
     *output << 0 << "\t";
@@ -1756,5 +1756,5 @@
         Walker = Walker->next;
         *output << AtomNo+1 << "\t";
-        *output << Walker->Name << "\t";
+        *output << Walker->getName() << "\t";
         *output << (*MolWalker)->name << "\t";
         *output << MolCounter+1 << "\t";
Index: molecuilder/src/elements.db
===================================================================
--- molecuilder/src/elements.db	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/elements.db	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -2,111 +2,111 @@
 #Element	Name	Symbol	Period	Group	Block	Atomic	Number	AtomicWeight	Covalent	Radius	vdW	Radius
 Hydrogen	H	1	1	s	1	1.008	0.23	1.09
-Helium	He	1	18	p	2	4.003	1.50	1.40
+Helium	He	1	18	p	2	4.003	1.5	1.4
 Lithium	Li	2	1	s	3	6.941	0.68	1.82
-Beryllium	Be	2	2	s	4	9.012	0.35	2.00
-Boron	B	2	13	p	5	10.811	0.83	2.00
-Carbon	C	2	14	p	6	12.011	0.68	1.70
+Beryllium	Be	2	2	s	4	9.012	0.35	2
+Boron	B	2	13	p	5	10.811	0.83	2
+Carbon	C	2	14	p	6	12.011	0.68	1.7
 Nitrogen	N	2	15	p	7	14.007	0.68	1.55
 Oxygen	O	2	16	p	8	15.999	0.68	1.52
 Fluorine	F	2	17	p	9	18.998	0.64	1.47
-Neon	Ne	2	18	p	10	20.180	1.50	1.54
+Neon	Ne	2	18	p	10	20.18	1.5	1.54
 Sodium	Na	3	1	s	11	22.991	0.97	2.27
-Magnesium	Mg	3	2	s	12	24.305	1.10	1.73
-Aluminium	Al	3	13	p	13	26.982	1.35	2.00
-Silicon	Si	3	14	p	14	28.086	1.20	2.10
-Phosphorus	P	3	15	p	15	30.974	1.05	1.80
-Sulphur	S	3	16	p	16	32.066	1.02	1.80
+Magnesium	Mg	3	2	s	12	24.305	1.1	1.73
+Aluminium	Al	3	13	p	13	26.982	1.35	2
+Silicon	Si	3	14	p	14	28.086	1.2	2.1
+Phosphorus	P	3	15	p	15	30.974	1.05	1.8
+Sulphur	S	3	16	p	16	32.066	1.02	1.8
 Chlorine	Cl	3	17	p	17	35.453	0.99	1.75
 Argon	Ar	3	18	p	18	39.948	1.51	1.88
 Potassium	K	4	1	s	19	39.098	1.33	2.75
-Calcium	Ca	4	2	s	20	40.078	0.99	2.00
-Scandium	Sc	4	3	d	21	44.956	1.44	2.00
-Titanium	Ti	4	4	d	22	47.867	1.47	2.00
-Vanadium	V	4	5	d	23	50.942	1.33	2.00
-Chromium	Cr	4	6	d	24	51.996	1.35	2.00
-Manganese	Mn	4	7	d	25	54.938	1.35	2.00
-Iron	Fe	4	8	d	26	55.845	1.34	2.00
-Cobalt	Co	4	9	d	27	58.933	1.33	2.00
-Nickel	Ni	4	10	d	28	58.693	1.50	1.63
-Copper	Cu	4	11	d	29	63.546	1.52	1.40
-Zinc	Zn	4	12	d	30	65.390	1.45	1.39
+Calcium	Ca	4	2	s	20	40.078	0.99	2
+Scandium	Sc	4	3	d	21	44.956	1.44	2
+Titanium	Ti	4	4	d	22	47.867	1.47	2
+Vanadium	V	4	5	d	23	50.942	1.33	2
+Chromium	Cr	4	6	d	24	51.996	1.35	2
+Manganese	Mn	4	7	d	25	54.938	1.35	2
+Iron	Fe	4	8	d	26	55.845	1.34	2
+Cobalt	Co	4	9	d	27	58.933	1.33	2
+Nickel	Ni	4	10	d	28	58.693	1.5	1.63
+Copper	Cu	4	11	d	29	63.546	1.52	1.4
+Zinc	Zn	4	12	d	30	65.39	1.45	1.39
 Gallium	Ga	4	13	p	31	69.723	1.22	1.87
-Germanium	Ge	4	14	p	32	72.610	1.17	2.00
+Germanium	Ge	4	14	p	32	72.61	1.17	2
 Arsenic	As	4	15	p	33	74.922	1.21	1.85
-Selenium	Se	4	16	p	34	78.960	1.22	1.90
+Selenium	Se	4	16	p	34	78.96	1.22	1.9
 Bromine	Br	4	17	p	35	79.904	1.21	1.85
-Krypton	Kr	4	18	p	36	83.800	1.50	2.02
-Rubidium	Rb	5	1	s	37	85.468	1.47	2.00
-Strontium	Sr	5	2	s	38	87.620	1.12	2.00
-Yttrium	Y	5	3	d	39	88.906	1.78	2.00
-Zirconium	Zr	5	4	d	40	91.224	1.56	2.00
-Niobium	Nb	5	5	d	41	92.906	1.48	2.00
-Molybdenum	Mo	5	6	d	42	95.940	1.47	2.00
-Technetium	Tc	5	7	d	43	98	1.35	2.00
-Ruthenium	Ru	5	8	d	44	101.070	1.40	2.00
-Rhodium	Rh	5	9	d	45	102.906	1.45	2.00
-Palladium	Pd	5	10	d	46	106.420	1.50	1.63
+Krypton	Kr	4	18	p	36	83.8	1.5	2.02
+Rubidium	Rb	5	1	s	37	85.468	1.47	2
+Strontium	Sr	5	2	s	38	87.62	1.12	2
+Yttrium	Y	5	3	d	39	88.906	1.78	2
+Zirconium	Zr	5	4	d	40	91.224	1.56	2
+Niobium	Nb	5	5	d	41	92.906	1.48	2
+Molybdenum	Mo	5	6	d	42	95.94	1.47	2
+Technetium	Tc	5	7	d	43	98	1.35	2
+Ruthenium	Ru	5	8	d	44	101.07	1.4	2
+Rhodium	Rh	5	9	d	45	102.906	1.45	2
+Palladium	Pd	5	10	d	46	106.42	1.5	1.63
 Silver	Ag	5	11	d	47	107.868	1.59	1.72
 Cadmium	Cd	5	12	d	48	112.411	1.69	1.58
 Indium	In	5	13	p	49	114.818	1.63	1.93
 Tin	Sn	5	14	p	50	118.71	1.46	2.17
-Antimony	Sb	5	15	p	51	121.760	1.46	2.00
-Tellurium	Te	5	16	p	52	127.600	1.47	2.06
-Iodine	I	5	17	p	53	126.904	1.40	1.98
-Xenon	Xe	5	18	p	54	131.290	1.50	2.16
-Caesium	Cs	6	1	s	55	132.905	1.67	2.00
-Barium	Ba	6	2	s	56	137.327	1.34	2.00
-Lutetium	Lu	6	3	d	71	174.967	1.72	2.00
-Hafnium	Hf	6	4	d	72	178.490	1.57	2.00
-Tantalum	Ta	6	5	d	73	180.948	1.43	2.00
-Tungsten	W	6	6	d	74	183.840	1.37	2.00
-Rhenium	Re	6	7	d	75	186.207	1.35	2.00
-Osmium	Os	6	8	d	76	190.230	1.37	2.00
-Iridium	Ir	6	9	d	77	192.217	1.32	2.00
-Platinum	Pt	6	10	d	78	195.078	1.50	1.72
-Gold	Au	6	11	d	79	196.967	1.50	1.66
-Mercury	Hg	6	12	d	80	200.590	1.70	1.55
+Antimony	Sb	5	15	p	51	121.76	1.46	2
+Tellurium	Te	5	16	p	52	127.6	1.47	2.06
+Iodine	I	5	17	p	53	126.904	1.4	1.98
+Xenon	Xe	5	18	p	54	131.29	1.5	2.16
+Caesium	Cs	6	1	s	55	132.905	1.67	2
+Barium	Ba	6	2	s	56	137.327	1.34	2
+Lanthanum	La	6Lan	19	f	57	138.906	1.87	2
+Cerium	Ce	6Lan	19	f	58	140.116	1.83	2
+Praseodymium	Pr	6Lan	19	f	59	140.908	1.82	2
+Neodymium	Nd	6Lan	19	f	60	144.24	1.81	2
+Promethium	Pm	6Lan	19	f	61	145	1.8	2
+Samarium	Sm	6Lan	19	f	62	150.36	1.8	2
+Europium	Eu	6Lan	19	f	63	151.964	1.99	2
+Gadolinium	Gd	6Lan	19	f	64	157.25	1.79	2
+Terbium	Tb	6Lan	19	f	65	158.925	1.76	2
+Dysprosium	Dy	6Lan	19	f	66	162.5	1.75	2
+Holmium	Ho	6Lan	19	f	67	164.93	1.74	2
+Erbium	Er	6Lan	19	f	68	167.26	1.73	2
+Thulium	Tm	6Lan	19	f	69	168.934	1.72	2
+Ytterbium	Yb	6Lan	19	f	70	173.04	1.94	2
+Lutetium	Lu	6	3	d	71	174.967	1.72	2
+Hafnium	Hf	6	4	d	72	178.49	1.57	2
+Tantalum	Ta	6	5	d	73	180.948	1.43	2
+Tungsten	W	6	6	d	74	183.84	1.37	2
+Rhenium	Re	6	7	d	75	186.207	1.35	2
+Osmium	Os	6	8	d	76	190.23	1.37	2
+Iridium	Ir	6	9	d	77	192.217	1.32	2
+Platinum	Pt	6	10	d	78	195.078	1.5	1.72
+Gold	Au	6	11	d	79	196.967	1.5	1.66
+Mercury	Hg	6	12	d	80	200.59	1.7	1.55
 Thallium	Tl	6	13	p	81	204.383	1.55	1.96
-Lead	Pb	6	14	p	82	207.200	1.54	2.02
-Bismuth	Bi	6	15	p	83	208.980	1.54	2.00
-Polonium	Po	6	16	p	84	210	1.68	2.00
-Astatine	At	6	17	p	85	210	1.21	2.00
-Radon	Rn	6	18	p	86	222	1.50	2.00
-Cerium	Ce	6Lan	19	f	58	140.116	1.83	2.00
-Dysprosium	Dy	6Lan	19	f	66	162.500	1.75	2.00
-Erbium	Er	6Lan	19	f	68	167.260	1.73	2.00
-Europium	Eu	6Lan	19	f	63	151.964	1.99	2.00
-Gadolinium	Gd	6Lan	19	f	64	157.250	1.79	2.00
-Holmium	Ho	6Lan	19	f	67	164.930	1.74	2.00
-Lanthanum	La	6Lan	19	f	57	138.906	1.87	2.00
-Neodymium	Nd	6Lan	19	f	60	144.240	1.81	2.00
-Promethium	Pm	6Lan	19	f	61	145	1.80	2.00
-Praseodymium	Pr	6Lan	19	f	59	140.908	1.82	2.00
-Samarium	Sm	6Lan	19	f	62	150.360	1.80	2.00
-Terbium	Tb	6Lan	19	f	65	158.925	1.76	2.00
-Thulium	Tm	6Lan	19	f	69	168.934	1.72	2.00
-Ytterbium	Yb	6Lan	19	f	70	173.040	1.94	2.00
-Francium	Fr	7	1	s	87	223	1.50	2.00
-Radium	Ra	7	2	s	88	226	1.90	2.00
-Lawrencium	Lr	7	3	d	103	262	1.50	2.00
-Rutherfordium	Rf	7	4	d	104	261	1.50	2.00
-Dubnium	Db	7	5	d	105	262	1.50	2.00
-Seaborgium	Sg	7	6	d	106	266	1.50	2.00
-Bohrium	Bh	7	7	d	107	264	1.50	2.00
-Hassium	Hs	7	8	d	108	269	1.50	2.00
-Meitnerium	Mt	7	9	d	109	268	1.50	2.00
-Darmstadtium	Ds	7	10	d	110	271	1.50	2.00
-Actinium	Ac	7Act	20	f	89	227	1.88	2.00
-Americium	Am	7Act	20	f	95	243	1.51	2.00
-Berkelium	Bk	7Act	20	f	97	247	1.54	2.00
-Californium	Cf	7Act	20	f	98	251	1.83	2.00
-Curium	Cm	7Act	20	f	96	247	0.99	2.00
-Einsteinium	Es	7Act	20	f	99	252	1.50	2.00
-Fermium	Fm	7Act	20	f	100	257	1.50	2.00
-Mendelevium	Md	7Act	20	f	101	258	1.50	2.00
-Nobelium	No	7Act	20	f	102	259	1.50	2.00
-Neptunium	Np	7Act	20	f	93	237	1.55	2.00
-Protactinium	Pa	7Act	20	f	91	231.036	1.61	2.00
-Plutonium	Pu	7Act	20	f	94	244	1.53	2.00
-Thorium	Th	7Act	20	f	90	232.038	1.79	2.00
+Lead	Pb	6	14	p	82	207.2	1.54	2.02
+Bismuth	Bi	6	15	p	83	208.98	1.54	2
+Polonium	Po	6	16	p	84	210	1.68	2
+Astatine	At	6	17	p	85	210	1.21	2
+Radon	Rn	6	18	p	86	222	1.5	2
+Francium	Fr	7	1	s	87	223	1.5	2
+Radium	Ra	7	2	s	88	226	1.9	2
+Actinium	Ac	7Act	20	f	89	227	1.88	2
+Thorium	Th	7Act	20	f	90	232.038	1.79	2
+Protactinium	Pa	7Act	20	f	91	231.036	1.61	2
 Uranium	U	7Act	20	f	92	238.029	1.58	1.86
+Neptunium	Np	7Act	20	f	93	237	1.55	2
+Plutonium	Pu	7Act	20	f	94	244	1.53	2
+Americium	Am	7Act	20	f	95	243	1.51	2
+Curium	Cm	7Act	20	f	96	247	0.99	2
+Berkelium	Bk	7Act	20	f	97	247	1.54	2
+Californium	Cf	7Act	20	f	98	251	1.83	2
+Einsteinium	Es	7Act	20	f	99	252	1.5	2
+Fermium	Fm	7Act	20	f	100	257	1.5	2
+Mendelevium	Md	7Act	20	f	101	258	1.5	2
+Nobelium	No	7Act	20	f	102	259	1.5	2
+Lawrencium	Lr	7	3	d	103	262	1.5	2
+Rutherfordium	Rf	7	4	d	104	261	1.5	2
+Dubnium	Db	7	5	d	105	262	1.5	2
+Seaborgium	Sg	7	6	d	106	266	1.5	2
+Bohrium	Bh	7	7	d	107	264	1.5	2
+Hassium	Hs	7	8	d	108	269	1.5	2
+Meitnerium	Mt	7	9	d	109	268	1.5	2
+Darmstadtium	Ds	7	10	d	110	271	1.5	2
Index: molecuilder/src/elements_db.cpp
===================================================================
--- molecuilder/src/elements_db.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/elements_db.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,317 @@
+/*
+ * elements_db.cpp
+ *
+ *  Created on: 17.05.2010
+ *      Author: heber
+ */
+
+const char *elementsDB =\
+"#	Covalent	radius	of	each	element	in	Angstroem	from	CSD	(binding	is:	[Rcov(A)+Rcov(B)-t,Rcov(A)+Rcov(B)+t]	with	t	=	0.4A\n\
+#Element	Name	Symbol	Period	Group	Block	Atomic	Number	AtomicWeight	Covalent	Radius	vdW	Radius\n\
+Hydrogen	H	1	1	s	1	1.008	0.23	1.09\n\
+Helium	He	1	18	p	2	4.003	1.50	1.40\n\
+Lithium	Li	2	1	s	3	6.941	0.68	1.82\n\
+Beryllium	Be	2	2	s	4	9.012	0.35	2.00\n\
+Boron	B	2	13	p	5	10.811	0.83	2.00\n\
+Carbon	C	2	14	p	6	12.011	0.68	1.70\n\
+Nitrogen	N	2	15	p	7	14.007	0.68	1.55\n\
+Oxygen	O	2	16	p	8	15.999	0.68	1.52\n\
+Fluorine	F	2	17	p	9	18.998	0.64	1.47\n\
+Neon	Ne	2	18	p	10	20.180	1.50	1.54\n\
+Sodium	Na	3	1	s	11	22.991	0.97	2.27\n\
+Magnesium	Mg	3	2	s	12	24.305	1.10	1.73\n\
+Aluminium	Al	3	13	p	13	26.982	1.35	2.00\n\
+Silicon	Si	3	14	p	14	28.086	1.20	2.10\n\
+Phosphorus	P	3	15	p	15	30.974	1.05	1.80\n\
+Sulphur	S	3	16	p	16	32.066	1.02	1.80\n\
+Chlorine	Cl	3	17	p	17	35.453	0.99	1.75\n\
+Argon	Ar	3	18	p	18	39.948	1.51	1.88\n\
+Potassium	K	4	1	s	19	39.098	1.33	2.75\n\
+Calcium	Ca	4	2	s	20	40.078	0.99	2.00\n\
+Scandium	Sc	4	3	d	21	44.956	1.44	2.00\n\
+Titanium	Ti	4	4	d	22	47.867	1.47	2.00\n\
+Vanadium	V	4	5	d	23	50.942	1.33	2.00\n\
+Chromium	Cr	4	6	d	24	51.996	1.35	2.00\n\
+Manganese	Mn	4	7	d	25	54.938	1.35	2.00\n\
+Iron	Fe	4	8	d	26	55.845	1.34	2.00\n\
+Cobalt	Co	4	9	d	27	58.933	1.33	2.00\n\
+Nickel	Ni	4	10	d	28	58.693	1.50	1.63\n\
+Copper	Cu	4	11	d	29	63.546	1.52	1.40\n\
+Zinc	Zn	4	12	d	30	65.390	1.45	1.39\n\
+Gallium	Ga	4	13	p	31	69.723	1.22	1.87\n\
+Germanium	Ge	4	14	p	32	72.610	1.17	2.00\n\
+Arsenic	As	4	15	p	33	74.922	1.21	1.85\n\
+Selenium	Se	4	16	p	34	78.960	1.22	1.90\n\
+Bromine	Br	4	17	p	35	79.904	1.21	1.85\n\
+Krypton	Kr	4	18	p	36	83.800	1.50	2.02\n\
+Rubidium	Rb	5	1	s	37	85.468	1.47	2.00\n\
+Strontium	Sr	5	2	s	38	87.620	1.12	2.00\n\
+Yttrium	Y	5	3	d	39	88.906	1.78	2.00\n\
+Zirconium	Zr	5	4	d	40	91.224	1.56	2.00\n\
+Niobium	Nb	5	5	d	41	92.906	1.48	2.00\n\
+Molybdenum	Mo	5	6	d	42	95.940	1.47	2.00\n\
+Technetium	Tc	5	7	d	43	98	1.35	2.00\n\
+Ruthenium	Ru	5	8	d	44	101.070	1.40	2.00\n\
+Rhodium	Rh	5	9	d	45	102.906	1.45	2.00\n\
+Palladium	Pd	5	10	d	46	106.420	1.50	1.63\n\
+Silver	Ag	5	11	d	47	107.868	1.59	1.72\n\
+Cadmium	Cd	5	12	d	48	112.411	1.69	1.58\n\
+Indium	In	5	13	p	49	114.818	1.63	1.93\n\
+Tin	Sn	5	14	p	50	118.71	1.46	2.17\n\
+Antimony	Sb	5	15	p	51	121.760	1.46	2.00\n\
+Tellurium	Te	5	16	p	52	127.600	1.47	2.06\n\
+Iodine	I	5	17	p	53	126.904	1.40	1.98\n\
+Xenon	Xe	5	18	p	54	131.290	1.50	2.16\n\
+Caesium	Cs	6	1	s	55	132.905	1.67	2.00\n\
+Barium	Ba	6	2	s	56	137.327	1.34	2.00\n\
+Lutetium	Lu	6	3	d	71	174.967	1.72	2.00\n\
+Hafnium	Hf	6	4	d	72	178.490	1.57	2.00\n\
+Tantalum	Ta	6	5	d	73	180.948	1.43	2.00\n\
+Tungsten	W	6	6	d	74	183.840	1.37	2.00\n\
+Rhenium	Re	6	7	d	75	186.207	1.35	2.00\n\
+Osmium	Os	6	8	d	76	190.230	1.37	2.00\n\
+Iridium	Ir	6	9	d	77	192.217	1.32	2.00\n\
+Platinum	Pt	6	10	d	78	195.078	1.50	1.72\n\
+Gold	Au	6	11	d	79	196.967	1.50	1.66\n\
+Mercury	Hg	6	12	d	80	200.590	1.70	1.55\n\
+Thallium	Tl	6	13	p	81	204.383	1.55	1.96\n\
+Lead	Pb	6	14	p	82	207.200	1.54	2.02\n\
+Bismuth	Bi	6	15	p	83	208.980	1.54	2.00\n\
+Polonium	Po	6	16	p	84	210	1.68	2.00\n\
+Astatine	At	6	17	p	85	210	1.21	2.00\n\
+Radon	Rn	6	18	p	86	222	1.50	2.00\n\
+Cerium	Ce	6Lan	19	f	58	140.116	1.83	2.00\n\
+Dysprosium	Dy	6Lan	19	f	66	162.500	1.75	2.00\n\
+Erbium	Er	6Lan	19	f	68	167.260	1.73	2.00\n\
+Europium	Eu	6Lan	19	f	63	151.964	1.99	2.00\n\
+Gadolinium	Gd	6Lan	19	f	64	157.250	1.79	2.00\n\
+Holmium	Ho	6Lan	19	f	67	164.930	1.74	2.00\n\
+Lanthanum	La	6Lan	19	f	57	138.906	1.87	2.00\n\
+Neodymium	Nd	6Lan	19	f	60	144.240	1.81	2.00\n\
+Promethium	Pm	6Lan	19	f	61	145	1.80	2.00\n\
+Praseodymium	Pr	6Lan	19	f	59	140.908	1.82	2.00\n\
+Samarium	Sm	6Lan	19	f	62	150.360	1.80	2.00\n\
+Terbium	Tb	6Lan	19	f	65	158.925	1.76	2.00\n\
+Thulium	Tm	6Lan	19	f	69	168.934	1.72	2.00\n\
+Ytterbium	Yb	6Lan	19	f	70	173.040	1.94	2.00\n\
+Francium	Fr	7	1	s	87	223	1.50	2.00\n\
+Radium	Ra	7	2	s	88	226	1.90	2.00\n\
+Lawrencium	Lr	7	3	d	103	262	1.50	2.00\n\
+Rutherfordium	Rf	7	4	d	104	261	1.50	2.00\n\
+Dubnium	Db	7	5	d	105	262	1.50	2.00\n\
+Seaborgium	Sg	7	6	d	106	266	1.50	2.00\n\
+Bohrium	Bh	7	7	d	107	264	1.50	2.00\n\
+Hassium	Hs	7	8	d	108	269	1.50	2.00\n\
+Meitnerium	Mt	7	9	d	109	268	1.50	2.00\n\
+Darmstadtium	Ds	7	10	d	110	271	1.50	2.00\n\
+Actinium	Ac	7Act	20	f	89	227	1.88	2.00\n\
+Americium	Am	7Act	20	f	95	243	1.51	2.00\n\
+Berkelium	Bk	7Act	20	f	97	247	1.54	2.00\n\
+Californium	Cf	7Act	20	f	98	251	1.83	2.00\n\
+Curium	Cm	7Act	20	f	96	247	0.99	2.00\n\
+Einsteinium	Es	7Act	20	f	99	252	1.50	2.00\n\
+Fermium	Fm	7Act	20	f	100	257	1.50	2.00\n\
+Mendelevium	Md	7Act	20	f	101	258	1.50	2.00\n\
+Nobelium	No	7Act	20	f	102	259	1.50	2.00\n\
+Neptunium	Np	7Act	20	f	93	237	1.55	2.00\n\
+Protactinium	Pa	7Act	20	f	91	231.036	1.61	2.00\n\
+Plutonium	Pu	7Act	20	f	94	244	1.53	2.00\n\
+Thorium	Th	7Act	20	f	90	232.038	1.79	2.00\n\
+Uranium	U	7Act	20	f	92	238.029	1.58	1.86\n\
+";
+
+const char *HbonddistanceDB =\
+"#atomic number bond distances for single, double and triple bond (-1 no bond)\n\
+1	0.74	-1	-1\n\
+2	0.77429209	-1	-1\n\
+5	1.23	1.19	1.18\n\
+6	1.09	1.076	1.06\n\
+7	1.04	1.02	1.01\n\
+8	0.96	0.957	-1\n\
+14	1.48	1.48	1.48\n\
+15	1.42	-1	-1\n\
+16	1.35	-1	-1\n\
+17	1.29	-1	-1\n\
+20	1.09	1.09	-1\n\
+34	1.47	-1	-1\n\
+35	1.44	-1	-1\n\
+";
+
+const char *HbondangleDB =\
+"# atomicnumber angles for single, double and triple bond (-1 no angle)\n\
+1	180	-1	-1\n\
+5	180	131.0	109.2\n\
+6	180	120	109.47\n\
+7	180	110	106.67\n\
+8	180	104.5	-1\n\
+14	180	120	109.47\n\
+15	180	-1	-1\n\
+16	180	-1	-1\n\
+17	180 -1 -1\n\
+20	180	120	109.47\n\
+34	180 -1 -1\n\
+35	180 -1 -1\n\
+";
+
+const char *orbitalsDB =\
+"# atomicnumber	numberoforbitals\n\
+1	1\n\
+2	0\n\
+3	1\n\
+4	2\n\
+5	3\n\
+6	4\n\
+7	3\n\
+8	2\n\
+9	1\n\
+10	0\n\
+11	1\n\
+12	2\n\
+13	3\n\
+14	4\n\
+15	3\n\
+16	2\n\
+17	1\n\
+18	0\n\
+19	1\n\
+20	4\n\
+21	3\n\
+22	4\n\
+23	5\n\
+24	6\n\
+25	4\n\
+26	3\n\
+27	3\n\
+28	2\n\
+29	2\n\
+30	2\n\
+31	3\n\
+32	4\n\
+33	3\n\
+34	2\n\
+35	1\n\
+36	0\n\
+37	1\n\
+38	2\n\
+39	3\n\
+40	4\n\
+41	5\n\
+42	6\n\
+43	6\n\
+44	8\n\
+45	4\n\
+46	4\n\
+47	1\n\
+48	2\n\
+49	3\n\
+50	4\n\
+51	3\n\
+52	2\n\
+53	1\n\
+54	0\n\
+55	1\n\
+56	2\n\
+57	3\n\
+58	4\n\
+59	3\n\
+60	4\n\
+61	3\n\
+62	3\n\
+63	3\n\
+64	3\n\
+65	4\n\
+66	3\n\
+67	3\n\
+68	3\n\
+69	3	\n\
+70	3\n\
+71	3\n\
+72	4\n\
+73	5\n\
+74	6\n\
+75	7\n\
+76	8\n\
+77	6\n\
+78	6\n\
+79	3\n\
+80	2\n\
+81	3\n\
+82	4\n\
+83	3\n\
+84	4\n\
+86	0\n\
+88	2\n\
+89	3\n\
+90	4\n\
+91	5\n\
+92	6\n\
+";
+
+const char *valenceDB =\
+"#atomicnumber numberofvalenceorbitals\n\
+1	0.10000000000000E+01\n\
+2	0.20000000000000E+01\n\
+3	0.10000000000000E+01\n\
+4	0.20000000000000E+01\n\
+5	0.30000000000000E+01\n\
+6	0.40000000000000E+01\n\
+7	0.50000000000000E+01\n\
+8	0.60000000000000E+01\n\
+9	0.70000000000000E+01\n\
+10	0.80000000000000E+01\n\
+11	0.10000000000000E+01\n\
+12	0.40000000000000E+01\n\
+13	.3000000000000000E+01\n\
+14	0.40000000000000E+01\n\
+15	0.50000000000000E+01\n\
+16	0.60000000000000E+01\n\
+17	0.70000000000000E+01\n\
+18	0.80000000000000E+01\n\
+19	0.30000000000000E+01\n\
+20	0.40000000000000E+01\n\
+21	0.30000000000000E+01\n\
+22	0.40000000000000E+01\n\
+23	0.50000000000000E+01\n\
+24	0.60000000000000E+01\n\
+25	0.70000000000000E+01\n\
+26	0.80000000000000E+01\n\
+27	0.90000000000000E+01\n\
+28	0.10000000000000E+02\n\
+29	0.11000000000000E+02\n\
+30	0.12000000000000E+02\n\
+31	3.00000000000000000\n\
+32	0.40000000000000E+01\n\
+33	5.00000000000000000\n\
+34	0.60000000000000E+01\n\
+35	0.70000000000000E+01\n\
+36	0.80000000000000E+01\n\
+37	0.10000000000000E+01\n\
+38	0.20000000000000E+01\n\
+39	0.30000000000000E+01\n\
+40	0.40000000000000E+01\n\
+41	0.50000000000000E+01\n\
+42	0.60000000000000E+01\n\
+43	0.70000000000000E+01\n\
+44	0.80000000000000E+01\n\
+45	0.90000000000000E+01\n\
+46	0.10000000000000E+02\n\
+47	0.11000000000000E+02\n\
+48	0.12000000000000E+02\n\
+49	0.30000000000000E+01\n\
+50	0.40000000000000E+01\n\
+51	0.50000000000000E+01\n\
+52	0.60000000000000E+01\n\
+53	0.70000000000000E+01\n\
+54	0.80000000000000E+01\n\
+55	0.10000000000000E+01\n\
+56	0.20000000000000E+01\n\
+72	0.40000000000000E+01\n\
+73	0.50000000000000E+01\n\
+74	0.60000000000000E+01\n\
+75	0.70000000000000E+01\n\
+76	0.80000000000000E+01\n\
+77	0.90000000000000E+01\n\
+78	0.10000000000000E+02\n\
+79	0.11000000000000E+02\n\
+80	0.12000000000000E+02\n\
+";
Index: molecuilder/src/elements_db.hpp
===================================================================
--- molecuilder/src/elements_db.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/elements_db.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,17 @@
+/*
+ * elements_db.hpp
+ *
+ *  Created on: 17.05.2010
+ *      Author: heber
+ */
+
+#ifndef ELEMENTS_DB_HPP_
+#define ELEMENTS_DB_HPP_
+
+extern const char *elementsDB;
+extern const char *HbonddistanceDB;
+extern const char *HbondangleDB;
+extern const char *orbitalsDB;
+extern const char *valenceDB;
+
+#endif /* ELEMENTS_DB_HPP_ */
Index: molecuilder/src/helpers.cpp
===================================================================
--- molecuilder/src/helpers.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/helpers.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -209,8 +209,8 @@
  */
 void performCriticalExit() {
-  map<void*, size_t> pointers = MemoryUsageObserver::getInstance()->getPointersToAllocatedMemory();
-  for (map<void*, size_t>::iterator runner = pointers.begin(); runner != pointers.end(); runner++) {
-    Free(((void**) &runner->first));
-  }
+//  map<void*, size_t> pointers = MemoryUsageObserver::getInstance()->getPointersToAllocatedMemory();
+//  for (map<void*, size_t>::iterator runner = pointers.begin(); runner != pointers.end(); runner++) {
+//    Free(((void**) &runner->first));
+//  }
 
   exit(255);
Index: molecuilder/src/molecule.cpp
===================================================================
--- molecuilder/src/molecule.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/molecule.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -135,8 +135,8 @@
       if (pointer->type->Z != 1)
         NoNonHydrogen++;
-      if (pointer->Name == NULL) {
-        Free(&pointer->Name);
-        pointer->Name = Malloc<char>(6, "molecule::AddAtom: *pointer->Name");
-        sprintf(pointer->Name, "%2s%02d", pointer->type->symbol, pointer->nr+1);
+      if(pointer->getName() == "Unknown"){
+        stringstream sstr;
+        sstr << pointer->type->symbol << pointer->nr+1;
+        pointer->setName(sstr.str());
       }
     }
@@ -157,6 +157,7 @@
   if (pointer != NULL) {
     atom *walker = pointer->clone();
-    walker->Name = Malloc<char>(strlen(pointer->Name) + 1, "atom::atom: *Name");
-    strcpy (walker->Name, pointer->Name);
+    stringstream sstr;
+    sstr << pointer->getName();
+    walker->setName(sstr.str());
     walker->nr = last_atom++;  // increase number within molecule
     add(walker, end);
@@ -252,5 +253,5 @@
   BondRescale = TopOrigin->type->HBondDistance[TopBond->BondDegree-1];
   if (BondRescale == -1) {
-    DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl);
+    DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl);
     return false;
     BondRescale = bondlength;
@@ -275,5 +276,5 @@
       InBondvector *= BondRescale;   // rescale the distance vector to Hydrogen bond length
       FirstOtherAtom->x = TopOrigin->x; // set coordination to origin ...
-      FirstOtherAtom->x = InBondvector;  // ... and add distance vector to replacement atom
+      FirstOtherAtom->x += InBondvector;  // ... and add distance vector to replacement atom
       AllWentWell = AllWentWell && AddAtom(FirstOtherAtom);
 //      Log() << Verbose(4) << "Added " << *FirstOtherAtom << " at: ";
@@ -295,5 +296,5 @@
             SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin);
           } else {
-            DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->Name);
+            DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->getName());
           }
         }
@@ -339,5 +340,5 @@
       bondangle = TopOrigin->type->HBondAngle[1];
       if (bondangle == -1) {
-        DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl);
+        DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->getName() << "<->" << TopReplacement->getName() << ") of degree " << TopBond->BondDegree << "!" << endl);
         return false;
         bondangle = 0;
@@ -616,5 +617,5 @@
     add(Binder, last);
   } else {
-    DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->Name << " and " << atom2->Name << " as one or both are not present in the molecule." << endl);
+    DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->getName() << " and " << atom2->getName() << " as one or both are not present in the molecule." << endl);
   }
   return Binder;
@@ -695,5 +696,5 @@
     AtomCount--;
   } else
-    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
+    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->getName() << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
   if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
     ElementCount--;
@@ -713,5 +714,5 @@
     ElementsInMolecule[pointer->type->Z]--; // decrease number of atom of this element
   else
-    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
+    DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->getName() << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl);
   if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
     ElementCount--;
@@ -915,8 +916,8 @@
         if (Walker->type->Z != 1) // count non-hydrogen atoms whilst at it
           NoNonHydrogen++;
-        Free(&Walker->Name);
-        Walker->Name = Malloc<char>(6, "molecule::CountAtoms: *walker->Name");
-        sprintf(Walker->Name, "%2s%02d", Walker->type->symbol, Walker->nr+1);
-        DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->Name << "." << endl);
+        stringstream sstr;
+        sstr << Walker->type->symbol << Walker->nr+1;
+        Walker->setName(sstr.str());
+        DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->getName() << "." << endl);
         i++;
       }
Index: molecuilder/src/molecule_fragmentation.cpp
===================================================================
--- molecuilder/src/molecule_fragmentation.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/molecule_fragmentation.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -722,5 +722,5 @@
     // free memory for bond part
     DoLog(1) && (Log() << Verbose(1) << "Freeing bond memory" << endl);
-    delete(FragmentList); // remove bond molecule from memory
+    Free(&FragmentList); // remove bond molecule from memory
     Free(&SortIndex);
   } else {
@@ -907,5 +907,5 @@
       }
     } else {
-      DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl);
+      DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->getName() << " has father " << FatherOfRunner->getName() << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl);
     }
     if ((LonelyFlag) && (Leaf->AtomCount > 1)) {
Index: molecuilder/src/molecule_geometry.cpp
===================================================================
--- molecuilder/src/molecule_geometry.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/molecule_geometry.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -109,5 +109,5 @@
 
   if (ptr->next != end) {   //list not empty?
-    while (ptr->next != end) {  // continue with second if present
+    while (ptr->next != end) {
       ptr = ptr->next;
       Num++;
@@ -125,17 +125,15 @@
 Vector * molecule::DetermineCenterOfAll() const
 {
-  atom *ptr = start->next;  // start at first in list
+  atom *ptr = start;  // start at first in list
   Vector *a = new Vector();
-  Vector tmp;
   double Num = 0;
 
   a->Zero();
 
-  if (ptr != end) {   //list not empty?
-    while (ptr->next != end) {  // continue with second if present
+  if (ptr->next != end) {   //list not empty?
+    while (ptr->next != end) {
       ptr = ptr->next;
       Num += 1.;
-      tmp = ptr->x;
-      (*a) += tmp;
+      (*a) += ptr->x;
     }
     a->Scale(1./Num); // divide through total mass (and sign for direction)
@@ -284,5 +282,5 @@
               if ((fabs(tmp)) > BondDistance) {
                 flag = false;
-                DoLog(0) && (Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl);
+                DoLog(0) && (Log() << Verbose(0) << "Hit: atom " << Walker->getName() << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl);
                 if (tmp > 0)
                   Translationvector[j] -= 1.;
Index: molecuilder/src/molecule_graph.cpp
===================================================================
--- molecuilder/src/molecule_graph.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/molecule_graph.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -317,5 +317,5 @@
     Walker->GraphNr = DFS.CurrentGraphNr;
     Walker->LowpointNr = DFS.CurrentGraphNr;
-    DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl);
+    DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->getName() << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl);
     DFS.AtomStack->Push(Walker);
     DFS.CurrentGraphNr++;
@@ -348,5 +348,5 @@
     Binder->MarkUsed(black);
     OtherAtom = Binder->GetOtherAtom(Walker);
-    DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl);
+    DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->getName() << "." << endl);
     if (OtherAtom->GraphNr != -1) {
       // (4a) ... if "other" atom has been visited (GraphNr != 0), set lowpoint to minimum of both, go to (3)
@@ -354,5 +354,5 @@
       DFS.BackEdgeStack->Push(Binder);
       Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr;
-      DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl);
+      DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->getName() << "] to " << Walker->LowpointNr << "." << endl);
     } else {
       // (4b) ... otherwise set OtherAtom as Ancestor of Walker and Walker as OtherAtom, go to (2)
@@ -360,5 +360,5 @@
       OtherAtom->Ancestor = Walker;
       Walker = OtherAtom;
-      DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl);
+      DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->getName() << "]'s Ancestor is now " << OtherAtom->Ancestor->getName() << ", Walker is OtherAtom " << OtherAtom->getName() << "." << endl);
       break;
     }
@@ -382,5 +382,5 @@
 
   // (5) if Ancestor of Walker is ...
-  DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl);
+  DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "] is " << Walker->Ancestor->GraphNr << "." << endl);
 
   if (Walker->Ancestor->GraphNr != DFS.Root->GraphNr) {
@@ -389,23 +389,23 @@
       // (6a) set Ancestor's Lowpoint number to minimum of of its Ancestor and itself, go to Step(8)
       Walker->Ancestor->LowpointNr = (Walker->Ancestor->LowpointNr < Walker->LowpointNr) ? Walker->Ancestor->LowpointNr : Walker->LowpointNr;
-      DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl);
+      DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl);
     } else {
       // (7) (Ancestor of Walker is a separating vertex, remove all from stack till Walker (including), these and Ancestor form a component
       Walker->Ancestor->SeparationVertex = true;
-      DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl);
+      DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->getName() << "]'s Ancestor[" << Walker->Ancestor->getName() << "]'s is a separating vertex, creating component." << endl);
       mol->SetNextComponentNumber(Walker->Ancestor, DFS.ComponentNumber);
-      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl);
+      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->getName() << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl);
       mol->SetNextComponentNumber(Walker, DFS.ComponentNumber);
-      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
+      DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
       do {
         OtherAtom = DFS.AtomStack->PopLast();
         LeafWalker->Leaf->AddCopyAtom(OtherAtom);
         mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber);
-        DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
+        DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
       } while (OtherAtom != Walker);
       DFS.ComponentNumber++;
     }
     // (8) Walker becomes its Ancestor, go to (3)
-    DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl);
+    DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->getName() << "] is now its Ancestor " << Walker->Ancestor->getName() << ", backstepping. " << endl);
     Walker = Walker->Ancestor;
     DFS.BackStepping = true;
@@ -431,12 +431,12 @@
     //DFS.AtomStack->Output(out);
     mol->SetNextComponentNumber(DFS.Root, DFS.ComponentNumber);
-    DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);
+    DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->getName() << "]'s Component is " << DFS.ComponentNumber << "." << endl);
     mol->SetNextComponentNumber(Walker, DFS.ComponentNumber);
-    DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl);
+    DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->getName() << "]'s Component is " << DFS.ComponentNumber << "." << endl);
     do {
       OtherAtom = DFS.AtomStack->PopLast();
       LeafWalker->Leaf->AddCopyAtom(OtherAtom);
       mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber);
-      DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
+      DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->getName() << "]'s Compont is " << DFS.ComponentNumber << "." << endl);
     } while (OtherAtom != Walker);
     DFS.ComponentNumber++;
@@ -445,5 +445,5 @@
     Walker = DFS.Root;
     Binder = mol->FindNextUnused(Walker);
-    DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl);
+    DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->getName() << "], next Unused Bond is " << Binder << "." << endl);
     if (Binder != NULL) { // Root is separation vertex
       DoLog(1) && (Log() << Verbose(1) << "(11) Root is a separation vertex." << endl);
@@ -692,5 +692,5 @@
         if (OtherAtom->type->Z != 1) {
 #endif
-        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);
+        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
         if (BFS.ColorList[OtherAtom->nr] == white) {
           BFS.TouchedStack->Push(OtherAtom);
@@ -698,5 +698,5 @@
           BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
           BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
-          DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
+          DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " lightgray, its predecessor is " << Walker->getName() << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
           //if (BFS.ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance
           DoLog(3) && (Log() << Verbose(3) << "Putting OtherAtom into queue." << endl);
@@ -719,5 +719,5 @@
     }
     BFS.ColorList[Walker->nr] = black;
-    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);
+    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl);
     if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand
       // step through predecessor list
@@ -770,10 +770,10 @@
     Walker = BFS.Root;
     while (Walker != BackEdge->rightatom) {
-      DoLog(0) && (Log() << Verbose(0) << Walker->Name << " <-> ");
+      DoLog(0) && (Log() << Verbose(0) << Walker->getName() << " <-> ");
       Walker = BFS.PredecessorList[Walker->nr];
       Walker->GetTrueFather()->IsCyclic = true;
       RingSize++;
     }
-    DoLog(0) && (Log() << Verbose(0) << Walker->Name << "  with a length of " << RingSize << "." << endl << endl);
+    DoLog(0) && (Log() << Verbose(0) << Walker->getName() << "  with a length of " << RingSize << "." << endl << endl);
     // walk through all and set MinimumRingSize
     Walker = BFS.Root;
@@ -1233,14 +1233,14 @@
   BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor
   BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1;
-  DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
+  DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->getName() << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->getName() << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl);
   if ((((BFS.ShortestPathList[OtherAtom->nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance
     DoLog(3) && (Log() << Verbose(3));
     if (AddedAtomList[OtherAtom->nr] == NULL) { // add if it's not been so far
       AddedAtomList[OtherAtom->nr] = Mol->AddCopyAtom(OtherAtom);
-      DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name);
+      DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->getName());
       AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
       DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ");
     } else { // this code should actually never come into play (all white atoms are not yet present in BondMolecule, that's why they are white in the first place)
-      DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name);
+      DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->getName());
       if (AddedBondList[Binder->nr] == NULL) {
         AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder);
@@ -1322,10 +1322,10 @@
     // followed by n+1 till top of stack.
     Walker = BFS.BFSStack->PopFirst(); // pop oldest added
-    DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl);
+    DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->getName() << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl);
     for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) {
       if ((*Runner) != NULL) { // don't look at bond equal NULL
         Binder = (*Runner);
         OtherAtom = (*Runner)->GetOtherAtom(Walker);
-        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl);
+        DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl);
         if (BFS.ColorList[OtherAtom->nr] == white) {
           BreadthFirstSearchAdd_UnvisitedNode(Mol, BFS, Walker, OtherAtom, Binder, Bond, AddedAtomList, AddedBondList, IsAngstroem);
@@ -1336,5 +1336,5 @@
     }
     BFS.ColorList[Walker->nr] = black;
-    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl);
+    DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->getName() << " black." << endl);
   }
   BreadthFirstSearchAdd_Free(BFS);
@@ -1403,5 +1403,5 @@
           OtherAtom = (*Runner)->GetOtherAtom(Walker);
           if (ParentList[OtherAtom->nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond
-            DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl);
+            DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->getName() << " and " << ParentList[OtherAtom->nr]->getName() << "." << endl);
             mol->AddBond(ParentList[Walker->nr], ParentList[OtherAtom->nr], (*Runner)->BondDegree);
           }
Index: molecuilder/src/moleculelist.cpp
===================================================================
--- molecuilder/src/moleculelist.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/moleculelist.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -677,5 +677,5 @@
     while (Walker->next != (*ListRunner)->end) {
       Walker = Walker->next;
-      DoLog(0) && (Log() << Verbose(0) << Walker->Name << " ");
+      DoLog(0) && (Log() << Verbose(0) << Walker->getName() << " ");
     }
     DoLog(0) && (Log() << Verbose(0) << endl);
Index: molecuilder/src/parser.cpp
===================================================================
--- molecuilder/src/parser.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/parser.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -32,5 +32,5 @@
   if (input == NULL) {
     if (!test)
-      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl);
+      DoLog(0) && (Log() << Verbose(0) << endl << "FilePresent: Unable to open " << filename << ", is the directory correct?" << endl);
     return false;
   }
@@ -160,5 +160,5 @@
   //Log() << Verbose(1) << "Opening " << name << " ... "  << input << endl;
   if (input == NULL) {
-    DoeLog(1) && (eLog()<< Verbose(1) << endl << "Unable to open " << name << ", is the directory correct?" << endl);
+    DoeLog(1) && (eLog()<< Verbose(1) << endl << "MatrixContainer::ParseMatrix: Unable to open " << name << ", is the directory correct?" << endl);
     //performCriticalExit();
     return false;
@@ -269,5 +269,5 @@
   input.open(file.str().c_str(), ios::in);
   if (input == NULL) {
-    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
+    DoLog(0) && (Log() << Verbose(0) << endl << "MatrixContainer::ParseFragmentMatrix: Unable to open " << file.str() << ", is the directory correct?" << endl);
     return false;
   }
@@ -477,5 +477,5 @@
     output.open(line.str().c_str(), ios::out);
     if (output == NULL) {
-      DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open output energy file " << line.str() << "!" << endl);
+      DoeLog(0) && (eLog()<< Verbose(0) << "MatrixContainer::WriteTotalFragments: Unable to open output energy file " << line.str() << "!" << endl);
       performCriticalExit();
       return false;
@@ -507,5 +507,5 @@
   output.open(line.str().c_str(), ios::out);
   if (output == NULL) {
-    DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open output matrix file " << line.str() << "!" << endl);
+    DoeLog(0) && (eLog()<< Verbose(0) << "MatrixContainer::WriteLastMatrix: Unable to open output matrix file " << line.str() << "!" << endl);
     performCriticalExit();
     return false;
@@ -621,5 +621,5 @@
   //Log() << Verbose(0) << "Opening " << line.str() << " ... "  << input << endl;
   if (input == NULL) {
-    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl);
+    DoLog(0) && (Log() << Verbose(0) << endl << "ForceMatrix::ParseIndices: Unable to open " << line.str() << ", is the directory correct?" << endl);
     return false;
   }
@@ -700,5 +700,5 @@
     input.open(file.str().c_str(), ios::in);
     if (input == NULL) {
-      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
+      DoLog(0) && (Log() << Verbose(0) << endl << "ForceMatrix::ParseFragmentMatrix: Unable to open " << file.str() << ", is the directory correct?" << endl);
       return false;
     }
@@ -759,5 +759,5 @@
   //Log() << Verbose(0) << "Opening " << line.str() << " ... "  << input << endl;
   if (input == NULL) {
-    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl);
+    DoLog(0) && (Log() << Verbose(0) << endl << "HessianMatrix::ParseIndices: Unable to open " << line.str() << ", is the directory correct?" << endl);
     return false;
   }
@@ -930,5 +930,5 @@
     input.open(file.str().c_str(), ios::in);
     if (input == NULL) {
-      DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
+      DoLog(0) && (Log() << Verbose(0) << endl << "HessianMatrix::ParseFragmentMatrix: Unable to open " << file.str() << ", is the directory correct?" << endl);
       return false;
     }
@@ -1014,5 +1014,5 @@
   input.open(file.str().c_str(), ios::in);
   if (input == NULL) {
-    DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl);
+    DoLog(0) && (Log() << Verbose(0) << endl << "KeySetsContainer::ParseKeySets: Unable to open " << file.str() << ", is the directory correct?" << endl);
     return false;
   }
Index: molecuilder/src/periodentafel.cpp
===================================================================
--- molecuilder/src/periodentafel.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/periodentafel.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -8,9 +8,11 @@
 
 #include <iomanip>
+#include <iostream>
 #include <fstream>
 #include <cstring>
-#include <cassert>
-
+
+#include "Helpers/Assert.hpp"
 #include "element.hpp"
+#include "elements_db.hpp"
 #include "helpers.hpp"
 #include "lists.hpp"
@@ -27,5 +29,11 @@
  */
 periodentafel::periodentafel()
-{};
+{
+  ASSERT(LoadElementsDatabase(new stringstream(elementsDB,ios_base::in)), "General element initialization failed");
+  ASSERT(LoadValenceDatabase(new stringstream(valenceDB,ios_base::in)), "Valence entry of element initialization failed");
+  ASSERT(LoadOrbitalsDatabase(new stringstream(orbitalsDB,ios_base::in)), "Orbitals entry of element initialization failed");
+  ASSERT(LoadHBondAngleDatabase(new stringstream(HbondangleDB,ios_base::in)), "HBond angle entry of element initialization failed");
+  ASSERT(LoadHBondLengthsDatabase(new stringstream(HbonddistanceDB,ios_base::in)), "HBond distance entry of element initialization failed");
+};
 
 /** destructor for class periodentafel
@@ -39,10 +47,10 @@
 /** Adds element to period table list
  * \param *pointer element to be added
- * \return true - succeeded, false - does not occur
+ * \return iterator to added element
  */
 periodentafel::iterator periodentafel::AddElement(element * const pointer)
 {
   atomicNumber_t Z = pointer->getNumber();
-  assert(!elements.count(Z));
+  ASSERT(!elements.count(Z), "Element is already present.");
   pointer->sort = &pointer->Z;
   if (pointer->getNumber() < 1 && pointer->getNumber() >= MAX_ELEMENTS)
@@ -54,14 +62,19 @@
 /** Removes element from list.
  * \param *pointer element to be removed
- * \return true - succeeded, false - element not found
  */
 void periodentafel::RemoveElement(element * const pointer)
 {
-  atomicNumber_t Z = pointer->getNumber();
+  RemoveElement(pointer->getNumber());
+};
+
+/** Removes element from list.
+ * \param Z element to be removed
+ */
+void periodentafel::RemoveElement(atomicNumber_t Z)
+{
   elements.erase(Z);
 };
 
 /** Removes every element from the period table.
- * \return true - succeeded, false - does not occur
  */
 void periodentafel::CleanupPeriodtable()
@@ -78,5 +91,5 @@
  * \return pointer to element or NULL if not found
  */
-const element * periodentafel::FindElement(atomicNumber_t Z) const
+element * const periodentafel::FindElement(atomicNumber_t Z) const
 {
   const_iterator res = elements.find(Z);
@@ -89,5 +102,5 @@
  * \return pointer to element
  */
-const element * periodentafel::FindElement(const char * const shorthand) const
+element * const periodentafel::FindElement(const char * const shorthand) const
 {
   element *res = 0;
@@ -102,8 +115,9 @@
 
 /** Asks for element number and returns pointer to element
- */
-const element * periodentafel::AskElement() const
-{
-  const element *walker = NULL;
+ * \return desired element or NULL
+ */
+element * const periodentafel::AskElement() const
+{
+  element * walker = NULL;
   int Z;
   do {
@@ -118,16 +132,14 @@
  * \return pointer to either present or newly created element
  */
-const element * periodentafel::EnterElement()
-{
-  const element *res = NULL;
+element * const periodentafel::EnterElement()
+{
   atomicNumber_t Z = 0;
   DoLog(0) && (Log() << Verbose(0) << "Atomic number: " << Z << endl);
   cin >> Z;
-  res = FindElement(Z);
+  element * const res = FindElement(Z);
   if (!res) {
     // TODO: make this using the constructor
-    element *tmp;
     DoLog(0) && (Log() << Verbose(0) << "Element not found in database, please enter." << endl);
-    tmp = new element;
+    element *tmp = new element;
     tmp->Z = Z;
     DoLog(0) && (Log() << Verbose(0) << "Mass: " << endl);
@@ -138,5 +150,5 @@
     cin >> tmp->symbol;
     AddElement(tmp);
-    res = tmp;
+    return tmp;
   }
   return res;
@@ -204,7 +216,5 @@
 bool periodentafel::LoadPeriodentafel(const char *path)
 {
-  ifstream infile;
-  element *ptr;
-  map<atomicNumber_t,element*> parsedElems;
+  ifstream input;
   bool status = true;
   bool otherstatus = true;
@@ -215,34 +225,83 @@
   strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
   strncat(filename, STANDARDELEMENTSDB, MAXSTRINGSIZE-strlen(filename));
-  infile.open(filename);
-  if (infile != NULL) {
-    infile.getline(header1, MAXSTRINGSIZE);
-    infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines
+  input.open(filename);
+  status = status && LoadElementsDatabase(&input);
+
+  // fill valence DB per element
+  strncpy(filename, path, MAXSTRINGSIZE);
+  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
+  strncat(filename, STANDARDVALENCEDB, MAXSTRINGSIZE-strlen(filename));
+  input.open(filename);
+  otherstatus = otherstatus && LoadValenceDatabase(&input);
+
+  // fill orbitals DB per element
+  strncpy(filename, path, MAXSTRINGSIZE);
+  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
+  strncat(filename, STANDARDORBITALDB, MAXSTRINGSIZE-strlen(filename));
+  input.open(filename);
+  otherstatus = otherstatus && LoadOrbitalsDatabase(&input);
+
+  // fill H-BondAngle DB per element
+  strncpy(filename, path, MAXSTRINGSIZE);
+  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
+  strncat(filename, STANDARDHBONDANGLEDB, MAXSTRINGSIZE-strlen(filename));
+  input.open(filename);
+  otherstatus = otherstatus && LoadHBondAngleDatabase(&input);
+
+  // fill H-BondDistance DB per element
+  strncpy(filename, path, MAXSTRINGSIZE);
+  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
+  strncat(filename, STANDARDHBONDDISTANCEDB, MAXSTRINGSIZE-strlen(filename));
+  input.open(filename);
+  otherstatus = otherstatus && LoadHBondLengthsDatabase(&input);
+
+  if (!otherstatus){
+    DoeLog(2) && (eLog()<< Verbose(2) << "Something went wrong while parsing the other databases!" << endl);
+  }
+
+  return status;
+};
+
+/** load the element info.
+ * \param *input stream to parse from
+ * \return true - parsing successful, false - something went wrong
+ */
+bool periodentafel::LoadElementsDatabase(istream *input)
+{
+  if ((*input) != NULL) {
+    (*input).getline(header1, MAXSTRINGSIZE);
+    (*input).getline(header2, MAXSTRINGSIZE); // skip first two header lines
     DoLog(0) && (Log() << Verbose(0) <<  "Parsed elements:");
-    while (!infile.eof()) {
+    while (!(*input).eof()) {
       element *neues = new element;
-      infile >> neues->name;
-      //infile >> ws;
-      infile >> neues->symbol;
-      //infile >> ws;
-      infile >> neues->period;
-      //infile >> ws;
-      infile >> neues->group;
-      //infile >> ws;
-      infile >> neues->block;
-      //infile >> ws;
-      infile >> neues->Z;
-      //infile >> ws;
-      infile >> neues->mass;
-      //infile >> ws;
-      infile >> neues->CovalentRadius;
-      //infile >> ws;
-      infile >> neues->VanDerWaalsRadius;
-      //infile >> ws;
-      infile >> ws;
+      (*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;
       DoLog(0) && (Log() << Verbose(0) << " " << neues->symbol);
+      if (elements.count(neues->Z)) {// if element already present, remove and delete it
+        element * const Elemental = FindElement(neues->Z);
+        ASSERT(Elemental != NULL, "element should be present but is not??");
+        RemoveElement(Elemental);
+        delete(Elemental);
+      }
       //neues->Output((ofstream *)&cout);
       if ((neues->Z > 0) && (neues->Z < MAX_ELEMENTS))
-        parsedElems[neues->getNumber()] = neues;
+        elements[neues->getNumber()] = neues;
       else {
         DoLog(0) && (Log() << Verbose(0) << "Could not parse element: ");
@@ -252,106 +311,104 @@
     }
     DoLog(0) && (Log() << Verbose(0) << endl);
-    infile.close();
-    infile.clear();
-  } else
-    status = false;
-
-  // fill valence DB per element
-  strncpy(filename, path, MAXSTRINGSIZE);
-  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
-  strncat(filename, STANDARDVALENCEDB, MAXSTRINGSIZE-strlen(filename));
-  infile.open(filename);
-  if (infile != NULL) {
-    while (!infile.eof()) {
+    return true;
+  } else
+    return false;
+}
+
+/** load the valence info.
+ * \param *input stream to parse from
+ * \return true - parsing successful, false - something went wrong
+ */
+bool periodentafel::LoadValenceDatabase(istream *input)
+{
+  char dummy[MAXSTRINGSIZE];
+  if ((*input) != NULL) {
+    (*input).getline(dummy, MAXSTRINGSIZE);
+    while (!(*input).eof()) {
       atomicNumber_t Z;
-      infile >> Z;
-      infile >> ws;
-      infile >> parsedElems[Z]->Valence;
-      infile >> ws;
+      (*input) >> Z;
+      ASSERT(elements.count(Z), "Element not present");
+      (*input) >> ws;
+      (*input) >> elements[Z]->Valence;
+      (*input) >> ws;
       //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl;
     }
-    infile.close();
-    infile.clear();
-  } else
-    otherstatus = false;
-
-  // fill valence DB per element
-  strncpy(filename, path, MAXSTRINGSIZE);
-  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
-  strncat(filename, STANDARDORBITALDB, MAXSTRINGSIZE-strlen(filename));
-  infile.open(filename);
-  if (infile != NULL) {
-    while (!infile.eof()) {
+    return true;
+  } else
+		return false;
+}
+
+/** load the orbitals info.
+ * \param *input stream to parse from
+ * \return true - parsing successful, false - something went wrong
+ */
+bool periodentafel::LoadOrbitalsDatabase(istream *input)
+{
+  char dummy[MAXSTRINGSIZE];
+  if ((*input) != NULL) {
+    (*input).getline(dummy, MAXSTRINGSIZE);
+    while (!(*input).eof()) {
       atomicNumber_t Z;
-      infile >> Z;
-      infile >> ws;
-      infile >> parsedElems[Z]->NoValenceOrbitals;
-      infile >> ws;
+      (*input) >> Z;
+      ASSERT(elements.count(Z), "Element not present");
+      (*input) >> ws;
+      (*input) >> elements[Z]->NoValenceOrbitals;
+      (*input) >> ws;
       //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl;
     }
-    infile.close();
-    infile.clear();
-  } else
-    otherstatus = false;
-
-  // fill H-BondDistance DB per element
-  strncpy(filename, path, MAXSTRINGSIZE);
-  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
-  strncat(filename, STANDARDHBONDDISTANCEDB, MAXSTRINGSIZE-strlen(filename));
-  infile.open(filename);
-  if (infile != NULL) {
-    while (!infile.eof()) {
+    return true;
+  } else
+    return false;
+}
+
+/** load the hbond angles info.
+ * \param *input stream to parse from
+ * \return true - parsing successful, false - something went wrong
+ */
+bool periodentafel::LoadHBondAngleDatabase(istream *input)
+{
+  char dummy[MAXSTRINGSIZE];
+  if ((*input) != NULL) {
+    (*input).getline(dummy, MAXSTRINGSIZE);
+    while (!(*input).eof()) {
       atomicNumber_t Z;
-      infile >> Z;
-      ptr = parsedElems[Z];
-      infile >> ws;
-      infile >> ptr->HBondDistance[0];
-      infile >> ptr->HBondDistance[1];
-      infile >> ptr->HBondDistance[2];
-      infile >> ws;
+      (*input) >> Z;
+      ASSERT(elements.count(Z), "Element not present");
+      (*input) >> ws;
+      (*input) >> elements[Z]->HBondAngle[0];
+      (*input) >> elements[Z]->HBondAngle[1];
+      (*input) >> elements[Z]->HBondAngle[2];
+      (*input) >> ws;
+      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondAngle[0] << ", " << FindElement((int)tmp)->HBondAngle[1] << ", " << FindElement((int)tmp)->HBondAngle[2] << " degrees bond angle for one, two, three connected hydrogens." << endl;
+    }
+    return true;
+  } else
+		return false;
+}
+
+/** load the hbond lengths info.
+ * \param *input stream to parse from
+ * \return true - parsing successful, false - something went wrong
+ */
+bool periodentafel::LoadHBondLengthsDatabase(istream *input)
+{
+  char dummy[MAXSTRINGSIZE];
+  if ((*input) != NULL) {
+    (*input).getline(dummy, MAXSTRINGSIZE);
+    while (!(*input).eof()) {
+      atomicNumber_t Z;
+      (*input) >> Z;
+      ASSERT(elements.count(Z), "Element not present");
+      (*input) >> ws;
+      (*input) >> elements[Z]->HBondDistance[0];
+      (*input) >> elements[Z]->HBondDistance[1];
+      (*input) >> elements[Z]->HBondDistance[2];
+      (*input) >> ws;
       //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondDistance[0] << " Angstrom typical distance to hydrogen." << endl;
     }
-    infile.close();
-    infile.clear();
-  } else
-    otherstatus = false;
-
-  // fill H-BondAngle DB per element
-  strncpy(filename, path, MAXSTRINGSIZE);
-  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
-  strncat(filename, STANDARDHBONDANGLEDB, MAXSTRINGSIZE-strlen(filename));
-  infile.open(filename);
-  if (infile != NULL) {
-    while (!infile.eof()) {
-      atomicNumber_t Z;
-      infile >> Z;
-      ptr = parsedElems[Z];
-      infile >> ws;
-      infile >> ptr->HBondAngle[0];
-      infile >> ptr->HBondAngle[1];
-      infile >> ptr->HBondAngle[2];
-      infile >> ws;
-      //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondAngle[0] << ", " << FindElement((int)tmp)->HBondAngle[1] << ", " << FindElement((int)tmp)->HBondAngle[2] << " degrees bond angle for one, two, three connected hydrogens." << endl;
-    }
-    infile.close();
-  } else
-    otherstatus = false;
-
-  if (otherstatus){
-    map<atomicNumber_t,element*>::iterator iter;
-    for(iter=parsedElems.begin();iter!=parsedElems.end();++iter){
-      AddElement((*iter).second);
-    }
-  }
-  else{
-    DoeLog(2) && (eLog()<< Verbose(2) << "Something went wrong while parsing the other databases!" << endl);
-    map<atomicNumber_t,element*>::iterator iter;
-    for(iter=parsedElems.begin();iter!=parsedElems.end();++iter){
-      AddElement((*iter).second);
-    }
-  }
-
-  return status;
-};
+    return true;
+  } else
+		return false;
+}
 
 /** Stores element list to file.
@@ -374,6 +431,6 @@
     }
     f.close();
-  } else
-    result = false;
-  return result;
-};
+    return true;
+  } else
+    return result;
+};
Index: molecuilder/src/periodentafel.hpp
===================================================================
--- molecuilder/src/periodentafel.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/periodentafel.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -13,4 +13,5 @@
 #include <iterator>
 
+#include "unittests/periodentafelTest.hpp"
 #include "defs.hpp"
 #include "types.hpp"
@@ -27,4 +28,5 @@
 class periodentafel {
   /******* Types *********/
+  friend class periodentafelTest;
   private:
     typedef std::map<atomicNumber_t,element*> elementSet;
@@ -43,9 +45,10 @@
   iterator AddElement(element * const pointer);
   void RemoveElement(element * const pointer);
+  void RemoveElement(atomicNumber_t);
   void CleanupPeriodtable();
-  const element *FindElement(atomicNumber_t) const;
-  const element *FindElement(const char * const shorthand) const;
-  const element *AskElement() const;
-  const element *EnterElement();
+  element * const FindElement(atomicNumber_t) const;
+  element * const FindElement(const char * const shorthand) const;
+  element * const AskElement() const;
+  element * const EnterElement();
 
   const_iterator begin();
@@ -59,4 +62,11 @@
 
   private:
+
+  bool LoadElementsDatabase(std::istream *input);
+  bool LoadValenceDatabase(std::istream *input);
+  bool LoadOrbitalsDatabase(std::istream *input);
+  bool LoadHBondAngleDatabase(std::istream *input);
+  bool LoadHBondLengthsDatabase(std::istream *input);
+
     elementSet elements;
 };
Index: molecuilder/src/tesselation.cpp
===================================================================
--- molecuilder/src/tesselation.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/tesselation.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -83,5 +83,5 @@
 ostream & operator <<(ostream &ost, const BoundaryPointSet &a)
 {
-  ost << "[" << a.Nr << "|" << a.node->Name << " at " << *a.node->node << "]";
+  ost << "[" << a.Nr << "|" << a.node->getName() << " at " << *a.node->node << "]";
   return ost;
 }
@@ -321,5 +321,5 @@
 ostream & operator <<(ostream &ost, const BoundaryLineSet &a)
 {
-  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << "," << a.endpoints[1]->node->Name << " at " << *a.endpoints[1]->node->node << "]";
+  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->getName() << " at " << *a.endpoints[0]->node->node << "," << a.endpoints[1]->node->getName() << " at " << *a.endpoints[1]->node->node << "]";
   return ost;
 }
@@ -688,5 +688,5 @@
 ostream &operator <<(ostream &ost, const BoundaryTriangleSet &a)
 {
-  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << "," << a.endpoints[1]->node->Name << "," << a.endpoints[2]->node->Name << "]";
+  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->getName() << "," << a.endpoints[1]->node->getName() << "," << a.endpoints[2]->node->getName() << "]";
   //  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << ","
   //      << a.endpoints[1]->node->Name << " at " << *a.endpoints[1]->node->node << "," << a.endpoints[2]->node->Name << " at " << *a.endpoints[2]->node->node << "]";
@@ -948,5 +948,5 @@
   ost << "[" << a.Nr << "|";
   for (PointSet::const_iterator Runner = a.endpoints.begin(); Runner != a.endpoints.end();) {
-    ost << (*Runner)->node->Name;
+    ost << (*Runner)->node->getName();
     Runner++;
     if (Runner != a.endpoints.end())
@@ -967,5 +967,4 @@
   node = NULL;
   nr = -1;
-  Name = NULL;
 }
 ;
@@ -983,5 +982,5 @@
 ostream & operator <<(ostream &ost, const TesselPoint &a)
 {
-  ost << "[" << (a.Name) << "|" << a.Name << " at " << *a.node << "]";
+  ost << "[" << a.getName() << "|" << *a.node << "]";
   return ost;
 }
@@ -1135,5 +1134,5 @@
 ostream & operator <<(ostream &ost, const CandidateForTesselation &a)
 {
-  ost << "[" << a.BaseLine->Nr << "|" << a.BaseLine->endpoints[0]->node->Name << "," << a.BaseLine->endpoints[1]->node->Name << "] with ";
+  ost << "[" << a.BaseLine->Nr << "|" << a.BaseLine->endpoints[0]->node->getName() << "," << a.BaseLine->endpoints[1]->node->getName() << "] with ";
   if (a.pointlist.empty())
     ost << "no candidate.";
@@ -1348,13 +1347,13 @@
       if (fabs(distance) < 1e-4) // we need to have a small epsilon around 0 which is still ok
         continue;
-      DoLog(2) && (Log() << Verbose(2) << "Projection of " << checker->second->node->Name << " yields distance of " << distance << "." << endl);
+      DoLog(2) && (Log() << Verbose(2) << "Projection of " << checker->second->node->getName() << " yields distance of " << distance << "." << endl);
       tmp = distance / fabs(distance);
       // 4b. Any have different sign to than before? (i.e. would lie outside convex hull with this starting triangle)
       if ((sign != 0) && (tmp != sign)) {
         // 4c. If so, break 4. loop and continue with next candidate in 1. loop
-        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leaves " << checker->second->node->Name << " outside the convex hull." << endl);
+        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->getName() << "," << baseline->second.first->second->node->getName() << "," << baseline->second.second->second->node->getName() << " leaves " << checker->second->node->getName() << " outside the convex hull." << endl);
         break;
       } else { // note the sign for later
-        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leave " << checker->second->node->Name << " inside the convex hull." << endl);
+        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->getName() << "," << baseline->second.first->second->node->getName() << "," << baseline->second.second->second->node->getName() << " leave " << checker->second->node->getName() << " inside the convex hull." << endl);
         sign = tmp;
       }
@@ -4292,5 +4291,5 @@
         DoLog(2) && (Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl);
         DoLog(2) && (Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl);
-        DoLog(1) && (Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->Name << ", " << (*MiddleNode)->Name << " and " << (*EndNode)->Name << "." << endl);
+        DoLog(1) && (Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->getName() << ", " << (*MiddleNode)->getName() << " and " << (*EndNode)->getName() << "." << endl);
         TriangleCandidates[0] = *StartNode;
         TriangleCandidates[1] = *MiddleNode;
@@ -4714,5 +4713,5 @@
     return;
   }
-  DoLog(0) && (Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->Name << "." << endl);
+  DoLog(0) && (Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->getName() << "." << endl);
 
   // go through its lines and find the best one to split
@@ -4799,8 +4798,10 @@
   ofstream *tempstream = NULL;
   string NameofTempFile;
-  char NumberName[255];
+  string NumberName;
 
   if (LastTriangle != NULL) {
-    sprintf(NumberName, "-%04d-%s_%s_%s", (int) TrianglesOnBoundary.size(), LastTriangle->endpoints[0]->node->Name, LastTriangle->endpoints[1]->node->Name, LastTriangle->endpoints[2]->node->Name);
+    stringstream sstr;
+    sstr << "-"<< TrianglesOnBoundary.size() << "-" << LastTriangle->endpoints[0]->node->getName() << "_" << LastTriangle->endpoints[1]->node->getName() << "_" << LastTriangle->endpoints[2]->node->getName();
+    NumberName = sstr.str();
     if (DoTecplotOutput) {
       string NameofTempFile(filename);
Index: molecuilder/src/tesselationhelpers.cpp
===================================================================
--- molecuilder/src/tesselationhelpers.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/tesselationhelpers.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -829,5 +829,5 @@
       if (TesselStruct->LastTriangle != NULL) {
         for (int i=0;i<3;i++)
-          *tecplot << (i==0 ? "" : "_") << TesselStruct->LastTriangle->endpoints[i]->node->Name;
+          *tecplot << (i==0 ? "" : "_") << TesselStruct->LastTriangle->endpoints[i]->node->getName();
       } else {
         *tecplot << "none";
@@ -852,5 +852,5 @@
     DoLog(1) && (Log() << Verbose(1) << "The following triangles were created:" << endl);
     for (TriangleMap::const_iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) {
-      DoLog(1) && (Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl);
+      DoLog(1) && (Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->getName() << "<->" << runner->second->endpoints[1]->node->getName() << "<->" << runner->second->endpoints[2]->node->getName() << endl);
       *tecplot << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl;
     }
Index: molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp
===================================================================
--- molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -17,12 +17,9 @@
 #include "AnalysisCorrelationToPointUnitTest.hpp"
 
-#include "World.hpp"
 #include "atom.hpp"
-#include "boundary.hpp"
 #include "element.hpp"
 #include "molecule.hpp"
 #include "linkedcell.hpp"
 #include "periodentafel.hpp"
-#include "tesselation.hpp"
 #include "World.hpp"
 
@@ -43,22 +40,11 @@
   TestList = NULL;
   TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
   pointmap = NULL;
   binmap = NULL;
   point = NULL;
 
-  // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-
   // construct molecule (tetraeder of hydrogens)
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
   TestMolecule = World::getInstance().createMolecule();
   Walker = World::getInstance().createAtom();
Index: molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.hpp
===================================================================
--- molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -12,9 +12,6 @@
 
 class element;
-class LinkedCell;
 class molecule;
 class MoleculeListClass;
-class periodentafel;
-class Tesselation;
 class Vector;
 
@@ -40,6 +37,5 @@
       MoleculeListClass *TestList;
       molecule *TestMolecule;
-      element *hydrogen;
-      periodentafel *tafel;
+      const element *hydrogen;
 
       CorrelationToPointMap *pointmap;
Index: molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
===================================================================
--- molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -17,5 +17,4 @@
 #include "AnalysisCorrelationToSurfaceUnitTest.hpp"
 
-#include "World.hpp"
 #include "atom.hpp"
 #include "boundary.hpp"
@@ -47,6 +46,4 @@
   TestList = NULL;
   TestSurfaceMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
   surfacemap = NULL;
   binmap = NULL;
@@ -54,20 +51,6 @@
   LC = NULL;
 
-  // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-  carbon = new element;
-  carbon->Z = 6;
-  strcpy(carbon->name, "carbon");
-  strcpy(carbon->symbol, "C");
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-  tafel->AddElement(carbon);
-
   // construct molecule (tetraeder of hydrogens) base
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
   TestSurfaceMolecule = World::getInstance().createMolecule();
   Walker = World::getInstance().createAtom();
@@ -102,4 +85,5 @@
 
   // add outer atoms
+  carbon = World::getInstance().getPeriode()->FindElement(6);
   TestSurfaceMolecule = World::getInstance().createMolecule();
   Walker = World::getInstance().createAtom();
Index: molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp
===================================================================
--- molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -45,7 +45,6 @@
       MoleculeListClass *TestList;
       molecule *TestSurfaceMolecule;
-      element *hydrogen;
-      element *carbon;
-      periodentafel *tafel;
+      const element *hydrogen;
+      const element *carbon;
 
       CorrelationToSurfaceMap *surfacemap;
Index: molecuilder/src/unittests/AnalysisPairCorrelationUnitTest.cpp
===================================================================
--- molecuilder/src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -44,20 +44,9 @@
   TestList = NULL;
   TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
   correlationmap = NULL;
   binmap = NULL;
 
-  // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-
   // construct molecule (tetraeder of hydrogens)
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
   TestMolecule = World::getInstance().createMolecule();
   Walker = World::getInstance().createAtom();
Index: molecuilder/src/unittests/AnalysisPairCorrelationUnitTest.hpp
===================================================================
--- molecuilder/src/unittests/AnalysisPairCorrelationUnitTest.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/AnalysisPairCorrelationUnitTest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -12,9 +12,6 @@
 
 class element;
-class LinkedCell;
 class molecule;
 class MoleculeListClass;
-class periodentafel;
-class Tesselation;
 class Vector;
 
@@ -40,6 +37,5 @@
       MoleculeListClass *TestList;
       molecule *TestMolecule;
-      element *hydrogen;
-      periodentafel *tafel;
+      const element *hydrogen;
 
       PairCorrelationMap *correlationmap;
Index: molecuilder/src/unittests/CountBondsUnitTest.cpp
===================================================================
--- molecuilder/src/unittests/CountBondsUnitTest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/CountBondsUnitTest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -16,4 +16,6 @@
 #include <stdio.h>
 #include <cstring>
+
+#include "Helpers/Assert.hpp"
 
 #include "analysis_bonds.hpp"
@@ -40,43 +42,26 @@
 {
   atom *Walker = NULL;
-  BG = NULL;
-  filename = NULL;
-
-  // init private all pointers to zero
-  molecules = NULL;
-  TestMolecule1 = NULL;
-  TestMolecule2 = NULL;
-  hydrogen = NULL;
-  oxygen = NULL;
-  tafel = NULL;
 
   // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  hydrogen->CovalentRadius = 0.23;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-  oxygen = new element;
-  oxygen->Z = 8;
-  oxygen->CovalentRadius = 0.68;
-  strcpy(oxygen->name, "oxygen");
-  strcpy(oxygen->symbol, "O");
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-  tafel->AddElement(oxygen);
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  oxygen = World::getInstance().getPeriode()->FindElement(8);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
+  CPPUNIT_ASSERT(oxygen != NULL && "could not find element oxygen");
 
   // construct molecule (water molecule)
   TestMolecule1 = World::getInstance().createMolecule();
-  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(TestMolecule1 != NULL && "could not create first molecule");
+  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(-0.2418, 0.9350, 0. );
   TestMolecule1->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0.9658, 0., 0. );
   TestMolecule1->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = oxygen;
   *Walker->node = Vector(0., 0., 0. );
@@ -84,13 +69,17 @@
 
   TestMolecule2 = World::getInstance().createMolecule();
-  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(TestMolecule2 != NULL && "could not create second molecule");
+  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(-0.2418, 0.9350, 0. );
   TestMolecule2->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0.9658, 0., 0. );
   TestMolecule2->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = oxygen;
   *Walker->node = Vector(0., 0., 0. );
@@ -98,4 +87,5 @@
 
   molecules = World::getInstance().getMolecules();
+  CPPUNIT_ASSERT(molecules != NULL && "could not obtain list of molecules");
   molecules->insert(TestMolecule1);
   molecules->insert(TestMolecule2);
@@ -111,4 +101,5 @@
   // create a small file with table
   BG = new BondGraph(true);
+  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
 
   // construct bond graphs
@@ -158,4 +149,5 @@
 {
   double *mirror = new double[3];
+  CPPUNIT_ASSERT(mirror != NULL && "could not create array of doubles");
   for (int i=0;i<3;i++)
     mirror[i] = -1.;
Index: molecuilder/src/unittests/CountBondsUnitTest.hpp
===================================================================
--- molecuilder/src/unittests/CountBondsUnitTest.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/CountBondsUnitTest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -39,7 +39,6 @@
       molecule *TestMolecule1;
       molecule *TestMolecule2;
-      element *hydrogen;
-      element *oxygen;
-      periodentafel *tafel;
+      const element *hydrogen;
+      const element *oxygen;
 
       BondGraph *BG;
Index: molecuilder/src/unittests/LinkedCellUnitTest.cpp
===================================================================
--- molecuilder/src/unittests/LinkedCellUnitTest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/LinkedCellUnitTest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -38,26 +38,16 @@
   atom *Walker = NULL;
 
-  // init private all pointers to zero
-  TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
-
   // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  hydrogen->CovalentRadius = 0.23;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
 
   // construct molecule (water molecule)
   TestMolecule = World::getInstance().createMolecule();
+  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
   for (double x=0.5;x<3;x+=1.)
     for (double y=0.5;y<3;y+=1.)
       for (double z=0.5;z<3;z+=1.) {
         Walker = World::getInstance().createAtom();
+        CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
         Walker->type = hydrogen;
         *Walker->node = Vector(x, y, z );
@@ -67,4 +57,5 @@
   // construct linked cell
   LC = new LinkedCell (TestMolecule, 1.);
+  CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell");
 
   // check that TestMolecule was correctly constructed
@@ -205,6 +196,5 @@
   // check internal vectors, returns false, because this atom is not in LC-list!
   Walker = World::getInstance().createAtom();
-  Walker->Name = Malloc<char>(6, "LinkedCellTest::SetIndexToNodeTest - Walker");
-  strcpy(Walker->Name, "test");
+  Walker->setName("test");
   Walker->x= Vector(1,1,1);
   CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) );
@@ -213,6 +203,5 @@
   // check out of bounds vectors
   Walker = World::getInstance().createAtom();
-  Walker->Name = Malloc<char>(6, "LinkedCellTest::SetIndexToNodeTest - Walker");
-  strcpy(Walker->Name, "test");
+  Walker->setName("test");
   Walker->x = Vector(0,-1,0);
   CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) );
Index: molecuilder/src/unittests/LinkedCellUnitTest.hpp
===================================================================
--- molecuilder/src/unittests/LinkedCellUnitTest.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/LinkedCellUnitTest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -48,6 +48,5 @@
 
       molecule *TestMolecule;
-      element *hydrogen;
-      periodentafel *tafel;
+      const element *hydrogen;
       LinkedCell *LC;
 };
Index: molecuilder/src/unittests/Makefile.am
===================================================================
--- molecuilder/src/unittests/Makefile.am	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/Makefile.am	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -33,7 +33,8 @@
   MemoryAllocatorUnitTest \
   MoleculeDescriptorTest \
-  PlaneUnittest \
   ObserverTest \
   ParserUnitTest \
+  periodentafelTest \
+  PlaneUnittest \
   SingletonTest \
   StackClassUnitTest \
@@ -75,7 +76,8 @@
   memoryusageobserverunittest.cpp \
   MoleculeDescriptorTest.cpp \
-  PlaneUnittest.cpp \
   ObserverTest.cpp \
   ParserUnitTest.cpp \
+  periodentafelTest.cpp \
+  PlaneUnittest.cpp \
   SingletonTest.cpp \
   stackclassunittest.cpp \
@@ -109,4 +111,5 @@
   memoryusageobserverunittest.hpp \
   MoleculeDescriptorTest.hpp \
+  periodentafelTest.hpp \
   PlaneUnittest.hpp \
   ObserverTest.hpp \
@@ -194,4 +197,7 @@
 ParserUnitTest_LDADD = ${ALLLIBS}
 
+periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp
+periodentafelTest_LDADD = ${ALLLIBS}
+
 PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp
 PlaneUnittest_LDADD = ${ALLLIBS}
Index: molecuilder/src/unittests/ParserUnitTest.cpp
===================================================================
--- molecuilder/src/unittests/ParserUnitTest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/ParserUnitTest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -31,13 +31,5 @@
 
 void ParserUnitTest::setUp() {
-  element* oxygen = new element();
-  oxygen->symbol[0] = 'O';
-  oxygen->Z = 8;
-  World::getInstance().getPeriode()->AddElement(oxygen);
-
-  element* hydrogen = new element();
-  hydrogen->symbol[0] = 'H';
-  hydrogen->Z = 1;
-  World::getInstance().getPeriode()->AddElement(hydrogen);
+  World::getInstance();
 }
 
Index: molecuilder/src/unittests/analysisbondsunittest.cpp
===================================================================
--- molecuilder/src/unittests/analysisbondsunittest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/analysisbondsunittest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -40,48 +40,35 @@
   atom *Walker = NULL;
 
-  // init private all pointers to zero
-  TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
-
-  // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  hydrogen->Valence = 1;
-  hydrogen->NoValenceOrbitals = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-  carbon = new element;
-  carbon->Z = 2;
-  carbon->Valence = 4;
-  carbon->NoValenceOrbitals = 4;
-  strcpy(carbon->name, "carbon");
-  strcpy(carbon->symbol, "C");
-
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-  tafel->AddElement(carbon);
+  // get elements
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  carbon = World::getInstance().getPeriode()->FindElement(6);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
+  CPPUNIT_ASSERT(carbon != NULL && "could not find element carbon");
 
   // construct molecule (tetraeder of hydrogens)
   TestMolecule = World::getInstance().createMolecule();
+  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(1.5, 0., 1.5 );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 1.5, 1.5 );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(1.5, 1.5, 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 0., 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(0.5, 0.5, 0.5 );
@@ -93,15 +80,21 @@
   // create a small file with table
   filename = new string("test.dat");
+  CPPUNIT_ASSERT(filename != NULL && "could not create string");
   ofstream test(filename->c_str());
-  test << ".\tH\tC\n";
-  test << "H\t1.\t1.2\n";
-  test << "C\t1.2\t1.5\n";
+  test << ".\tH\tHe\tLi\tBe\tB\tC\n";
+  test << "H\t1.\t1.\t1.\t1.\t1.\t1.2\n";
+  test << "He\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "Li\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "Be\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "B\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "C\t1.2\t1.\t1.\t1.\t1.\t1.5\n";
   test.close();
   BG = new BondGraph(true);
+  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
 
   CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
   CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) );
-  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) );
-  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(1,1) );
+  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,5) );
+  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
 
   BG->ConstructBondGraph(TestMolecule);
Index: molecuilder/src/unittests/analysisbondsunittest.hpp
===================================================================
--- molecuilder/src/unittests/analysisbondsunittest.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/analysisbondsunittest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -34,7 +34,6 @@
 
       molecule *TestMolecule;
-      element *hydrogen;
-      element *carbon;
-      periodentafel *tafel;
+      const element *hydrogen;
+      const element *carbon;
 
       BondGraph *BG;
Index: molecuilder/src/unittests/bondgraphunittest.cpp
===================================================================
--- molecuilder/src/unittests/bondgraphunittest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/bondgraphunittest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -15,4 +15,6 @@
 #include <stdio.h>
 #include <cstring>
+
+#include "Helpers/Assert.hpp"
 
 #include "World.hpp"
@@ -41,32 +43,15 @@
   atom *Walker = NULL;
 
-  // init private all pointers to zero
-  TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
-
   // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  hydrogen->CovalentRadius = 0.23;
-  hydrogen->VanDerWaalsRadius = 1.09;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-  carbon = new element;
-  carbon->Z = 2;
-  carbon->CovalentRadius = 0.68;
-  carbon->VanDerWaalsRadius = 1.7;
-  strcpy(carbon->name, "carbon");
-  strcpy(carbon->symbol, "C");
-
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
-  tafel->AddElement(carbon);
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  carbon = World::getInstance().getPeriode()->FindElement(6);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
+  CPPUNIT_ASSERT(carbon != NULL && "could not find element carbon");
 
   // construct molecule (tetraeder of hydrogens)
   TestMolecule = World::getInstance().createMolecule();
+  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(1., 0., 1. );
@@ -74,4 +59,5 @@
 
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(0., 1., 1. );
@@ -79,4 +65,5 @@
 
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(1., 1., 0. );
@@ -84,4 +71,5 @@
 
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = carbon;
   *Walker->node = Vector(0., 0., 0. );
@@ -93,11 +81,18 @@
   // create a small file with table
   dummyname = new string("dummy.dat");
+  CPPUNIT_ASSERT(dummyname != NULL && "could not create string");
   filename = new string("test.dat");
+  CPPUNIT_ASSERT(filename != NULL && "could not create string");
   ofstream test(filename->c_str());
-  test << ".\tH\tC\n";
-  test << "H\t1.\t1.2\n";
-  test << "C\t1.2\t1.5\n";
+  test << ".\tH\tHe\tLi\tBe\tB\tC\n";
+  test << "H\t1.\t1.\t1.\t1.\t1.\t1.2\n";
+  test << "He\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "Li\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "Be\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "B\t1.\t1.\t1.\t1.\t1.\t1.\n";
+  test << "C\t1.2\t1.\t1.\t1.\t1.\t1.5\n";
   test.close();
   BG = new BondGraph(true);
+  CPPUNIT_ASSERT(BG != NULL && "could not create BondGraph");
 };
 
@@ -126,6 +121,6 @@
   CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
   CPPUNIT_ASSERT_EQUAL( 1., BG->GetBondLength(0,0) );
-  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,1) );
-  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(1,1) );
+  CPPUNIT_ASSERT_EQUAL( 1.2, BG->GetBondLength(0,5) );
+  CPPUNIT_ASSERT_EQUAL( 1.5, BG->GetBondLength(5,5) );
 };
 
Index: molecuilder/src/unittests/bondgraphunittest.hpp
===================================================================
--- molecuilder/src/unittests/bondgraphunittest.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/bondgraphunittest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -37,7 +37,6 @@
 
       molecule *TestMolecule;
-      element *hydrogen;
-      element *carbon;
-      periodentafel *tafel;
+      const element *hydrogen;
+      const element *carbon;
 
       BondGraph *BG;
Index: molecuilder/src/unittests/listofbondsunittest.cpp
===================================================================
--- molecuilder/src/unittests/listofbondsunittest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/listofbondsunittest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -38,35 +38,28 @@
   atom *Walker = NULL;
 
-  // init private all pointers to zero
-  TestMolecule = NULL;
-  hydrogen = NULL;
-  tafel = NULL;
-
   // construct element
-  hydrogen = new element;
-  hydrogen->Z = 1;
-  strcpy(hydrogen->name, "hydrogen");
-  strcpy(hydrogen->symbol, "H");
-
-
-  // construct periodentafel
-  tafel = World::getInstance().getPeriode();
-  tafel->AddElement(hydrogen);
+  hydrogen = World::getInstance().getPeriode()->FindElement(1);
+  CPPUNIT_ASSERT(hydrogen != NULL && "could not find element hydrogen");
 
   // construct molecule (tetraeder of hydrogens)
   TestMolecule = World::getInstance().createMolecule();
-  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(TestMolecule != NULL && "could not create molecule");
+  Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
+  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
   Walker->type = hydrogen;
   *Walker->node = Vector(0., 0., 0. );
@@ -75,5 +68,4 @@
   // check that TestMolecule was correctly constructed
   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
-
 };
 
Index: molecuilder/src/unittests/listofbondsunittest.hpp
===================================================================
--- molecuilder/src/unittests/listofbondsunittest.hpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/listofbondsunittest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -41,6 +41,5 @@
 
       molecule *TestMolecule;
-      element *hydrogen;
-      periodentafel *tafel;
+      const element *hydrogen;
 };
 
Index: molecuilder/src/unittests/periodentafelTest.cpp
===================================================================
--- molecuilder/src/unittests/periodentafelTest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/unittests/periodentafelTest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,78 @@
+/*
+ * periodentafelTest.cpp
+ *
+ *  Created on: May 18, 2010
+ *      Author: heber
+ */
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "Helpers/Assert.hpp"
+
+#include "World.hpp"
+#include "periodentafelTest.hpp"
+#include "element.hpp"
+#include "elements_db.hpp"
+#include "periodentafel.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( periodentafelTest );
+
+
+void periodentafelTest::setUp()
+{
+  // make sure world is present
+  tafel = World::getInstance().getPeriode();
+  CPPUNIT_ASSERT(tafel != NULL && "could not obtain periodentafel");
+};
+
+
+void periodentafelTest::tearDown()
+{
+  World::purgeInstance();
+};
+
+/** UnitTest for AddRemoveTest().
+ */
+void periodentafelTest::AddRemoveTest()
+{
+  // copy the element
+  const element * ElementPtr = tafel->FindElement(3);
+  CPPUNIT_ASSERT( ElementPtr != NULL && "could not find element lithium");
+  element *Elemental = new element(*ElementPtr);
+  // remove element
+  tafel->RemoveElement((element * const)ElementPtr);
+  ElementPtr = tafel->FindElement(3);
+  CPPUNIT_ASSERT_EQUAL( (const element *)NULL, ElementPtr );
+  // add element again
+  tafel->AddElement((element * const)Elemental);
+  ElementPtr = tafel->FindElement(3);
+  CPPUNIT_ASSERT( ElementPtr != NULL && "could not find re-added element lithium");
+};
+
+/** UnitTest for LoadStoreTest().
+ * TODO: periodentafelTest::LoadStoreTest() not implemented yet
+ */
+void periodentafelTest::LoadStoreTest()
+{
+  // reload all databases
+  CPPUNIT_ASSERT(tafel->LoadElementsDatabase(new stringstream(elementsDB,ios_base::in)) && "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");
+  CPPUNIT_ASSERT(tafel->LoadHBondAngleDatabase(new stringstream(HbondangleDB,ios_base::in)) && "HBond angle entry of element initialization failed");
+  CPPUNIT_ASSERT(tafel->LoadHBondLengthsDatabase(new stringstream(HbonddistanceDB,ios_base::in)) && "HBond distance entry of element initialization failed");
+  // check presence of elements
+  atomicNumber_t Z = 1;
+  for(periodentafel::const_iterator ElementRunner = tafel->begin(); ElementRunner != tafel->end(); ++ElementRunner)
+    CPPUNIT_ASSERT( (ElementRunner->second->getNumber() == Z++) && "element is missing in sequence");
+};
Index: molecuilder/src/unittests/periodentafelTest.hpp
===================================================================
--- molecuilder/src/unittests/periodentafelTest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/src/unittests/periodentafelTest.hpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,39 @@
+/*
+ * periodentafelTest.hpp
+ *
+ *  Created on: May 18, 2010
+ *      Author: heber
+ */
+
+#ifndef ANALYSISBONDSUNITTEST_HPP_
+#define ANALYSISBONDSUNITTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class element;
+class periodentafel;
+
+/********************************************** Test classes **************************************/
+
+class periodentafelTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( periodentafelTest) ;
+    CPPUNIT_TEST ( AddRemoveTest );
+    CPPUNIT_TEST ( LoadStoreTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void AddRemoveTest();
+      void LoadStoreTest();
+
+private:
+
+      element *hydrogen;
+      element *carbon;
+      periodentafel *tafel;
+
+};
+
+#endif /* ANALYSISBONDSUNITTEST_HPP_ */
Index: molecuilder/src/unittests/tesselation_boundarytriangleunittest.cpp
===================================================================
--- molecuilder/src/unittests/tesselation_boundarytriangleunittest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/tesselation_boundarytriangleunittest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -37,19 +37,16 @@
   tesselpoints[0] = new TesselPoint;
   tesselpoints[0]->node = new Vector(0., 0., 0.);
-  tesselpoints[0]->Name = Malloc<char>(3, "TesselationBoundaryTriangleTest::setUp - *Name");
-  strcpy(tesselpoints[0]->Name, "1");
+  tesselpoints[0]->setName("1");
   tesselpoints[0]->nr = 1;
   points[0] = new BoundaryPointSet(tesselpoints[0]);
   tesselpoints[1] = new TesselPoint;
   tesselpoints[1]->node = new Vector(0., 1., 0.);
-  tesselpoints[1]->Name = Malloc<char>(3, "TesselationBoundaryTriangleTest::setUp - *Name");
-  strcpy(tesselpoints[1]->Name, "2");
+  tesselpoints[1]->setName("2");
   tesselpoints[1]->nr = 2;
   points[1] = new BoundaryPointSet(tesselpoints[1]);
   tesselpoints[2] = new TesselPoint;
-  tesselpoints[2] ->node = new Vector(1., 0., 0.);
-  tesselpoints[2] ->Name = Malloc<char>(3, "TesselationBoundaryTriangleTest::setUp - *Name");
-  strcpy(tesselpoints[2] ->Name, "3");
-  tesselpoints[2] ->nr = 3;
+  tesselpoints[2]->node = new Vector(1., 0., 0.);
+  tesselpoints[2]->setName("3");
+  tesselpoints[2]->nr = 3;
   points[2] = new BoundaryPointSet(tesselpoints[2] );
 
Index: molecuilder/src/unittests/tesselation_insideoutsideunittest.cpp
===================================================================
--- molecuilder/src/unittests/tesselation_insideoutsideunittest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/tesselation_insideoutsideunittest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -38,48 +38,40 @@
   Walker = new TesselPoint;
   Walker->node = new Vector(0., 0., 0.);
-  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
-  strcpy(Walker->Name, "1");
+  Walker->setName("1");
   Walker->nr = 1;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(0., 1., 0.);
-  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
-  strcpy(Walker->Name, "2");
+  Walker->setName("2");
   Walker->nr = 2;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(1., 0., 0.);
-  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
-  strcpy(Walker->Name, "3");
+  Walker->setName("3");
   Walker->nr = 3;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(1., 1., 0.);
-  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
-  strcpy(Walker->Name, "4");
+  Walker->setName("4");
   Walker->nr = 4;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(0., 0., 1.);
-  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
-  strcpy(Walker->Name, "5");
+  Walker->setName("5");
   Walker->nr = 5;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(0., 1., 1.);
-  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
-  strcpy(Walker->Name, "6");
+  Walker->setName("6");
   Walker->nr = 6;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(1., 0., 1.);
-  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
-  strcpy(Walker->Name, "7");
+  Walker->setName("7");
   Walker->nr = 7;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(1., 1., 1.);
-  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
-  strcpy(Walker->Name, "8");
+  Walker->setName("8");
   Walker->nr = 8;
   Corners.push_back(Walker);
Index: molecuilder/src/unittests/tesselationunittest.cpp
===================================================================
--- molecuilder/src/unittests/tesselationunittest.cpp	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/src/unittests/tesselationunittest.cpp	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -37,24 +37,20 @@
   Walker = new TesselPoint;
   Walker->node = new Vector(1., 0., -1.);
-  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
-  strcpy(Walker->Name, "1");
+  Walker->setName("1");
   Walker->nr = 1;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(-1., 1., -1.);
-  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
-  strcpy(Walker->Name, "2");
+  Walker->setName("2");
   Walker->nr = 2;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(-1., -1., -1.);
-  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
-  strcpy(Walker->Name, "3");
+  Walker->setName("3");
   Walker->nr = 3;
   Corners.push_back(Walker);
   Walker = new TesselPoint;
   Walker->node = new Vector(-1., 0., 1.);
-  Walker->Name = Malloc<char>(3, "TesselationTest::setUp");
-  strcpy(Walker->Name, "4");
+  Walker->setName("4");
   Walker->nr = 4;
   Corners.push_back(Walker);
Index: molecuilder/tests/Tesselations/defs.in
===================================================================
--- molecuilder/tests/Tesselations/defs.in	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/tests/Tesselations/defs.in	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -62,5 +62,7 @@
 	#cat stderr
 	#cat stdout
-	diff ${FILENAME}.dat ../@srcdir@/$mol/$2/${FILENAME}-$mol.dat 2>diffstderr >diffstdout || exitcode=$?
+        grep -E "^[0-9]* [0-9]* [0-9]*$" ../../../../../molecuilder/tests/Tesselations/$mol/$2/${FILENAME}-$mol.dat | sort -n >reference-triangles.dat
+        grep -E "^[0-9]* [0-9]* [0-9]*$" ${FILENAME}.dat | sort -n >new-triangles.dat
+        diff reference-triangles.dat new-triangles.dat 2>diffstderr >diffstdout || exitcode=$?
 	#echo "Diff done with exitcode $exitcode."
 	#cat diffstderr
Index: molecuilder/tests/regression/Simple_configuration/2/post/test.conf.in
===================================================================
--- molecuilder/tests/regression/Simple_configuration/2/post/test.conf.in	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/tests/regression/Simple_configuration/2/post/test.conf.in	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,24 @@
+% Created by MoleCuilder
+mpqc: (
+	savestate = no
+	do_gradient = yes
+	mole<MBPT2>: (
+		maxiter = 200
+		basis = $:basis
+		molecule = $:molecule
+		reference<CLHF>: (
+			basis = $:basis
+			molecule = $:molecule
+		)
+	)
+)
+molecule<Molecule>: (
+	unit = angstrom
+	{ atoms geometry } = {
+		H [ 0	0	0 ]
+	}
+)
+basis<GaussianBasisSet>: (
+	name = "3-21G"
+	molecule = $:molecule
+)
Index: molecuilder/tests/regression/Simple_configuration/3/post/test.conf.in
===================================================================
--- molecuilder/tests/regression/Simple_configuration/3/post/test.conf.in	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
+++ molecuilder/tests/regression/Simple_configuration/3/post/test.conf.in	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -0,0 +1,24 @@
+% Created by MoleCuilder
+mpqc: (
+	savestate = no
+	do_gradient = yes
+	mole<MBPT2>: (
+		maxiter = 200
+		basis = $:basis
+		molecule = $:molecule
+		reference<CLHF>: (
+			basis = $:basis
+			molecule = $:molecule
+		)
+	)
+)
+molecule<Molecule>: (
+	unit = angstrom
+	{ atoms geometry } = {
+		H [ 0	0	0 ]
+	}
+)
+basis<GaussianBasisSet>: (
+	name = "3-21G"
+	molecule = $:molecule
+)
Index: molecuilder/tests/testsuite.at
===================================================================
--- molecuilder/tests/testsuite.at	(revision 3561800616d100e40c39e5a93b9765d260e50b0f)
+++ molecuilder/tests/testsuite.at	(revision 5cf5a4a0464b8f54c442bbc4192cc9df792dd368)
@@ -11,5 +11,5 @@
 AT_KEYWORDS([options])
 AT_CHECK([pwd],[ignore],[ignore])
-AT_CHECK([../../molecuilder -v], 0, [stdout], [ignore])
+AT_CHECK([../../molecuilder -v 1], 0, [stdout], [ignore])
 AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore])
 AT_CHECK([../../molecuilder -h], 0, [stdout], [ignore])
@@ -17,13 +17,11 @@
 AT_CHECK([../../molecuilder -e], 255, [ignore], [stderr])
 AT_CHECK([fgrep "Not enough or invalid arguments" stderr], 0, [ignore], [ignore])
-AT_CHECK([../../molecuilder test.conf], 0, [stdout], [stderr])
-AT_CHECK([fgrep "Element list loading failed" stdout], 0, [ignore], [ignore])
 AT_CLEANUP
 
 
 AT_BANNER([MoleCuilder - molecular config creation from xyz file and atom adding])
-AT_KEYWORDS([Atom handling])
 # 1. create some simplest molecular geometry
 AT_SETUP([Simple configuration - xyz file generation])
+AT_KEYWORDS([Atom handling])
 AT_DATA([test.xyz], [[1
  # test configuration, created by molecuilder test suite
@@ -102,8 +100,8 @@
 
 AT_BANNER([MoleCuilder - Graph routines test])
+AT_SETUP([Graph - DFS analysis])
 AT_KEYWORDS([graph])
-AT_SETUP([Graph - DFS analysis])
 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Graph/1/pre/test.conf .], 0)
-AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -vvv -D 2.], 0, [stdout], [stderr])
+AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -v 3 -D 2.], 0, [stdout], [stderr])
 AT_CHECK([fgrep -c "No rings were detected in the molecular structure." stdout], 0, [1
 ], [ignore])
@@ -111,7 +109,7 @@
 
 AT_BANNER([MoleCuilder - Fragmentation and Re-fragmentation test])
-AT_KEYWORDS([fragmentation])
 # 1. check config
 AT_SETUP([Fragmentation - Checking present config])
+AT_KEYWORDS([fragmentation])
 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/1/pre/test.conf .], 0)
 AT_CHECK([fgrep "Ion_Type1_4" test.conf], 0, [Ion_Type1_4	8.532785963	4.787886018	2.645886050	0 # molecule nr 6
@@ -136,7 +134,7 @@
 
 AT_BANNER([MoleCuilder - Tesselation test])
-AT_KEYWORDS([Tesselation])
 # 1. Non convex tesselation
 AT_SETUP([Tesselation - Non-Convex Envelope])
+AT_KEYWORDS([Tesselation])
 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/pre/* .], 0)
 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -N 4. NonConvexEnvelope], 0, [stdout], [stderr])
