[med-svn] [ball] 02/04: Imported Upstream version 1.4.3~beta1

Andreas Tille tille at debian.org
Thu Jan 7 10:40:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository ball.

commit 072c9d781a1a13ffd12045348359b551c6d971e2
Author: Andreas Tille <tille at debian.org>
Date:   Thu Jan 7 10:30:15 2016 +0100

    Imported Upstream version 1.4.3~beta1
---
 .gitignore                                         |    3 +
 CMakeLists.txt                                     |  148 +-
 cmake/BALLCompilerSpecific.cmake                   |    4 +
 cmake/BALLComponents.cmake                         |   86 +-
 cmake/BALLConfigBoost.cmake                        |    2 +-
 cmake/BALLConfigNoexcept.cmake                     |   13 +
 cmake/BALLConfigStdStringFeatures.cmake            |   56 +
 cmake/BALLConfiguration.cmake                      |    6 +
 cmake/BALLDoc.cmake                                |   58 +-
 cmake/BALLMacros.cmake                             |   14 +-
 cmake/FindFLEX.cmake                               |    2 +-
 cmake/FindRTfact.cmake                             |   22 +-
 cmake/FindTBB.cmake                                |   19 +-
 cmake/ballaxy/setupBALLAXYDirectories.cmake.in     |    3 +-
 cmake/config.h.in                                  |   36 +-
 data/HTMLBasedInterface/html_de/darstellung.html   |    1 +
 data/HTMLBasedInterface/html_de/index.html         |   14 +-
 .../html_de/lehrer/wiki_tutorial02.html            |   50 +
 .../html_de/lehrer/wiki_tutorial03.html            |   44 +
 .../html_de/lehrer/wiki_tutorial04.html            |   59 +
 .../html_de/lehrer/wiki_tutorial05.html            |   44 +
 .../html_de/lehrer/wiki_tutorial06.html            |   47 +
 .../html_de/lehrer/wiki_tutorial07.html            |   54 +
 .../html_de/lehrer/wiki_tutorial08.html            |   43 +
 .../html_de/lehrer/wiki_tutorial09.html            |   51 +
 .../html_de/lehrer/wiki_tutorial10.html            |   53 +
 .../html_de/lehrer/wiki_tutorial11.html            |   45 +
 data/HTMLBasedInterface/html_de/wiki_tutorial.html |   44 +
 data/HTMLBasedInterface/html_eng/index.html        |    6 +
 .../html_eng/tutorial/tutorial_dialog02.html       |   48 +
 .../html_eng/tutorial/tutorial_dialog03.html       |   47 +
 .../html_eng/tutorial/tutorial_dialog04.html       |   55 +
 .../html_eng/tutorial/tutorial_dialog05.html       |   49 +
 .../html_eng/tutorial/tutorial_dialog06.html       |   44 +
 .../html_eng/tutorial/tutorial_dialog07.html       |   45 +
 .../html_eng/tutorial/tutorial_dialog08.html       |   52 +
 .../html_eng/tutorial/tutorial_dialog09.html       |   46 +
 .../html_eng/tutorial/tutorial_dialog10.html       |   38 +
 .../html_eng/tutorial_dialog.html                  |   53 +
 .../images/ballview_menueleiste.jpg                |  Bin 0 -> 16007 bytes
 .../images/ballview_repraesentation.jpg            |  Bin 0 -> 20933 bytes
 .../images/ballview_uebersicht.jpg                 |  Bin 0 -> 18478 bytes
 .../HTMLBasedInterface/scripts/common_functions.py |   37 +-
 data/HTMLBasedInterface/scripts/connectVIEW.js     |  282 +++
 include/BALL/DATATYPE/GRAPH/graphAlgorithms.h      |    4 +-
 include/BALL/DATATYPE/string.h                     |  546 +++++-
 include/BALL/DATATYPE/string.iC                    | 1022 ++++++++++-
 include/BALL/DOCKING/COMMON/poseClustering.h       |  151 +-
 include/BALL/FORMAT/HMOFile.h                      |  212 +++
 include/BALL/FORMAT/NMRStarFile.h                  |    4 +-
 include/BALL/FORMAT/SCWRLRotamerFile.h             |   22 +-
 include/BALL/FORMAT/commandlineParser.h            |   28 +-
 include/BALL/FORMAT/lineBasedFile.h                |    3 -
 include/BALL/FORMAT/molFileFactory.h               |   15 +-
 include/BALL/FORMAT/paramFile.h                    |    4 +-
 include/BALL/MATHS/analyticalGeometry.h            |    3 +-
 include/BALL/QSAR/QSARData.h                       |   20 -
 include/BALL/QSAR/classificationValidation.h       |   20 -
 include/BALL/QSAR/kernelModel.h                    |   20 -
 include/BALL/QSAR/latentVariableModel.h            |   20 -
 include/BALL/QSAR/ldaModel.h                       |   20 -
 include/BALL/QSAR/libsvmModel.h                    |   20 -
 include/BALL/QSAR/linearModel.h                    |   20 -
 include/BALL/QSAR/logitModel.h                     |   20 -
 include/BALL/QSAR/mlrModel.h                       |   22 +-
 include/BALL/QSAR/modelFactory.h                   |   22 -
 include/BALL/QSAR/nBModel.h                        |   20 -
 include/BALL/QSAR/nonlinearModel.h                 |   20 -
 include/BALL/QSAR/oplsModel.h                      |   22 +-
 include/BALL/QSAR/pcrModel.h                       |   20 -
 include/BALL/QSAR/plsModel.h                       |   22 +-
 include/BALL/QSAR/registry.h                       |   20 -
 include/BALL/QSAR/regressionModel.h                |   20 -
 include/BALL/QSAR/regressionValidation.h           |   20 -
 include/BALL/QSAR/rrModel.h                        |   22 +-
 include/BALL/QSAR/snBModel.h                       |   20 -
 include/BALL/QSAR/statistics.h                     |   20 -
 include/BALL/QSAR/svmModel.h                       |   20 -
 include/BALL/QSAR/svrModel.h                       |   22 +-
 include/BALL/QSAR/validation.h                     |   20 -
 include/BALL/SCORING/COMMON/diffGridBasedScoring.h |   18 -
 include/BALL/SCORING/COMMON/diffScoringFunction.h  |   18 -
 include/BALL/SCORING/COMMON/gridBasedScoring.h     |   18 -
 include/BALL/SCORING/COMMON/scoreGridSet.h         |   18 -
 include/BALL/SCORING/COMMON/scoringComponent.h     |   18 -
 include/BALL/SCORING/COMMON/scoringOptimizer.h     |   18 -
 include/BALL/SCORING/COMPONENTS/CHPI.h             |   18 -
 include/BALL/SCORING/COMPONENTS/PB.h               |   18 -
 include/BALL/SCORING/COMPONENTS/PLP.h              |   18 -
 include/BALL/SCORING/COMPONENTS/advElectrostatic.h |   18 -
 .../BALL/SCORING/COMPONENTS/aromaticRingStacking.h |   18 -
 include/BALL/SCORING/COMPONENTS/burialDepth.h      |   18 -
 include/BALL/SCORING/COMPONENTS/buriedPolar.h      |   18 -
 include/BALL/SCORING/COMPONENTS/electrostatic.h    |   18 -
 .../SCORING/COMPONENTS/fragmentationalSolvation.h  |   18 -
 include/BALL/SCORING/COMPONENTS/fresnoTypes.h      |   18 -
 include/BALL/SCORING/COMPONENTS/hydrogenBond.h     |   18 -
 include/BALL/SCORING/COMPONENTS/lipophilic.h       |   18 -
 include/BALL/SCORING/COMPONENTS/polarity.h         |   18 -
 .../BALL/SCORING/COMPONENTS/rotationalEntropy.h    |   18 -
 include/BALL/SCORING/COMPONENTS/solvation.h        |   18 -
 include/BALL/SCORING/COMPONENTS/vanDerWaals.h      |   18 -
 include/BALL/SCORING/FUNCTIONS/MMScoring.h         |   18 -
 include/BALL/SCORING/FUNCTIONS/PBScoring.h         |   18 -
 include/BALL/SCORING/FUNCTIONS/PLPScoring.h        |   18 -
 include/BALL/SCORING/FUNCTIONS/gridedMM.h          |   18 -
 include/BALL/SCORING/FUNCTIONS/gridedPLP.h         |   18 -
 include/BALL/SCORING/FUNCTIONS/rescoring.h         |   18 -
 include/BALL/SCORING/FUNCTIONS/rescoring1D.h       |   18 -
 include/BALL/SCORING/FUNCTIONS/rescoring3D.h       |   18 -
 include/BALL/SCORING/FUNCTIONS/rescoring4D.h       |   18 -
 include/BALL/STRUCTURE/RMSDMinimizer.h             |    5 -
 include/BALL/STRUCTURE/binaryFingerprintMethods.h  |   14 +-
 include/BALL/STRUCTURE/residueChecker.h            |    2 +-
 include/BALL/SYSTEM/MPISupport.h                   |    8 +-
 include/BALL/SYSTEM/fileSystem.h                   |    5 +
 include/BALL/VIEW/DIALOGS/materialSettings.h       |    1 -
 include/BALL/VIEW/KERNEL/message.h                 |    7 +-
 include/BALL/VIEW/KERNEL/stage.h                   |   20 +-
 include/BALL/VIEW/KERNEL/stringStub.h              |    1 -
 .../BALL/VIEW/RENDERING/RENDERERS/XML3DRenderer.h  |   16 +-
 include/BALL/VIEW/RENDERING/RENDERERS/glRenderer.h |    7 +
 include/BALL/VIEW/RENDERING/RENDERERS/renderer.h   |   43 +-
 .../BALL/VIEW/RENDERING/RENDERERS/rtfactRenderer.h |  174 +-
 include/BALL/VIEW/WIDGETS/geometricControl.h       |    2 +-
 include/BALL/VIEW/WIDGETS/molecularStructure.h     |    4 +
 include/BALL/VIEW/WIDGETS/scene.h                  |   78 +-
 source/APPLICATIONS/BALLVIEW/aboutDialog.ui        |    6 +-
 source/APPLICATIONS/BALLVIEW/demoTutorialDialog.C  |    2 +-
 source/APPLICATIONS/QuEasyRun/CMakeLists.txt       |    4 +-
 source/APPLICATIONS/QuEasyRun/featureSelector.C    |   20 -
 source/APPLICATIONS/QuEasyRun/inputPartitioner.C   |   20 -
 source/APPLICATIONS/QuEasyRun/inputReader.C        |   20 -
 source/APPLICATIONS/QuEasyRun/main.C               |   20 -
 source/APPLICATIONS/QuEasyRun/modelCreator.C       |   20 -
 source/APPLICATIONS/QuEasyRun/predictor.C          |   20 -
 source/APPLICATIONS/QuEasyRun/validator.C          |   20 -
 source/APPLICATIONS/QuEasyViz/CMakeLists.txt       |    5 +
 source/APPLICATIONS/QuEasyViz/CSVInputDataItem.C   |   20 -
 source/APPLICATIONS/QuEasyViz/CSVInputDataItem.h   |   20 -
 source/APPLICATIONS/QuEasyViz/CSVInputDialog.C     |   22 +-
 source/APPLICATIONS/QuEasyViz/CSVInputDialog.h     |   20 -
 source/APPLICATIONS/QuEasyViz/SDFInputDataItem.C   |   20 -
 source/APPLICATIONS/QuEasyViz/SDFInputDataItem.h   |   20 -
 source/APPLICATIONS/QuEasyViz/SDFInputDialog.C     |   20 -
 source/APPLICATIONS/QuEasyViz/SDFInputDialog.h     |   20 -
 source/APPLICATIONS/QuEasyViz/bayesPlotter.C       |   22 +-
 source/APPLICATIONS/QuEasyViz/bayesPlotter.h       |   20 -
 source/APPLICATIONS/QuEasyViz/coefficientPlotter.C |   20 -
 source/APPLICATIONS/QuEasyViz/coefficientPlotter.h |   20 -
 source/APPLICATIONS/QuEasyViz/componentPlotter.C   |   23 +-
 source/APPLICATIONS/QuEasyViz/componentPlotter.h   |   20 -
 source/APPLICATIONS/QuEasyViz/connectionManager.C  |   22 +-
 source/APPLICATIONS/QuEasyViz/connectionManager.h  |   20 -
 source/APPLICATIONS/QuEasyViz/dataItem.C           |   22 +-
 source/APPLICATIONS/QuEasyViz/dataItem.h           |   20 -
 source/APPLICATIONS/QuEasyViz/dataItemScene.C      |   22 +-
 source/APPLICATIONS/QuEasyViz/dataItemScene.h      |   20 -
 source/APPLICATIONS/QuEasyViz/dataItemView.C       |   20 -
 source/APPLICATIONS/QuEasyViz/dataItemView.h       |   20 -
 source/APPLICATIONS/QuEasyViz/dottedEdge.C         |   22 +-
 source/APPLICATIONS/QuEasyViz/dottedEdge.h         |   20 -
 source/APPLICATIONS/QuEasyViz/edge.C               |   20 -
 source/APPLICATIONS/QuEasyViz/edge.h               |   19 -
 source/APPLICATIONS/QuEasyViz/exception.C          |   20 -
 source/APPLICATIONS/QuEasyViz/exception.h          |   20 -
 source/APPLICATIONS/QuEasyViz/featurePlotter.C     |   20 -
 source/APPLICATIONS/QuEasyViz/featurePlotter.h     |   20 -
 .../QuEasyViz/featureSelectionDialog.C             |   22 +-
 .../QuEasyViz/featureSelectionDialog.h             |   20 -
 .../APPLICATIONS/QuEasyViz/featureSelectionItem.C  |   22 +-
 .../APPLICATIONS/QuEasyViz/featureSelectionItem.h  |   20 -
 source/APPLICATIONS/QuEasyViz/fileBrowser.C        |   20 -
 source/APPLICATIONS/QuEasyViz/fileBrowser.h        |   20 -
 source/APPLICATIONS/QuEasyViz/inputDataDialog.C    |   20 -
 source/APPLICATIONS/QuEasyViz/inputDataDialog.h    |   20 -
 source/APPLICATIONS/QuEasyViz/inputDataItem.C      |   20 -
 source/APPLICATIONS/QuEasyViz/inputDataItem.h      |   20 -
 source/APPLICATIONS/QuEasyViz/inputDataItemIO.C    |   30 +-
 source/APPLICATIONS/QuEasyViz/inputDataItemIO.h    |   19 -
 source/APPLICATIONS/QuEasyViz/inputDialog.C        |   20 -
 source/APPLICATIONS/QuEasyViz/inputDialog.h        |   20 -
 source/APPLICATIONS/QuEasyViz/inputPartitionItem.C |   19 -
 source/APPLICATIONS/QuEasyViz/inputPartitionItem.h |   19 -
 source/APPLICATIONS/QuEasyViz/inputPlotter.C       |   20 -
 source/APPLICATIONS/QuEasyViz/inputPlotter.h       |   20 -
 source/APPLICATIONS/QuEasyViz/main.C               |   19 -
 source/APPLICATIONS/QuEasyViz/mainWindow.C         |   24 +-
 source/APPLICATIONS/QuEasyViz/mainWindow.h         |   19 -
 .../QuEasyViz/modelConfigurationDialog.C           |   21 -
 .../QuEasyViz/modelConfigurationDialog.h           |   19 -
 .../QuEasyViz/modelConfigurationDialogPages.C      |   20 -
 .../QuEasyViz/modelConfigurationDialogPages.h      |   20 -
 source/APPLICATIONS/QuEasyViz/modelItem.C          |   22 +-
 source/APPLICATIONS/QuEasyViz/modelItem.h          |   19 -
 .../APPLICATIONS/QuEasyViz/modelPropertiesDialog.C |   21 -
 .../APPLICATIONS/QuEasyViz/modelPropertiesDialog.h |   20 -
 source/APPLICATIONS/QuEasyViz/partitioningItem.C   |   20 -
 source/APPLICATIONS/QuEasyViz/partitioningItem.h   |   20 -
 source/APPLICATIONS/QuEasyViz/pipeline.C           |   19 -
 source/APPLICATIONS/QuEasyViz/pipeline.h           |   20 -
 source/APPLICATIONS/QuEasyViz/plotter.C            |   21 -
 source/APPLICATIONS/QuEasyViz/plotter.h            |   20 -
 source/APPLICATIONS/QuEasyViz/predictionItem.C     |   21 -
 source/APPLICATIONS/QuEasyViz/predictionItem.h     |   20 -
 source/APPLICATIONS/QuEasyViz/predictionPlotter.C  |   22 +-
 source/APPLICATIONS/QuEasyViz/predictionPlotter.h  |   20 -
 .../QuEasyViz/predictionResultDialog.C             |   22 -
 .../QuEasyViz/predictionResultDialog.h             |   20 -
 source/APPLICATIONS/QuEasyViz/validationDialog.C   |   22 +-
 source/APPLICATIONS/QuEasyViz/validationDialog.h   |   21 -
 source/APPLICATIONS/QuEasyViz/validationItem.C     |   22 -
 source/APPLICATIONS/QuEasyViz/validationItem.h     |   20 -
 .../QuEasyViz/validationResultDialog.C             |   25 -
 .../QuEasyViz/validationResultDialog.h             |   20 -
 source/APPLICATIONS/TOOLS/AddMissingAtoms.C        |  100 +
 source/APPLICATIONS/TOOLS/BindingDBCleaner.C       |   23 +-
 source/APPLICATIONS/TOOLS/BondOrderAssigner.C      |   67 +-
 source/APPLICATIONS/TOOLS/CMakeLists.txt           |    6 +-
 .../TOOLS/CalculateBindingFreeEnergy.C             |  126 ++
 source/APPLICATIONS/TOOLS/CalculateEnergy.C        |  279 +++
 .../TOOLS/CalculateSolvationFreeEnergy.C           |  109 ++
 source/APPLICATIONS/TOOLS/Converter.C              |  108 +-
 source/APPLICATIONS/TOOLS/CrystalGenerator.C       |   39 +-
 source/APPLICATIONS/TOOLS/DBExporter.C             |    4 +-
 source/APPLICATIONS/TOOLS/DBImporter.C             |    4 +-
 source/APPLICATIONS/TOOLS/DockPoseClustering.C     |  180 +-
 .../TOOLS/ExtractClustersFromWardTree.C            |  170 ++
 source/APPLICATIONS/TOOLS/ExtractProteinChains.C   |  122 ++
 source/APPLICATIONS/TOOLS/ExtractProteinSequence.C |   75 +
 .../TOOLS/FingerprintSimilarityClustering.C        |  487 +++--
 .../TOOLS/FingerprintSimilaritySearch.C            |    7 +-
 source/APPLICATIONS/TOOLS/GalaxyConfigGenerator.C  |   56 +-
 source/APPLICATIONS/TOOLS/LigandFileSplitter.C     |  517 +++---
 source/APPLICATIONS/TOOLS/MolecularFileConverter.C |   18 +-
 source/APPLICATIONS/TOOLS/PDBRMSDCalculator.C      |  308 ++++
 source/APPLICATIONS/TOOLS/PeptideBuilder.C         |   24 +-
 source/APPLICATIONS/TOOLS/PoseIndices2PDB.C        |  149 ++
 source/APPLICATIONS/TOOLS/ProteinProtonator.C      |  122 +-
 source/APPLICATIONS/TOOLS/RMSDCalculator.C         |   12 +-
 source/APPLICATIONS/TOOLS/RemoveWater.C            |   75 +
 source/APPLICATIONS/TOOLS/ResidueChecker.C         |  199 ++
 source/APPLICATIONS/TOOLS/SideChainGridBuilder.C   |    8 +-
 .../APPLICATIONS/TOOLS/Split2ConnectedComponents.C |   94 +-
 .../TOOLS/Trajectory2RigidTransformation.C         |   91 +
 .../TOOLS/TrajectoryFile2PDBSplitter.C             |   49 +-
 source/APPLICATIONS/TOOLS/VendorFinder.C           |    4 +-
 source/APPLICATIONS/TOOLS/sources.cmake            |   14 +-
 source/APPLICATIONS/TOOLS/stringStub.C             |    9 -
 source/APPLICATIONS/TOOLS/tool_conf.xml.section    |  131 ++
 source/APPLICATIONS/UTILITIES/pdb2dcd.C            |   33 +-
 source/DATATYPE/string.C                           |   25 +-
 source/DOCKING/COMMON/poseClustering.C             |  686 +++++--
 source/DOCKING/COMMON/staticLigandFragment.C       |   18 -
 source/DOCKING/COMMON/structurePreparer.C          |   18 -
 source/DOCKING/GENETICDOCK/rotateBond.C            |   24 +-
 source/DOCKING/IMGDOCK/IMGDock.C                   |   18 -
 source/DOCKING/geometricFit.C                      |   16 +-
 source/EXAMPLES/PDBChecker.C                       |    1 +
 .../{PRESENTABALL => BALLAXY}/CMakeLists.txt       |   23 +-
 .../EXTENSIONS/BALLAXY/include/BALLaxyInterface.h  |   87 +
 .../BALLAXY/include/BALLaxyInterfacePreferences.h  |   57 +
 .../include/BALLaxyPlugin.h}                       |   16 +-
 .../EXTENSIONS/BALLAXY/source/BALLaxyInterface.C   |  417 +++++
 .../BALLAXY/source/BALLaxyInterfacePreferences.C   |   51 +
 .../BALLAXY/source/BALLaxyInterfacePreferences.ui  |  220 +++
 source/EXTENSIONS/BALLAXY/source/BALLaxyPlugin.C   |   69 +
 source/EXTENSIONS/BALLAXY/source/logo.png          |  Bin 0 -> 7579 bytes
 source/EXTENSIONS/BALLAXY/source/logo.qrc          |    5 +
 source/EXTENSIONS/BALLPluginComponents.cmake       |    2 -
 source/EXTENSIONS/CMakeLists.txt                   |    5 +
 source/EXTENSIONS/PRESENTABALL/CMakeLists.txt      |   10 +-
 .../PRESENTABALL/include/HTMLBasedInterface.h      |   31 +-
 .../PRESENTABALL/include/PresentaBALLPlugin.h      |    3 +
 .../PRESENTABALL/include/PresentaBALLSettings.h    |   55 +
 .../PRESENTABALL/source/HTMLBasedInterface.C       |  158 +-
 .../PRESENTABALL/source/PresentaBALLPlugin.C       |   12 +-
 .../PRESENTABALL/source/PresentaBALLSettings.C     |   58 +
 .../PRESENTABALL/source/PresentaBALLSettings.ui    |   62 +
 source/EXTENSIONS/SPACENAV/CMakeLists.txt          |    5 +
 .../SPACENAV/source/spaceNavigatorPlugin.C         |    3 +-
 source/EXTENSIONS/VRPN/CMakeLists.txt              |    5 +
 source/EXTENSIONS/VRPNHD/CMakeLists.txt            |    5 +
 source/EXTENSIONS/XML3D/CMakeLists.txt             |    9 +-
 source/EXTENSIONS/XML3D/Makefile                   |   20 -
 source/FORMAT/CIFParserLexer.l                     |    2 +
 source/FORMAT/HMOFile.C                            |  448 +++++
 source/FORMAT/NMRStarFile.C                        |   55 +-
 source/FORMAT/PDBFileDetails.C                     |    2 +-
 source/FORMAT/SCWRLRotamerFile.C                   |   20 +-
 source/FORMAT/commandlineParser.C                  |  245 +--
 source/FORMAT/dockResultFile.C                     |    4 +
 source/FORMAT/lineBasedFile.C                      |    9 +-
 source/FORMAT/molFileFactory.C                     |  637 ++++---
 source/FORMAT/paramFile.C                          |   19 +
 source/FORMAT/sources.cmake                        |    2 +-
 source/KERNEL/expressionParserLexer.l              |    2 +
 source/MOLMEC/AMBER/GAFFCESParserLexer.l           |    2 +
 source/MOLMEC/COMMON/snapShotManager.C             |    1 -
 source/PLUGIN/pluginManager.C                      |    9 +-
 source/PYTHON/EXTENSIONS/BALL/BALLCore.sip         |    6 +-
 source/PYTHON/EXTENSIONS/BALL/HMOFile.sip          |   62 +
 source/PYTHON/EXTENSIONS/BALL/NMRStarFile.sip      |    4 +-
 source/PYTHON/EXTENSIONS/BALL/RMSDMinimizer.sip    |   40 +-
 source/PYTHON/EXTENSIONS/BALL/XYZFile.sip          |   12 +-
 .../EXTENSIONS/BALL/aromaticityProcessor.sip       |   54 +
 source/PYTHON/EXTENSIONS/BALL/assignTypes.sip      |   74 +
 source/PYTHON/EXTENSIONS/BALL/exception.sip        |  676 +++----
 source/PYTHON/EXTENSIONS/BALL/file.sip             |   20 +-
 source/PYTHON/EXTENSIONS/BALL/fragmentDB.sip       |    3 +-
 source/PYTHON/EXTENSIONS/BALL/molFileFactory.sip   |    5 +
 source/PYTHON/EXTENSIONS/BALL/options.sip          |   28 +-
 source/PYTHON/EXTENSIONS/BALL/string.sip           |   13 +-
 source/PYTHON/EXTENSIONS/TEST/Makefile.lst         |   43 -
 source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip    |   10 +-
 source/PYTHON/EXTENSIONS/VIEW/serverWidget.sip     |   22 +-
 source/PYTHON/Makefile.win                         |   30 -
 source/QSAR/Model.C                                |   22 +-
 source/QSAR/QSARData.C                             |   20 -
 source/QSAR/allModel.C                             |   20 -
 source/QSAR/bayesModel.C                           |   20 -
 source/QSAR/classificationModel.C                  |   20 -
 source/QSAR/classificationValidation.C             |   20 -
 source/QSAR/configIO.C                             |   20 -
 source/QSAR/exception.C                            |   20 -
 source/QSAR/featureSelection.C                     |   20 -
 source/QSAR/fitModel.C                             |   20 -
 source/QSAR/gpModel.C                              |   20 -
 source/QSAR/kernel.C                               |   20 -
 source/QSAR/kernelModel.C                          |   20 -
 source/QSAR/knnModel.C                             |   20 -
 source/QSAR/kpcrModel.C                            |   20 -
 source/QSAR/kplsModel.C                            |   20 -
 source/QSAR/latentVariableModel.C                  |   20 -
 source/QSAR/ldaModel.C                             |   20 -
 source/QSAR/libsvmModel.C                          |   22 +-
 source/QSAR/linearModel.C                          |   20 -
 source/QSAR/logitModel.C                           |   20 -
 source/QSAR/mlrModel.C                             |   22 +-
 source/QSAR/modelFactory.C                         |   20 -
 source/QSAR/nBModel.C                              |   20 -
 source/QSAR/nonlinearModel.C                       |   20 -
 source/QSAR/oplsModel.C                            |   22 +-
 source/QSAR/pcrModel.C                             |   20 -
 source/QSAR/plsModel.C                             |   22 +-
 source/QSAR/registry.C                             |   20 -
 source/QSAR/regressionModel.C                      |   20 -
 source/QSAR/regressionValidation.C                 |   20 -
 source/QSAR/rrModel.C                              |   22 +-
 source/QSAR/snBModel.C                             |   20 -
 source/QSAR/statistics.C                           |   20 -
 source/QSAR/svmModel.C                             |   20 -
 source/QSAR/svrModel.C                             |   22 +-
 source/QSAR/validation.C                           |   20 -
 source/SCORING/COMMON/diffGridBasedScoring.C       |   18 -
 source/SCORING/COMMON/diffScoringFunction.C        |   18 -
 source/SCORING/COMMON/gridBasedScoring.C           |   18 -
 source/SCORING/COMMON/scoreGridSet.C               |   18 -
 source/SCORING/COMMON/scoringComponent.C           |   18 -
 source/SCORING/COMMON/scoringOptimizer.C           |   18 -
 source/SCORING/COMPONENTS/CHPI.C                   |   20 -
 source/SCORING/COMPONENTS/PB.C                     |   17 -
 source/SCORING/COMPONENTS/PLP.C                    |   18 -
 source/SCORING/COMPONENTS/advElectrostatic.C       |   18 -
 source/SCORING/COMPONENTS/aromaticRingStacking.C   |   18 -
 source/SCORING/COMPONENTS/burialDepth.C            |   18 -
 source/SCORING/COMPONENTS/buriedPolar.C            |   19 -
 source/SCORING/COMPONENTS/electrostatic.C          |   18 -
 .../SCORING/COMPONENTS/fragmentationalSolvation.C  |   18 -
 source/SCORING/COMPONENTS/fresnoTypes.C            |   18 -
 source/SCORING/COMPONENTS/hydrogenBond.C           |   19 -
 source/SCORING/COMPONENTS/lipophilic.C             |   18 -
 source/SCORING/COMPONENTS/polarity.C               |   18 -
 source/SCORING/COMPONENTS/rotationalEntropy.C      |   18 -
 source/SCORING/COMPONENTS/solvation.C              |   18 -
 source/SCORING/COMPONENTS/vanDerWaals.C            |   18 -
 source/SCORING/FUNCTIONS/MMScoring.C               |   18 -
 source/SCORING/FUNCTIONS/PBScoring.C               |   20 +-
 source/SCORING/FUNCTIONS/PLPScoring.C              |   18 -
 source/SCORING/FUNCTIONS/gridedMM.C                |   17 -
 source/SCORING/FUNCTIONS/gridedPLP.C               |   18 -
 source/SCORING/FUNCTIONS/rescoring.C               |   18 -
 source/SCORING/FUNCTIONS/rescoring1D.C             |   18 -
 source/SCORING/FUNCTIONS/rescoring3D.C             |   18 -
 source/SCORING/FUNCTIONS/rescoring4D.C             |   19 -
 source/STRUCTURE/assignBondOrderProcessor.C        |   11 +
 source/STRUCTURE/binaryFingerprintMethods.C        |  308 +---
 source/STRUCTURE/logP.C                            |    2 +
 source/STRUCTURE/numericalSAS.C                    |    5 +-
 source/STRUCTURE/residueChecker.C                  |    8 +-
 source/STRUCTURE/smartsParserLexer.l               |    2 +
 source/STRUCTURE/smilesParserLexer.l               |    2 +
 source/SYSTEM/MPISupport.C                         |   14 +-
 source/SYSTEM/fileSystem.C                         |   13 +
 source/TEST/CMakeLists.txt                         |   14 +-
 source/TEST/FileSystem_test.C                      |    9 +
 source/TEST/HMOFile_test.C                         |  201 ++
 source/TEST/Makefile.lst                           |  291 ---
 source/TEST/NMRStarFile_test.C                     |    2 +-
 source/TEST/PDBFile_test.C                         |    4 +-
 source/TEST/PoseClustering_test.C                  |  487 ++++-
 source/TEST/SCWRLRotamerFile_test.C                |   28 +-
 source/TEST/Socket_test.C                          |    2 +
 source/TEST/cmake/BALLTestExecutables.cmake        |    1 +
 source/TEST/data/HMOFile_test.hmo                  | 1936 ++++++++++++++++++++
 source/TEST/data/HMOFile_test_no_charge.hmo        | 1932 +++++++++++++++++++
 source/TEST/data/PoseClustering_transformFile.dat  |    8 +
 source/TEST/data/PoseClustering_wardtree.dat       |    1 +
 source/TEST/stringStub.C                           |    9 -
 source/VIEW/DIALOGS/coloringSettingsDialog.C       |   17 +-
 source/VIEW/DIALOGS/displayProperties.C            |   13 +-
 source/VIEW/DIALOGS/lightSettings.C                |    5 +-
 source/VIEW/DIALOGS/materialSettings.C             |  132 +-
 source/VIEW/DIALOGS/materialSettings.ui            |   48 -
 source/VIEW/DIALOGS/stageSettings.ui               |    2 +-
 source/VIEW/KERNEL/MODES/editMode.C                |    4 +
 source/VIEW/KERNEL/representationManager.C         |    1 +
 source/VIEW/KERNEL/shortcutRegistry.C              |    2 -
 source/VIEW/KERNEL/sources.cmake                   |    1 -
 source/VIEW/KERNEL/stage.C                         |   10 +-
 source/VIEW/KERNEL/stringStub.C                    |    9 -
 source/VIEW/RENDERING/RENDERERS/XML3DRenderer.C    |   96 +-
 source/VIEW/RENDERING/RENDERERS/glRenderer.C       |   64 +-
 source/VIEW/RENDERING/RENDERERS/rtfactRenderer.C   | 1394 +++++++++++---
 source/VIEW/RENDERING/renderSetup.C                |   17 +-
 source/VIEW/WIDGETS/geometricControl.C             |   98 +-
 source/VIEW/WIDGETS/molecularControl.C             |   23 +-
 source/VIEW/WIDGETS/molecularStructure.C           |    8 +-
 source/VIEW/WIDGETS/scene.C                        |  279 +--
 429 files changed, 16720 insertions(+), 7697 deletions(-)

diff --git a/.gitignore b/.gitignore
index fd7ecaa..fcc5566 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,9 @@ moc_*.C
 *.sw?
 *.orig
 *.pyc
+*.aux
+*.bbl
+*.blg
 .Dependencies
 lib/*
 build/*
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 182946e..30c2c2e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,6 @@ PROJECT("BALL")
 # CONTRIB_CUSTOM_DIR
 # STL_DEBUG
 # QT_DB_PLUGIN
-# MT_CUDA_BUILD_TYPE
 
 ########################################################
 ###    manual entries (edit this for new release)    ###
@@ -73,6 +72,11 @@ ENDIF()
 SET(BALL_CONTRIB_PATH "" CACHE PATH "Path to the contrib directory, if installed (optional)")
 SET(CMAKE_PREFIX_PATH ${BALL_CONTRIB_PATH} ${CMAKE_PREFIX_PATH})
 
+IF(UNIX AND BALL_CONTRIB_PATH)
+	SET(CMAKE_LIBRARY_PATH ${BALL_CONTRIB_PATH}/lib ${BALL_CONTRIB_PATH}/lib64 ${CMAKE_LIBRARY_PATH})
+	SET(CMAKE_INCLUDE_PATH ${BALL_CONTRIB_PATH}/include ${CMAKE_INCLUDE_PATH})
+ENDIF()
+
 SET(CMAKE_REQUIRED_INCLUDES ${BALL_CONTRIB_PATH}/include ${CMAKE_REQUIRED_INCLUDES})
 
 SET(BALL_TEST_DATA_PATH ${PROJECT_SOURCE_DIR}/source/TEST/data)
@@ -121,6 +125,18 @@ FIND_PACKAGE(FLEX)
 IF (NOT FLEX_FOUND)
 	MESSAGE(SEND_ERROR "Could not find flex scanner generator!")
 ENDIF()
+## Figure out if the used flex version supports ...lex_destroy()
+MESSAGE(STATUS "Checking for yylex_destroy support in flex")
+STRING(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*$" "\\1;\\2;\\3"
+	FLEX_VERSION_NUMERIC ${FLEX_VERSION})
+LIST(GET FLEX_VERSION_NUMERIC 2 FLEX_PATCH_LEVEL)
+IF (FLEX_PATCH_LEVEL GREATER 8)
+	MESSAGE(STATUS "Checking for yylex_destroy support in flex - found")
+	SET(BALL_HAS_YYLEX_DESTROY TRUE)
+ELSE()
+	MESSAGE(STATUS "Checking for yylex_destroy support in flex - Not found")
+	SET(BALL_HAS_YYLEX_DESTROY FALSE)
+ENDIF()
 
 ## Third-party libraries ##
 
@@ -201,68 +217,113 @@ IF(USE_LIBSVM)
 ENDIF()
 
 ## CUDA
-SET(MT_ENABLE_CUDA OFF CACHE BOOL "Should CUDA support be enabled (version <= 2.1 currently supported).")
+SET(USE_CUDA OFF CACHE BOOL "Should CUDA support be enabled (version <= 2.1 currently supported)?")
 
-IF(MT_ENABLE_CUDA)
+IF(USE_CUDA)
 	FIND_PACKAGE(CUDA REQUIRED)
 ENDIF()
 
 ## TBB
-SET(MT_ENABLE_TBB OFF CACHE BOOL "Should Intel Threading Building Blocks support be enabled.")
+SET(USE_TBB ON CACHE BOOL "Should Intel Threading Building Blocks support be enabled?")
+SET(REQUIRE_TBB OFF CACHE BOOL "Should Intel Threading Building Blocks support be required?")
+
+## RTFact would require tbb... so check if it is required
+IF(REQUIRE_RTFACT)
+	SET(REQUIRE_TBB ON)
+ENDIF()
+
+IF(USE_TBB)
+	IF (REQUIRE_TBB)
+		FIND_PACKAGE(TBB REQUIRED)
+	ELSE()
+		FIND_PACKAGE(TBB)
+		IF (NOT TBB_FOUND)
+			MESSAGE(STATUS "Intel Threading Building Blocks not found!")
+		ENDIF()
+	ENDIF()
+
+	IF (TBB_FOUND)
+		INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIRS})
+		BALL_COMBINE_LIBS(TBB_LIBRARIES "${TBB_LIBRARIES}" "${TBB_DEBUG_LIBRARIES}")
+		LIST(REMOVE_DUPLICATES TBB_LIBRARIES)
 
-IF(MT_ENABLE_TBB)
-	FIND_PACKAGE(TBB REQUIRED)
-	INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIRS})
-	BALL_COMBINE_LIBS(TBB_LIBRARIES "${TBB_LIBRARIES}" "${TBB_DEBUG_LIBRARIES}")
-	LIST(REMOVE_DUPLICATES TBB_LIBRARIES)
+		SET(BALL_HAS_TBB TRUE)
+	ENDIF()
 ENDIF()
 
 ## MPI
-OPTION(MT_ENABLE_MPI "Should MPI support be enabled.")
+OPTION(USE_MPI "Should MPI support be enabled?" ON)
+OPTION(REQUIRE_MPI "Should MPI support be required?" OFF)
 
-IF (MT_ENABLE_MPI)
-	FIND_PACKAGE(MPI REQUIRED)
+IF (USE_MPI)
+	IF (REQUIRE_MPI)
+		FIND_PACKAGE(MPI REQUIRED)
+	ELSE()
+		FIND_PACKAGE(MPI)
+	ENDIF()
 
-	ADD_DEFINITIONS(${MPI_COMPILE_FLAGS})
-	INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
+	IF (MPI_FOUND)
+		ADD_DEFINITIONS(${MPI_CXX_COMPILE_FLAGS})
+		INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
+
+		SET(BALL_HAS_MPI TRUE)
+	ENDIF()
 
-	SET(BALL_HAS_MPI TRUE)
 ENDIF()
 
 ## VIEW related options/settings/libraries
 OPTION(BALL_HAS_VIEW "Compile BALL's VIEW library required for visualization and graphical user interfaces" ON)
 
 ## QT
-OPTION(BALL_HAS_QTSQL "Compile BALL's database adapaters (requires QtSql)" OFF)
+OPTION(USE_QTSQL "Compile BALL's database adapaters (requires QtSql)" ON)
+OPTION(USE_QTWEBKIT "Add support for QWebkit" ${BALL_HAS_VIEW})
+
+IF(NOT BALL_HAS_VIEW)
+	MESSAGE(WARNING "Warning: CMakes Qt4 find macro is too restrictive and requires UIC and RCC to be present. "
+	                "If you are building without the GUI part of Qt installed, you will need to create dummy files "
+	                "for both executables in the Qt prefix path.")
+ENDIF()
 
 FIND_PACKAGE(Qt4 REQUIRED)
 
 SET(QT_USE_QTXML TRUE)
 SET(QT_USE_QTNETWORK TRUE)
-SET(QT_USE_QTSQL ${BALL_HAS_QTSQL})
-SET(QT_USE_QTOPENGL TRUE)
-SET(QT_USE_QTTEST TRUE)
+SET(QT_USE_QTSQL    ${USE_QTSQL})
 
-OPTION(USE_QTWEBKIT "Add support for QWebkit" ON)
-IF(USE_QTWEBKIT)
-	SET(QT_USE_QTWEBKIT TRUE)
-	SET(QT_USE_PHONON   TRUE)
+# Qt Dependencies for VIEW
+IF(BALL_HAS_VIEW)
+	SET(QT_USE_QTOPENGL   TRUE)
+	SET(QT_USE_QTTEST     TRUE)
+
+	IF(USE_QTWEBKIT)
+		SET(QT_USE_QTWEBKIT TRUE)
+		SET(QT_USE_PHONON   TRUE)
+	ENDIF()
+ELSE()
+	SET(QT_DONT_USE_QTGUI TRUE)
 ENDIF()
 
+
 SET(QT_MIN_VERSION "4.4.0")
 
-IF (NOT BALL_HAS_VIEW)
-	SET(QT_DONT_USE_QTGUI TRUE)
+INCLUDE(${QT_USE_FILE})
+
+SET(BALL_HAS_QTWEBKIT TRUE)
+IF(USE_QTWEBKIT AND NOT QT_QTWEBKIT_FOUND)
+	SET(BALL_HAS_QTWEBKIT FALSE)
+	MESSAGE(STATUS "QtWebkit has not been found. Disabling browser support.")
 ENDIF()
 
-INCLUDE(${QT_USE_FILE})
+## On Windows, we might need to explicitly deploy openssl libraries for Qt
+IF(WIN32)
+	FIND_PATH(QT_SSLEAY_LIB NAME ssleay32.dll PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH)
+	IF(QT_SSLEAY_LIB)
+		LIST(APPEND QT_LIBRARIES ${QT_SSLEAY_LIB}/ssleay32.dll)
+	ENDIF()
 
-SET(BALL_HAS_QTWEBKIT FALSE)
-IF(USE_QTWEBKIT)
-	IF(NOT QT_QTWEBKIT_FOUND)
-		MESSAGE(FATAL_ERROR "QtWebkit is a required dependency. Aborting")
-	ELSE()
-		SET(BALL_HAS_QTWEBKIT TRUE)
+	FIND_PATH(QT_LIBEAY_LIB NAME libeay32.dll PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH)
+	IF(QT_SSLEAY_LIB)
+		LIST(APPEND QT_LIBRARIES ${QT_LIBEAY_LIB}/libeay32.dll)
 	ENDIF()
 ENDIF()
 
@@ -281,7 +342,9 @@ IF (BALL_HAS_VIEW)
 	## VIEW dependent options
 	OPTION(BALL_ENABLE_CG "Build against NVIDIA Cg library" OFF)
 	OPTION(BALL_REQUIRE_CG "Fail if NVIDIA Cg could not be detected" OFF)
-	OPTION(DISABLE_RTFACT "Explicitly disable RTfact" OFF)
+
+	OPTION(USE_RTFACT "Enable RTfact support" ON)
+	OPTION(REQUIRE_RTFACT "Require RTfact support" OFF)
 
 	## OpenGL
 	FIND_PACKAGE(OpenGL)
@@ -296,8 +359,13 @@ IF (BALL_HAS_VIEW)
 	ENDIF()
 
 	## RTfact
-	IF (NOT DISABLE_RTFACT)
-		FIND_PACKAGE(RTfact)
+	IF (USE_RTFACT)
+		IF (REQUIRE_RTFACT)
+			FIND_PACKAGE(RTfact REQUIRED)
+		ELSE()
+			FIND_PACKAGE(RTfact)
+		ENDIF()
+
 		IF (RTFACT_FOUND)
 			## RTfact requires TBB
 			IF (NOT CMAKE_COMPILER_IS_INTELCXX)
@@ -347,6 +415,7 @@ IF (BALL_PYTHON_SUPPORT)
 		FIND_PACKAGE(PythonLibs)
 		IF (PYTHONLIBS_FOUND)
 			BALL_COMBINE_LIBS(PYTHON_LIBRARIES "${PYTHON_LIBRARIES}" "${PYTHON_DEBUG_LIBRARIES}")
+			SET(SIP_EXTRA_OPTIONS "-e")
 			FIND_PACKAGE(SIP)
 			SET(BALL_SIP_VERSION ${SIP_VERSION})
 			SET(BALL_SIP_VERSION_STR ${SIP_VERSION_STR})
@@ -379,9 +448,9 @@ IF (WIN32)
 ENDIF()
 
 
-OPTION(USE_OPEN_EYE_BABLE "Build BALL with support for OpenEye/OpenBabel" ON)
+OPTION(USE_OPEN_EYE_BABEL "Build BALL with support for OpenEye/OpenBabel" ON)
 
-IF(USE_OPEN_EYE_BABLE)
+IF(USE_OPEN_EYE_BABEL)
 	INCLUDE(cmake/BALLConfigOpenEye_Babel.cmake)
 ENDIF()
 
@@ -433,9 +502,11 @@ IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 	IF(WIN32)
 		SET(BALL_PYTHON_INSTALL_DIRECTORY  "bin")
 		SET(BALL_PLUGIN_INSTALL_DIRECTORY  "bin")
+		SET(BALL_TOOLS_INSTALL_DIRECTORY   "bin/BALLTools")
 	ELSE()
 		SET(BALL_PYTHON_INSTALL_DIRECTORY  "lib")
 		SET(BALL_PLUGIN_INSTALL_DIRECTORY  "lib")
+		SET(BALL_TOOLS_INSTALL_DIRECTORY   "lib/BALL")
 	ENDIF()
 ELSE()
 	SET(BALL_BUNDLE_INSTALL_DIRECTORY  					"Applications")
@@ -447,6 +518,7 @@ ELSE()
 	SET(BALL_HEADER_INSTALL_DIRECTORY  					"Applications/BALLView.app/Contents/Frameworks")
 	SET(BALL_PYTHON_INSTALL_DIRECTORY  					"Applications/BALLView.app/Contents/Frameworks")
 	SET(BALL_PLUGIN_INSTALL_DIRECTORY           "Applications/BALLView.app/Contents/plugins")
+	SET(BALL_TOOLS_INSTALL_DIRECTORY            "Applications/BALLView.app/Contents/BALLTools")
 ENDIF()
 
 ## big include file for headers and C files, which fills the BALL_sources variable
@@ -469,7 +541,7 @@ ENDIF()
 ## add library target
 ## warning: set BUILD_SHARED_LIBS to decide if library is shared or static (see above)! 
 ## We need the BUILD_SHARED_LIBS flag to set declspec flags for MSVC!
-IF (FOUND_CUDART AND MT_ENABLE_CUDA) # we need both conditions due to possible present cached entries
+IF (FOUND_CUDART AND USE_CUDA) # we need both conditions due to possible present cached entries
 	CUDA_ADD_LIBRARY(BALL ${BALL_sources} ${BALL_headers} ${Cuda_sources})
 	IF (BALL_HAS_VIEW)
 		CUDA_ADD_LIBRARY(VIEW ${VIEW_sources} ${VIEW_headers} ${Cuda_sources})
diff --git a/cmake/BALLCompilerSpecific.cmake b/cmake/BALLCompilerSpecific.cmake
index 0b23799..4fe1a65 100644
--- a/cmake/BALLCompilerSpecific.cmake
+++ b/cmake/BALLCompilerSpecific.cmake
@@ -178,4 +178,8 @@ ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
 		CXX_COMPILER_VERSION_MINOR ${CXX_COMPILER_VERSION})
 
 	SET(CXX_COMPILER_VERSION "${CXX_COMPILER_VERSION_MAJOR}.${CXX_COMPILER_VERSION_MINOR}")
+
+	## Clang should use c++-11 - mode 
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+	SET(CF_BALL_ADDCXX_FLAGS "-std=c++11" ${CF_BALL_ADDCXX_FLAGS})
 ENDIF()
diff --git a/cmake/BALLComponents.cmake b/cmake/BALLComponents.cmake
index 6f0fd37..35a6caa 100644
--- a/cmake/BALLComponents.cmake
+++ b/cmake/BALLComponents.cmake
@@ -13,49 +13,52 @@ MACRO(SET_COMPONENT_DEPENDENCIES COMPONENT DEPENDENCIES)
 	ENDIF()
 ENDMACRO()
 
+SET(BALL_PACKAGE_VERSION "${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
 
 IF (UNIX AND NOT APPLE)
 	## libraries
-	SET(COMPONENT_LIBBALL "libBALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_LIBVIEW "libVIEW${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
+	SET(COMPONENT_LIBBALL "libBALL${BALL_PACKAGE_VERSION}")
+	SET(COMPONENT_LIBVIEW "libVIEW${BALL_PACKAGE_VERSION}")
 
 	## development
-	SET(COMPONENT_LIBBALL_DEV "libBALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-dev")
-	SET(COMPONENT_LIBVIEW_DEV "libVIEW${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-dev")
+	SET(COMPONENT_LIBBALL_DEV "libBALL${BALL_PACKAGE_VERSION}-dev")
+	SET(COMPONENT_LIBVIEW_DEV "libVIEW${BALL_PACKAGE_VERSION}-dev")
 
 	## Python bindings
-	SET(COMPONENT_PYTHON_BINDINGS_BALL "python-ball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_PYTHON_BINDINGS_VIEW "python-ballview${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
+	SET(COMPONENT_PYTHON_BINDINGS_BALL "python-ball${BALL_PACKAGE_VERSION}")
+	SET(COMPONENT_PYTHON_BINDINGS_VIEW "python-ballview${BALL_PACKAGE_VERSION}")
 
 	## Documentation
-	SET(COMPONENT_DOCUMENTATION_EXAMPLES "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc")
-	SET(COMPONENT_DOCUMENTATION_HTML "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc")
-	SET(COMPONENT_DOCUMENTATION_PDF  "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc")
+	SET(COMPONENT_DOCUMENTATION_EXAMPLES "libball${BALL_PACKAGE_VERSION}-doc")
+	SET(COMPONENT_DOCUMENTATION_HTML "libball${BALL_PACKAGE_VERSION}-doc")
+	SET(COMPONENT_DOCUMENTATION_PDF  "libball${BALL_PACKAGE_VERSION}-doc")
 
 	## applications
-	SET(COMPONENT_BALLVIEW "BALLView${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_QUEASY   "QuEasy${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
+	SET(COMPONENT_BALLVIEW "BALLView${BALL_PACKAGE_VERSION}")
+	SET(COMPONENT_QUEASY   "QuEasy${BALL_PACKAGE_VERSION}")
+	SET(COMPONENT_TOOLS    "BALLTools${BALL_PACKAGE_VERSION}")
 ELSEIF(APPLE)
 	## libraries
-	SET(COMPONENT_LIBBALL "libBALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_LIBVIEW "libVIEW${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
+	SET(COMPONENT_LIBBALL "libBALL${BALL_PACKAGE_VERSION}")
+	SET(COMPONENT_LIBVIEW "libVIEW${BALL_PACKAGE_VERSION}")
 
 	## development
-	SET(COMPONENT_LIBBALL_DEV "libBALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-dev")
-	SET(COMPONENT_LIBVIEW_DEV "libBALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-dev")
+	SET(COMPONENT_LIBBALL_DEV "libBALL${BALL_PACKAGE_VERSION}-dev")
+	SET(COMPONENT_LIBVIEW_DEV "libBALL${BALL_PACKAGE_VERSION}-dev")
 
 	## Python bindings
-	SET(COMPONENT_PYTHON_BINDINGS_BALL "python-ball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_PYTHON_BINDINGS_VIEW "python-ballview${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
+	SET(COMPONENT_PYTHON_BINDINGS_BALL "python-ball${BALL_PACKAGE_VERSION}")
+	SET(COMPONENT_PYTHON_BINDINGS_VIEW "python-ballview${BALL_PACKAGE_VERSION}")
 
 	## Documentation
-	SET(COMPONENT_DOCUMENTATION_EXAMPLES "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc-examples")
-	SET(COMPONENT_DOCUMENTATION_HTML "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc-html")
-	SET(COMPONENT_DOCUMENTATION_PDF  "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc-pdf")
+	SET(COMPONENT_DOCUMENTATION_EXAMPLES "libball${BALL_PACKAGE_VERSION}-doc-examples")
+	SET(COMPONENT_DOCUMENTATION_HTML "libball${BALL_PACKAGE_VERSION}-doc-html")
+	SET(COMPONENT_DOCUMENTATION_PDF  "libball${BALL_PACKAGE_VERSION}-doc-pdf")
 
 	## applications
-	SET(COMPONENT_BALLVIEW "BALLView${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_QUEASY   "QuEasy${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
+	SET(COMPONENT_BALLVIEW "BALLView${BALL_PACKAGE_VERSION}")
+	SET(COMPONENT_QUEASY   "QuEasy${BALL_PACKAGE_VERSION}")
+	SET(COMPONENT_TOOLS    "BALLTools${BALL_PACKAGE_VERSION}")
 ELSEIF(WIN32)
 	## libraries
 	SET(COMPONENT_LIBBALL "Runtime")
@@ -77,27 +80,7 @@ ELSEIF(WIN32)
 	## applications
 	SET(COMPONENT_BALLVIEW "BALLView")
 	SET(COMPONENT_QUEASY   "QuEasy")
-ELSE()
-	## libraries
-	SET(COMPONENT_LIBBALL "libBALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_LIBVIEW "libVIEW${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-
-	## development
-	SET(COMPONENT_LIBBALL_DEV "libBALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-dev")
-	SET(COMPONENT_LIBVIEW_DEV "libVIEW${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-dev")
-
-	## Python bindings
-	SET(COMPONENT_PYTHON_BINDINGS_BALL "python-ball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_PYTHON_BINDINGS_VIEW "python-ballview${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-
-	## Documentation
-	SET(COMPONENT_DOCUMENTATION_EXAMPLES "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc-examples")
-	SET(COMPONENT_DOCUMENTATION_HTML "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc-html")
-	SET(COMPONENT_DOCUMENTATION_PDF  "libball${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-doc-pdf")
-
-	## applications
-	SET(COMPONENT_BALLVIEW "BALLView${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
-	SET(COMPONENT_QUEASY   "QuEasy${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}")
+	SET(COMPONENT_TOOLS    "BALLTools")
 ENDIF()
 
 INCLUDE(source/EXTENSIONS/BALLPluginComponents.cmake)
@@ -115,15 +98,20 @@ SET(BALL_COMPONENTS
  ${COMPONENT_DOCUMENTATION_EXAMPLES}
  ${COMPONENT_DOCUMENTATION_HTML}
  ${COMPONENT_DOCUMENTATION_PDF}
- ${COMPONENT_PLUGINS}
- ${COMPONENT_BALLVIEW}
  "Unspecified"
+ ${COMPONENT_PLUGINS}
 )
 
+IF (BALL_BUILD_BALLAXY)
+	LIST(APPEND BALL_COMPONENTS ${COMPONENT_TOOLS})
+ENDIF()
+
 IF (BALL_BUILD_QUEASY)
 	LIST(APPEND BALL_COMPONENTS ${COMPONENT_QUEASY})
 ENDIF()
 
+LIST(APPEND BALL_COMPONENTS ${COMPONENT_BALLVIEW})
+
 LIST(REMOVE_DUPLICATES BALL_COMPONENTS)
 
 SET_COMPONENT_NAME(${COMPONENT_LIBBALL} 
@@ -206,6 +194,14 @@ SET_COMPONENT_NAME(${COMPONENT_BALLVIEW}
 )
 SET_COMPONENT_DEPENDENCIES(${COMPONENT_BALLVIEW} "${COMPONENT_LIBVIEW}")
 
+IF (BALL_BUILD_BALLAXY)
+	SET_COMPONENT_NAME(${COMPONENT_TOOLS} 
+		"BALLTools"
+		"This package contains a number of command line tools and utilities based on BALL."
+	)
+SET_COMPONENT_DEPENDENCIES(${COMPONENT_TOOLS} "${COMPONENT_LIBBALL}")
+ENDIF()
+
 IF (BALL_BUILD_QUEASY)
 	SET_COMPONENT_NAME(${COMPONENT_QUEASY} 
 		"QuEasy"
diff --git a/cmake/BALLConfigBoost.cmake b/cmake/BALLConfigBoost.cmake
index 4c536e6..4d70979 100644
--- a/cmake/BALLConfigBoost.cmake
+++ b/cmake/BALLConfigBoost.cmake
@@ -1,4 +1,4 @@
-SET(BALL_BOOST_COMPONENTS system thread iostreams regex date_time)
+SET(BALL_BOOST_COMPONENTS system thread iostreams regex date_time serialization chrono)
 if ( WIN32 )
   LIST(APPEND BALL_BOOST_COMPONENTS zlib bzip2)
 	ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK)
diff --git a/cmake/BALLConfigNoexcept.cmake b/cmake/BALLConfigNoexcept.cmake
new file mode 100644
index 0000000..4792c1f
--- /dev/null
+++ b/cmake/BALLConfigNoexcept.cmake
@@ -0,0 +1,13 @@
+CHECK_CXX_SOURCE_COMPILES(
+	"template <class T>
+	void self_assign(T& t) noexcept(noexcept(t = t))
+	{
+	    t = t;
+	}
+	int main(int, char**)
+	{
+		int x = 1;
+		self_assign(x);
+		return 0;
+	}" BALL_HAS_NOEXCEPT
+)
diff --git a/cmake/BALLConfigStdStringFeatures.cmake b/cmake/BALLConfigStdStringFeatures.cmake
new file mode 100644
index 0000000..4d3a9e2
--- /dev/null
+++ b/cmake/BALLConfigStdStringFeatures.cmake
@@ -0,0 +1,56 @@
+CHECK_CXX_SOURCE_COMPILES(
+	"#include <string>
+	int main(int, char**)
+	{
+		std::string s;
+		std::string::const_iterator c_it = s.cbegin();
+
+		return 0;
+	}" BALL_HAS_STD_STRING_CONST_ITERATORS
+)
+
+CHECK_CXX_SOURCE_COMPILES(
+	"#include <string>
+	int main(int, char**)
+	{
+		std::string s;
+		std::string::const_iterator c_it = s.cbegin();
+		s.insert(c_it, 1, 'a');
+
+		return 0;
+	}" BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS
+)
+
+CHECK_CXX_SOURCE_COMPILES(
+	"#include <string>
+	int main(int, char**)
+	{
+		std::string s;
+		s.shrink_to_fit();
+
+		return 0;
+	}" BALL_HAS_STD_STRING_SHRINK_TO_FIT
+)
+
+CHECK_CXX_SOURCE_COMPILES(
+	"#include <string>
+	int main(int, char**)
+	{
+		std::string s;
+		s.front();
+		s.back();
+
+		return 0;
+	}" BALL_HAS_STD_STRING_FRONT_BACK
+)
+
+CHECK_CXX_SOURCE_COMPILES(
+	"#include <string>
+	int main(int, char**)
+	{
+		std::string s(\"a\");
+		s.pop_back();
+
+		return 0;
+	}" BALL_HAS_STD_STRING_POP_BACK
+)
diff --git a/cmake/BALLConfiguration.cmake b/cmake/BALLConfiguration.cmake
index 53f16ff..50ce2cc 100644
--- a/cmake/BALLConfiguration.cmake
+++ b/cmake/BALLConfiguration.cmake
@@ -221,6 +221,12 @@ INCLUDE(cmake/BALLConfigExternTemplates.cmake)
 ## Check for rvalue reference
 INCLUDE(cmake/BALLConfigRValueReferences.cmake)
 
+## Check for the presence of C++11 noexcept
+INCLUDE(cmake/BALLConfigNoexcept.cmake)
+
+## Check for the presence of C++11 features in string
+INCLUDE(cmake/BALLConfigStdStringFeatures.cmake)
+
 ## Test whether vsnprintf is available
 CHECK_FUNCTION_EXISTS(vsnprintf BALL_HAVE_VSNPRINTF)
 
diff --git a/cmake/BALLDoc.cmake b/cmake/BALLDoc.cmake
index f36b7a4..c813ae6 100644
--- a/cmake/BALLDoc.cmake
+++ b/cmake/BALLDoc.cmake
@@ -30,15 +30,15 @@ IF (DOXYGEN_FOUND)
 	## doc
 	ADD_CUSTOM_TARGET(doc ${AUTO_BUILD_DOC}
 										COMMAND ${CMAKE_COMMAND} -E echo ""
-										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
-										COMMAND ${CMAKE_COMMAND} -E echo "Creating html documentation";
-										COMMAND ${CMAKE_COMMAND} -E echo "";   
+										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+										COMMAND ${CMAKE_COMMAND} -E echo "Creating html documentation"
+										COMMAND ${CMAKE_COMMAND} -E echo ""   
 										COMMAND ${CMAKE_COMMAND} -E remove_directory doc/html
 										COMMAND ${CMAKE_COMMAND} -E chdir doc ${DOXYGEN_EXECUTABLE} Doxyfile
-										COMMAND ${CMAKE_COMMAND} -E echo "";
-										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
-										COMMAND ${CMAKE_COMMAND} -E echo "The documentation has been successfully created.";
-										COMMAND ${CMAKE_COMMAND} -E echo "You can now open 'doc/html/index.html' in a web browser.";
+										COMMAND ${CMAKE_COMMAND} -E echo ""
+										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+										COMMAND ${CMAKE_COMMAND} -E echo "The documentation has been successfully created."
+										COMMAND ${CMAKE_COMMAND} -E echo "You can now open 'doc/html/index.html' in a web browser."
 										COMMAND ${CMAKE_COMMAND} -E echo ""
 										COMMENT "Build the doxygen documentation"
 										COMPONENT "${COMPONENT_DOCUMENTATION_HTML}"
@@ -58,17 +58,17 @@ IF (DOXYGEN_FOUND)
 	## doc_tidy
 	ADD_CUSTOM_TARGET(doc_tidy
 										COMMAND ${CMAKE_COMMAND} -E echo ""
-										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
-										COMMAND ${CMAKE_COMMAND} -E echo "Creating html documentation";
-										COMMAND ${CMAKE_COMMAND} -E echo "";   
+										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+										COMMAND ${CMAKE_COMMAND} -E echo "Creating html documentation"
+										COMMAND ${CMAKE_COMMAND} -E echo ""   
 										COMMAND ${CMAKE_COMMAND} -E remove_directory doc/html
 										COMMAND ${CMAKE_COMMAND} -E chdir doc ${DOXYGEN_EXECUTABLE} Doxyfile
-										COMMAND ${CMAKE_COMMAND} -E echo "Running tidy...";
+										COMMAND ${CMAKE_COMMAND} -E echo "Running tidy..."
 										COMMAND ${CMAKE_COMMAND} -E chdir doc/html tidy -m -i -asxml -q -bare -clean *htm* 2>/dev/null | true
-										COMMAND ${CMAKE_COMMAND} -E echo "Finshed Tunning tidy...";
-										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
-										COMMAND ${CMAKE_COMMAND} -E echo "The documentation has been successfully created.";
-										COMMAND ${CMAKE_COMMAND} -E echo "You can now open 'doc/html/index.html' in a web browser.";
+										COMMAND ${CMAKE_COMMAND} -E echo "Finshed Tunning tidy..."
+										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+										COMMAND ${CMAKE_COMMAND} -E echo "The documentation has been successfully created."
+										COMMAND ${CMAKE_COMMAND} -E echo "You can now open 'doc/html/index.html' in a web browser."
 										COMMAND ${CMAKE_COMMAND} -E echo ""
 										COMMENT "Build the doxygen documentation"
 										VERBATIM)
@@ -78,15 +78,15 @@ IF (DOXYGEN_FOUND)
 		## doc_dot target
 		ADD_CUSTOM_TARGET(doc_dot
 											COMMAND ${CMAKE_COMMAND} -E echo ""
-											COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
-											COMMAND ${CMAKE_COMMAND} -E echo "Creating DOT html documentation";
-											COMMAND ${CMAKE_COMMAND} -E echo "";   
+											COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+											COMMAND ${CMAKE_COMMAND} -E echo "Creating DOT html documentation"
+											COMMAND ${CMAKE_COMMAND} -E echo ""   
 											COMMAND ${CMAKE_COMMAND} -E remove_directory doc/html-dot
 											COMMAND ${CMAKE_COMMAND} -E chdir doc ${DOXYGEN_EXECUTABLE} Doxyfile_dot
-											COMMAND ${CMAKE_COMMAND} -E echo "";
-											COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
-											COMMAND ${CMAKE_COMMAND} -E echo "The documentation has been successfully created.";
-											COMMAND ${CMAKE_COMMAND} -E echo "You can now open 'doc/html-dot/index.html' in a web browser.";
+											COMMAND ${CMAKE_COMMAND} -E echo ""
+											COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+											COMMAND ${CMAKE_COMMAND} -E echo "The documentation has been successfully created."
+											COMMAND ${CMAKE_COMMAND} -E echo "You can now open 'doc/html-dot/index.html' in a web browser."
 											COMMAND ${CMAKE_COMMAND} -E echo ""
 											COMMENT "Build the doxygen documentation"
 											VERBATIM)
@@ -104,19 +104,19 @@ IF (LATEX_COMPILER AND DVIPS_CONVERTER)
 	# doc_tutorials target
 	ADD_CUSTOM_TARGET(doc_tutorial ${AUTO_BUILD_DOC}
 										COMMAND ${CMAKE_COMMAND} -E echo ""
-										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
-										COMMAND ${CMAKE_COMMAND} -E echo "Creating BALL pdf tutorial";
-										COMMAND ${CMAKE_COMMAND} -E echo "";   
+										COMMAND ${CMAKE_COMMAND} -E echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+										COMMAND ${CMAKE_COMMAND} -E echo "Creating BALL pdf tutorial"
+										COMMAND ${CMAKE_COMMAND} -E echo ""   
 										COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/	${PDFLATEX_COMPILER} tutorial.tex
 										COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/	${BIBTEX_COMPILER} tutorial
 										COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/	${MAKEINDEX_COMPILER} tutorial.idx
 										COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/	${PDFLATEX_COMPILER} tutorial.tex
 										COMMAND ${CMAKE_COMMAND} -E chdir ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/	${PDFLATEX_COMPILER} tutorial.tex
 										COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/doc/TUTORIAL/tutorial.pdf doc/tutorial.pdf
-										COMMAND ${CMAKE_COMMAND} -E echo "";
-										COMMAND ${CMAKE_COMMAND} -E echo "The BALL tutorial in PDF format has been successfully created:"; 
-										COMMAND ${CMAKE_COMMAND} -E echo "doc/tutorial.pdf"; 
-										COMMAND ${CMAKE_COMMAND} -E echo ""; 
+										COMMAND ${CMAKE_COMMAND} -E echo ""
+										COMMAND ${CMAKE_COMMAND} -E echo "The BALL tutorial in PDF format has been successfully created:" 
+										COMMAND ${CMAKE_COMMAND} -E echo "doc/tutorial.pdf" 
+										COMMAND ${CMAKE_COMMAND} -E echo "" 
 										COMMENT "Build the BALL pdf tutorial"
 										VERBATIM)
 
diff --git a/cmake/BALLMacros.cmake b/cmake/BALLMacros.cmake
index f81ab89..0ac1b87 100644
--- a/cmake/BALLMacros.cmake
+++ b/cmake/BALLMacros.cmake
@@ -6,16 +6,22 @@
 ### minor modifications (marked with ## BALL ###)
 ###
 MACRO(QT4_WRAP_UI_BALL outfiles )
-  QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
-
-	### BALL ###
+  # since 2.8.12 qt4_extract_options has an additional argument
+  # copied fix from OpenMS
+  IF(${CMAKE_VERSION} VERSION_LESS "2.8.12")
+      QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
+  ELSE()
+      QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN})
+  ENDIF()
+
+  ### BALL ###
   # create output directory (will not exist for out-of-source builds)
   FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/BALL/VIEW/UIC/)
 
   FOREACH (it ${ui_files})
     GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
     GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
-		### BALL ###
+    ### BALL ###
     SET(outfile ${PROJECT_BINARY_DIR}/include/BALL/VIEW/UIC/ui_${outfile}.h)
     ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
       COMMAND ${QT_UIC_EXECUTABLE}
diff --git a/cmake/FindFLEX.cmake b/cmake/FindFLEX.cmake
index 068ee75..e2756ea 100644
--- a/cmake/FindFLEX.cmake
+++ b/cmake/FindFLEX.cmake
@@ -76,7 +76,7 @@ IF(FLEX_EXECUTABLE)
   IF(NOT ${FLEX_version_result} EQUAL 0)
     MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_error}")
   ELSE()
-    STRING(REGEX REPLACE "^flex (.*)$" "\\1"
+		STRING(REGEX REPLACE "^.*([0-9]+\\.[0-9]+\\.[0-9]+).*$" "\\1"
       FLEX_VERSION "${FLEX_version_output}")
   ENDIF()
 
diff --git a/cmake/FindRTfact.cmake b/cmake/FindRTfact.cmake
index ccb8903..fe9d59a 100644
--- a/cmake/FindRTfact.cmake
+++ b/cmake/FindRTfact.cmake
@@ -8,32 +8,32 @@ SET(RTFACT_POSSIBLE_ROOT_DIRS
 	$ENV{RTFACT_ROOT_DIR}
 )
 
-## First, try to find the required header files (RTremote/Renderer.hpp)
-FIND_PATH(RTFACT_INCLUDE_PATH 
-	NAMES RTremote/Renderer.hpp
+## First, try to find the required header files (RTpie/IRayTracer.hpp)
+FIND_PATH(RTFACT_INCLUDE_PATH
+	NAMES RTpie/IRayTracer.hpp
 	PATHS ${RTFACT_POSSIBLE_ROOT_DIRS}
 	PATH_SUFFIXES include
 	DOC "RTfact header include dir")
 
 IF (NOT RTFACT_INCLUDE_PATH)
-	MESSAGE(STATUS "Could not find RTfact header file (RTremote/Renderer.hpp)! Real time ray tracing will be disabled!")
+	MESSAGE(STATUS "Could not find RTfact header file (RTpie/IRayTracer.hpp)! Real time ray tracing will be disabled!")
 ELSE()
 	SET(RTFACT_INCLUDE_DIR ${RTFACT_INCLUDE_PATH} CACHE STRING "Full path to the RTfact headers")
 
 	## Now, try to find the rtfact library itself.
-	FIND_LIBRARY(RTFACT_OPT_LIBRARY 
-		NAMES RTfactRemote
-		PATHS ${RTFACT_POSSIBLE_ROOT_DIRS} ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build ${RTFACT_POSSIBLE_ROOT_DIRS} ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/lib ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/Release ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/lib/Release
+	FIND_LIBRARY(RTFACT_OPT_LIBRARY
+		NAMES RTfactRTpie
+		PATHS ${RTFACT_POSSIBLE_ROOT_DIRS} ${RTFACT_POSSIBLE_ROOT_DIRS}/build ${RTFACT_POSSIBLE_ROOT_DIRS}/build/lib ${RTFACT_POSSIBLE_ROOT_DIRS}/build/Release ${RTFACT_POSSIBLE_ROOT_DIRS}/build/lib/Release ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/lib ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/Release ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/lib/Release
 
 		PATH_SUFFIXES lib
-		DOC "RTfact library, optimized") 
+		DOC "RTfact library, optimized")
 
 	## And a possible debug version
 	FIND_LIBRARY(RTFACT_DEBUG_LIBRARY
-		NAMES RTfactRemoted RTfactRemote
-		PATHS ${RTFACT_POSSIBLE_ROOT_DIRS} ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/Debug
+		NAMES RTfactRemoted RTfactRTpie
+		PATHS ${RTFACT_POSSIBLE_ROOT_DIRS} ${RTFACT_POSSIBLE_ROOT_DIRS}/build ${RTFACT_POSSIBLE_ROOT_DIRS}/build/lib ${RTFACT_POSSIBLE_ROOT_DIRS}/build/Debug ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/Debug ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/lib
 		PATH_SUFFIXES lib
-		DOC "RTfact library, debug") 
+		DOC "RTfact library, debug")
 
 	IF (RTFACT_OPT_LIBRARY OR RTFACT_DEBUG_LIBRARY)
 		BALL_COMBINE_LIBS(RTFACT_LIBRARIES ${RTFACT_OPT_LIBRARY} ${RTFACT_DEBUG_LIBRARY})
diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake
index 9923848..984d835 100644
--- a/cmake/FindTBB.cmake
+++ b/cmake/FindTBB.cmake
@@ -46,8 +46,14 @@ if (WIN32)
     if (MSVC10)
         set(_TBB_COMPILER "vc10")
     endif(MSVC10)
+    if (MSVC11)
+        set(_TBB_COMPILER "vc11")
+    endif(MSVC11)
+    if (MSVC12)
+        set(_TBB_COMPILER "vc12")
+    endif(MSVC12)
     if (NOT _TBB_COMPILER)
-        message("ERROR: TBB supports only VC 7.1, 8, 9, and 10 compilers on Windows platforms.")
+        message("ERROR: TBB supports only VC 7.1, 8, 9, 10, 11, and 12 compilers on Windows platforms.")
     endif (NOT _TBB_COMPILER)
     set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
 endif (WIN32)
@@ -66,7 +72,7 @@ if (UNIX)
         set(_TBB_ARCHITECTURE "ia32")
     else (APPLE)
         # LINUX
-        set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
+        set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include" "/usr")
         set(_TBB_LIB_NAME "tbb")
         set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
         set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
@@ -109,7 +115,7 @@ endif (NOT _TBB_INSTALL_DIR)
 # third: try to find path automatically
 if (NOT _TBB_INSTALL_DIR)
     if (_TBB_DEFAULT_INSTALL_DIR)
-        set (_TBB_INSTALL_DIR $ENV{_TBB_DEFAULT_INSTALL_DIR})
+        set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
     endif (_TBB_DEFAULT_INSTALL_DIR)
 endif (NOT _TBB_INSTALL_DIR)
 # sanity check
@@ -157,7 +163,14 @@ endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
 
 
 find_library(TBB_LIBRARY        ${_TBB_LIB_NAME}        ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
+IF (NOT TBB_LIBRARY)
+	find_library(TBB_LIBRARY        ${_TBB_LIB_NAME}        ${TBB_LIBRARY_DIR})
+ENDIF()
+
 find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} ${TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
+IF (NOT TBB_MALLOC_LIBRARY)
+	find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} ${TBB_LIBRARY_DIR})
+ENDIF()
 #TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
 #TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
 mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
diff --git a/cmake/ballaxy/setupBALLAXYDirectories.cmake.in b/cmake/ballaxy/setupBALLAXYDirectories.cmake.in
index cc30ca1..72c1b78 100644
--- a/cmake/ballaxy/setupBALLAXYDirectories.cmake.in
+++ b/cmake/ballaxy/setupBALLAXYDirectories.cmake.in
@@ -5,9 +5,10 @@ ENDFOREACH()
 
 FILE(MAKE_DIRECTORY @BALLAXY_TOOLS_DIR@/config)
 
+SET(ENV{BALL_DATA_PATH} @CMAKE_SOURCE_DIR@/data)
 FOREACH(BALLAXY_TOOL @TOOLS_EXECUTABLES@)
 	EXECUTE_PROCESS(COMMAND @BALLAXY_TOOLS_DIR@/bin/${BALLAXY_TOOL} -write_par @BALLAXY_TOOLS_DIR@/config/${BALLAXY_TOOL}_tmp.xml OUTPUT_QUIET ERROR_QUIET)
-	EXECUTE_PROCESS(COMMAND @BALLAXY_TOOLS_DIR@/bin/GalaxyConfigGenerator -i @BALLAXY_TOOLS_DIR@/config/${BALLAXY_TOOL}_tmp.xml -o @BALLAXY_TOOLS_DIR@/config/${BALLAXY_TOOL}.xml OUTPUT_QUIET ERROR_QUIET)
+	EXECUTE_PROCESS(COMMAND @BALLAXY_TOOLS_DIR@/bin/GalaxyConfigGenerator -i @BALLAXY_TOOLS_DIR@/config/${BALLAXY_TOOL}_tmp.xml -o @BALLAXY_TOOLS_DIR@/config/${BALLAXY_TOOL}.xml --ignore env OUTPUT_QUIET ERROR_QUIET)
 	FILE(REMOVE @BALLAXY_TOOLS_DIR@/config/${BALLAXY_TOOL}_tmp.xml)
 ENDFOREACH()
 
diff --git a/cmake/config.h.in b/cmake/config.h.in
index 76162f9..346b92a 100755
--- a/cmake/config.h.in
+++ b/cmake/config.h.in
@@ -199,6 +199,9 @@
 // This is useful for e.g. an efficient HashGrid implementation
 #cmakedefine BALL_HAS_GNU_SLIST
 
+// Defines whether the compiler supports c++0x-style initializer lists
+#cmakedefine BALL_HAS_INITIALIZER_LISTS
+
 // Defines whether the extern keyword for templates is supported by the compiler.
 // We can use this to speed up compilation and to reduce some warnings in under
 // MSVC.
@@ -211,6 +214,31 @@
 // Defines whether the c++ std lib implementation supports rvalue references in the std::string class
 #cmakedefine BALL_STD_STRING_HAS_RVALUE_REFERENCES
 
+// Defines whether the compiler supports c++11-style noexcept statements
+#cmakedefine BALL_HAS_NOEXCEPT
+
+// for convencience
+#ifdef BALL_HAS_NOEXCEPT
+# define BALL_NOEXCEPT noexcept
+#else
+# define BALL_NOEXCEPT
+#endif
+
+// Defines whether the compiler supports c++11-style const iterators in string
+#cmakedefine BALL_HAS_STD_STRING_CONST_ITERATORS
+
+// Defines whether the c++ std lib implementation supports const_iterators in insert, replace, ...
+#cmakedefine BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS
+
+// Defines whether the c++ std lib implementation supports shrink_to_fit in string
+#cmakedefine BALL_HAS_STD_STRING_SHRINK_TO_FIT
+
+// Defines whether the c++ std lib implementation supports front/back in string
+#cmakedefine BALL_HAS_STD_STRING_FRONT_BACK
+
+// Defines whether the c++ std lib implementation supports pop_back in string
+#cmakedefine BALL_HAS_STD_STRING_POP_BACK
+
 // Defines whether we can overload functions with LongIndex and LongSize safely
 #cmakedefine BALL_ALLOW_LONG64_TYPE_OVERLOADS
 
@@ -242,6 +270,9 @@
 // Define the argument type for xdr_u_hyper (64 bit)
 #cmakedefine BALL_XDR_UINT64_TYPE @BALL_XDR_UINT64_TYPE@
 
+// flex
+#cmakedefine BALL_HAS_YYLEX_DESTROY
+
 // boost
 
 // defined if we have boost::system support
@@ -301,7 +332,7 @@
 
 #cmakedefine BALL_HAS_QTWEBKIT
 
-// Glew
+// gsl
 #cmakedefine BALL_HAS_GSL
 
 // Glew
@@ -310,6 +341,9 @@
 // MPI
 #cmakedefine BALL_HAS_MPI
 
+// TBB
+#cmakedefine BALL_HAS_TBB
+
 // RTfact
 #cmakedefine BALL_HAS_RTFACT
 
diff --git a/data/HTMLBasedInterface/html_de/darstellung.html b/data/HTMLBasedInterface/html_de/darstellung.html
index ddcc98a..dbe33d1 100644
--- a/data/HTMLBasedInterface/html_de/darstellung.html
+++ b/data/HTMLBasedInterface/html_de/darstellung.html
@@ -4,6 +4,7 @@
 		<link rel="stylesheet" href="../css/style.css">
 	</head>
 	<body style="background-color:#000000;color:#FFFFFF;margin:0px 0px 0px 0px" >
+		<script type="text/javascript" src="../scripts/connectVIEW.js"></script>
 		<script language="javascript">
 			<!--
 			function showAnswer(answer_id) {
diff --git a/data/HTMLBasedInterface/html_de/index.html b/data/HTMLBasedInterface/html_de/index.html
index 5b6fc1e..88bd8d1 100644
--- a/data/HTMLBasedInterface/html_de/index.html
+++ b/data/HTMLBasedInterface/html_de/index.html
@@ -4,13 +4,15 @@
 		<link rel="stylesheet" href="../css/style.css">
 	</head>
 	<body style="background-color:#000000;color:#FFFFFF;margin:0px 0px 0px 0px">
-		<script>
+		<!-- <script type="text/javascript" src="../scripts/connectVIEW.js"></script> -->
+		<script type="text/javascript">
 			firsttime=true
 			mini_index=0
 			mini_pics=['../images/cool_scaled.png', '../images/3eml_scaled.png', '../images/1glu2_scaled.png']
 
 			fade_step=0
 
+
 			function animateOpacity(id, from, to, duration, time) {
 				var elem = document.getElementById(id)
 				var opa = (to - from) * time / duration
@@ -41,7 +43,9 @@
 				mini_index = (mini_index == 2) ? 0 : mini_index + 1
 				window.setTimeout("changeMiniPicture()", 5000);
 			}
+		
 		</script>
+		
 		<div id="breadcrumb">
 		Startseite
 		</div>
@@ -66,7 +70,12 @@
 					</p>
 						Das Anzeigen der einzelnen Projekte dauert etwa 4-5 Sekunden, da viele Atome, Bindungen und deren farbliche wie geometrische Darstellung geladen werden müssen.  
 						Mit Hilfe der Maus kannst Du die jeweils angezeigten Moleküle bewegen.
-					<p>
+					  
+						
+				
+
+
+					  <p>
 					</p>
 				</div>
 				<p><div class="actions">
@@ -81,6 +90,7 @@
 <!-- 					<a href="nucleo1_de.html?action=loadProject&module=common_functions&filename=projects/NCP_start.bvp">Das Nukleosom</a> -->
 					<a href="ehec.html?action=loadProject&module=common_functions&filename=projects/intimin.bvp">EHEC</a>
 <!-- 					<a href="project_template.html?action=loadProject&module=common_functions&filename=projects/aspirin.bvp">DEIN PROJEKT</a> -->
+					<a href="wiki_tutorial.html?action=clearAll&module=common_functions">BALLView Tutorial für Lehrer</a>
 				</div></p>
 				<div id="information">
 					Das Projekt BALLView wurde 1996 am Max-Planck Institut für Informatik in Saarbrücken 
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial02.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial02.html
new file mode 100644
index 0000000..1379f64
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial02.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 12 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial I
+  </div>
+
+  <div id="text-content">
+      <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+  
+<p><div class="actions">    
+
+    <blockquote>
+
+      <b>1. Wie ist Ballview aufgebaut</b><br><br>
+
+    <img id="ballview_uebersicht" src="../../images/ballview_uebersicht.jpg"></img><br><br>
+
+     Der graphische Oberfläche von Ballview lässt sich in 5 Gebiete einteilen, die später im Detail erklärt werden.
+     Oben befindet sich eine Leiste mit Menüeinträgen und Buttons. Auf der linken Seite darunter befinden sich 2 kleine 
+     Fenster. Einmal das Strukturfenster, das alle Atome des Moleküls beinhaltet und darunter das Repräsentationsfenster, 
+     das den Inhalt der Darstellung wiedergibt. Rechts davon befindet sich die 3D Ansicht des Moleküls und am unteren Rand 
+     finden wir das Protokollfenster, das Fehlermeldungen und Hinweise gibt. <br><br>
+
+      <img id="ballview_uebersicht" src="../../images/ballview_menueleiste.jpg"></img><br><br>
+
+    
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" onClick="location.href='wiki_tutorial03.html' ">
+       
+    <br> 
+ </div></p> 
+
+  
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial03.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial03.html
new file mode 100644
index 0000000..a5eb109
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial03.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 1 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial II
+  </div>
+
+  <div id="text-content">
+    <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>2. Ein Projekt anlegen</b><br><br>
+
+      Bevor wir richtig loslegen können müssen wir dem Programm sagen, dass wir ein neues Molekül bauen möchten. 
+      Hierzu klicken wir unter <b>Generiere -> Erzeugen eines neuen Moleküls</b>. Im Strukturfenster sehen wir nun, dass 
+      wir ein System erzeugt haben, das ein noch leeres Molekül besitzt. Das Programm geht normalerweise automatisch in 
+      den Editiermodus. Falls dies nicht geschehen ist, klicken Sie bitte auf den 
+      <img id="edit_button" src="../../../graphics/icons/22x22/actions/mode-edit.png"></img>
+      -Button. 
+
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" disabled="disabled" onClick="location.href='wiki_tutorial04.html' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial04.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial04.html
new file mode 100644
index 0000000..1b43eb8
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial04.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 13 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial III
+  </div>
+
+  <div id="text-content">
+  <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>3. Wir bauen Ethan</b><br><br>
+
+      Sobald wir im Editiermodus sind, befindet sich am Ende des Mauszeigers ein kleines c für Kohlenstoff. 
+      Möchte man das Element ändern so kann man dies unter dem Menüeintrag 
+      <img id="molecule-set-element" src="../../../graphics/icons/22x22/actions/molecule-set-element.png"></img>-Button tun.<br>
+      Um ein Kohlenstoff-Atom zu bauen, klicken wir einfach auf eine leere Stelle im 3D-Fenster. 
+      Es erscheint eine graue Kugel, die ein einzelnes Kohlenstoffatom darstellt. Um ein zweites Kohlenstoffatom mit 
+      dem ersten zu verbinden gibt es nun zwei Möglichkeiten:<br>
+
+      Entweder geht man mit dem Mauszeiger auf eine leere Stelle im 3D-Fenster, hält die linke Maustaste gedrückt 
+      und zieht den Mauszeiger rüber zum ersten Kohlenstoffatom. Automatisch erzeugt Ballview ein weiteres C-Atom 
+      und eine Bindung. Oder man klickt auf eine leere Stelle im 3D-Fenster und erhält ein zweites Kohlenstoffatom. 
+      Um beide Atome zu verbinden, markiert man nun im Strukturfenster beide C's mit einem Häkchen und klickt 
+      anschließend auf 
+      <img id="create-bond_button" src="../../../graphics/icons/22x22/actions/create-bond.png"></img>-Button.<br>
+
+      Als nächstes müssen die fehlenden Wasserstoffe aufgefüllt werden. Auch hier gibt es zwei Möglichkeiten.<br>
+
+      Entweder man lässt Ballview automatisch alle Wasserstoffe an den richtigen Stellen auffüllen mittels 
+      <img id="molecule-add-hydrogens" src="../../../graphics/icons/22x22/actions/molecule-add-hydrogens.png"></img>-Button.<br>
+      (Falls der Button grau (inaktiv) sein soll, muss man im Strukturfenster das komplette Molekül markieren.)
+      Oder man wechselt das Element, so dass ein H am Mauszeiger erscheint und fügt manuell jedes Wasserstoffatom einzeln ein. 
+      <br>(Für den nächsten Schritt drücken Sie bitte 
+       <img id="molecule-add-hydrogens" src="../../../graphics/icons/22x22/actions/molecule-add-hydrogens.png"></img>-Button.)<br>
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" disabled="disabled" onClick="location.href='wiki_tutorial05.html' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial05.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial05.html
new file mode 100644
index 0000000..ae331ad
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial05.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 11 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial IV
+  </div>
+
+  <div id="text-content">
+  <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>4. Positionieren der Atome (Energieminimierung)</b><br><br>
+
+      Unser Ethan sieht nun noch etwas seltsam aus. Ballview bietet die Möglichkeit automatisch die Bindungslängen 
+      und Winkel des Moleküls zu korrigieren.<br> Hierzu klickt man einfach auf den
+       <img id="molecule-minimize" src="../../../graphics/icons/22x22/actions/molecule-minimize.png"></img>
+      -Button. Es wird eine Energieminimierung durchgeführt. <br>
+      Falls unser Molekül noch nicht ganz korrekt dargestellt wird (evtl. verdeckte statt gestaffelter Konformation), 
+      kann eine erneute Minimierung Verbesserung schaffen. Zur Not kann auch unter "Molekulare Mechanik->Energy Minimization" 
+      die vollständige Energieminimierung gestartet werden. 
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" disabled="disabled" onClick="location.href='wiki_tutorial06.html' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial06.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial06.html
new file mode 100644
index 0000000..7cad47a
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial06.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 10 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial V
+  </div>
+
+  <div id="text-content">
+  <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>5. Das Molekül richtig betrachten</b><br><br>
+
+      In Ballview hat man die Möglichkeit ein Molekül in beliebiger Richtung zu drehen, verschieben, rotieren und zu 
+      verkleinern oder zu vergrößern. Hierzu muss man zuerst in den Rotiermodus mit dem 
+      <img id="transform-rotate" src="../../../graphics/icons/22x22/actions/transform-rotate.png"></img>-Button wechseln. 
+      Nun gibt es 4 Möglichkeiten die Molekülansicht zu verändern.<br><br>
+      <b>Linke Maustaste</b> gedrückt halten, lässt das Molekül um einen festen Punkt drehen.<br><br>
+      <b>Rechte Maustaste</b> gedrückt halten, lässt das Molekül in eine gewünschte Richtung verschieben, 
+      ohne den Blickwinkel zu verändern.<br><br>
+      <b>Linke und rechte Maustaste</b> gedrückt halten, lässt das Molekül im Uhrzeigersinn rotieren.<br><br>
+      <b>Mausrad</b> scrollen, lässt das Molekül vergrößern oder verkleinern. <br><br>
+      
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" onClick="location.href='wiki_tutorial07.html' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial07.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial07.html
new file mode 100644
index 0000000..923c460
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial07.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 8 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial VI
+  </div>
+
+  <div id="text-content">
+  <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>6. Atome auswählen und markieren</b><br><br>
+
+      Damit einzelne oder auch mehrere Atome bearbeitet werden können, müssen diese zunächst markiert werden.
+      Hierzu kann man entweder im <b>Editiermodus</b> mit einem Rechtsklick auf ein einzelnes Atom in der Szene klicken 
+      und dann im erscheinenden Dialogfenster eine Aktion (z.Bsp.: Lösche Atom) auswählen.
+      Oder man markiert die einzelnen Atome im <b>Strukturen-Fenster</b>. Hierbei muss man zwischen der Markierung mittels 
+      Häkchen und blauem Balken unterscheiden. Bei der Häkchenmarkierung werden die entsprechenden Atome farblich im 
+      3D-Fenster markiert und können später im Schiebemodus (siehe Punkt 7) verschoben werden. Möchte man jedoch mehrere 
+      Atome löschen so müssen diese mittels Strg- oder Shift-Taste + linke Maustaste "blau" markiert bzw. ausgewählt 
+      werden. Anschließend kann man mit rechter Maustaste auf die blaue Markierung klicken und eine gewünschte Aktion 
+      für die getroffene Auswahl durchführen.
+      Ballview bietet allerdings auch einen eigenen <b>Auswahlmodus</b>
+      <img id="select-rectangular" src="../../../graphics/icons/22x22/actions/select-rectangular.png"></img>
+      , in dem die Atome im 3D-Fenster direkt markiert werden 
+      können. Hierzu klickt man entweder mit der linken Maustaste auf ein einzelnes Atom oder man hält die linke 
+      Maustaste gedrückt und zieht eine Markierungsfläche über eine ganze Gruppe von Atomen. Zeitgleich werden im 
+      Strukturenfenster bei den entsprechenden Atomen Häkchen gesetzt. Mit einem Rechtsklick auf das entsprechende Atom 
+      kann die Markierung wieder aufgehoben werden. 
+      
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" disabled="disabled" onClick="location.href='wiki_tutorial08.html' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial08.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial08.html
new file mode 100644
index 0000000..ded1a69
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial08.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 8 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial VII
+  </div>
+
+  <div id="text-content">
+  <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>7. Der Schiebemodus</b><br><br>
+
+      Die im letzten Schritt markierten Atome können nun im <b>Schiebemodus</b>
+      <img id="transform-move" src="../../../graphics/icons/22x22/actions/transform-move.png"></img>
+      getrennt vom restlichen Molekül verschoben 
+      werden. Mit linker Maustaste kann so eine komplette Molekülgruppe weggezogen werden oder mit der rechten 
+      Maustaste gedreht werden. 
+      
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" disabled="disabled" onClick="location.href='wiki_tutorial09.html' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial09.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial09.html
new file mode 100644
index 0000000..91fcb7d
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial09.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 8 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial VIII
+  </div>
+
+  <div id="text-content">
+  <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>8. Modelldarstellung verändern</b><br><br>
+
+    Ballview bietet eine ganze Reihe von verschiedenen Modelldarstellungen. Man hat die Möglichkeit die aktuelle 
+    Darstellung zu verändern oder parallel weitere hinzuzufügen. Nach Erstellung können diese beliebig durch 
+    Häkchen ein- und ausgeblendet werden.<br>
+    Möchte man nur die aktuelle Darstellung verändern, klickt man mit rechter Maustaste im Repräsentationsfenster 
+    auf das aktuelle Modell und anschließend im erscheinenden Dialogfenster auf Modell ändern. Im darauf folgenden 
+    Dialog kann man unter Typ verschiedene Modelle (Stäbchenmodell, Van der Waal,...) auswählen und mit dem Apply-Button 
+    direkt verändern.<br>
+    Um eine neue Darstellung hinzuzufügen klickt man mit rechter Maustaste im Strukturenfenster auf das entsprechende 
+    Molekül, dann auf <b>Erzeuge Repräsentation->Stäbchen->nach Element</b>. Dadurch erscheint nun im Repräsentationsfenster ein 
+    neuer Eintrag. 
+    Je nachdem welches Modell dargestellt werden soll, können die Modelle mittels Häkchen ein- und ausgeblendet werden.<br><br> 
+    <img id="ballview_repraesentation" src="../../images/ballview_repraesentation.jpg"></img><br><br>  
+    (Die Darstellungen können auch jederzeit mit rechter Maustaste oder Entf-Taste im Repräsentationsfenster wieder 
+    gelöscht werden.) 
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" disabled="disabled" onClick="location.href='wiki_tutorial10.html' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial10.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial10.html
new file mode 100644
index 0000000..0f89bd5
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial10.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 1 </script>
+<script type="text/javascript" src="../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial IX
+  </div>
+
+  <div id="text-content">
+  <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>9. Herunterladen fertiger Moleküle</b><br><br>
+
+      Damit man größere Moleküle nicht jedes Mal von Hand selbst erstellen muss, gibt es in Ballview verschiedene 
+      Datenbankanbindungen von denen man fertige Moleküle herunterladen kann. Es stehen die folgenden drei Datenbanken 
+      zur Auswahl:<br><br>
+
+      <img id="download-pubchem" src="../../../graphics/icons/22x22/actions/download-pubchem.png"></img>
+      <b>Pubchem</b> (Chemiedatenbank, empfohlen)<br>
+      <img id="download-electrondensity" src="../../../graphics/icons/22x22/actions/download-electrondensity.png"></img>
+      <b>EDS</b> (Electron Density Server)<br>
+      <img id="download-pdb" src="../../../graphics/icons/22x22/actions/download-pdb.png"></img>
+      <b>RCSB</b> (Proteindatenbank) <br><br>
+
+      Um ein fertiges Molekül zu laden, klickt man auf eines der obigen Symbole, zum Beispiel Pubchem. Daraufhin 
+      öffnet sich ein Fenster, in dem man unten im Feld neben dem Wort Pubchem den gewünschten Begriff (z.Bsp.: Aspirin) 
+      eingibt und anschließend auf den Button Pubchem klickt. Ballview startet nun die Suche und liefert eine ganze Liste von 
+      Vorschlägen, die das gewünschte Molekül enthalten. Mit der linken Maustaste klickt man das gesuchte Molekül an und 
+      lädt es mit dem Einfügen-Button in das Programm. 
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" disabled="disabled" onClick="location.href='wiki_tutorial11.html' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial11.html b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial11.html
new file mode 100644
index 0000000..abbccd5
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/lehrer/wiki_tutorial11.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 1 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial X
+  </div>
+
+  <div id="text-content">
+  <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+
+      <b>10. Die Arbeit speichern</b><br><br>
+
+      Damit Lehrer und Schüler ihre in der Schule oder zu Hause erstellte Arbeit weiter verarbeiten können, bietet 
+      Ballview drei Möglichkeiten der Speicherung:<br><br>
+
+      - ein einzelnes System als Datei speichern <img id="document-save" src="../../../graphics/icons/22x22/actions/document-save.png"></img>
+      (Atom- und Molekülnamen gehen verloren)<br><br>
+      - das komplette Projekt als Datei speichern mit <b>Datei->Projekt speichern</b> (empfohlen)<br><br>
+      - das 3D-Fenster mit dem <img id="screenshot" src="../../../graphics/icons/22x22/actions/screenshot.png"></img>
+	-Button als <b>Bilddatei</b> (.png) speichern <br>
+      </blockquote>
+	  
+     <input type="button" id="button1" value="zurück zum Index" onClick="location.href='index.html?action=clearAll&module=common_functions' ">
+       
+    <br> 
+   </div></p>
+
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_de/wiki_tutorial.html b/data/HTMLBasedInterface/html_de/wiki_tutorial.html
new file mode 100644
index 0000000..6df898c
--- /dev/null
+++ b/data/HTMLBasedInterface/html_de/wiki_tutorial.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 14 </script>
+<script type="text/javascript" src="../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Wiki Tutorial
+  </div>
+
+  <div id="text-content">
+      
+
+      <h3>Einführungstutorial für BALLView für Lehrer und Schüler in 10 Schritten</h3>
+
+<p><div class="actions">
+      <blockquote>
+      
+      <b>Wofür ist BALLView gedacht?</b> <br><br>
+
+      BALLView wurde ursprünglich für die wissenschaftliche Arbeit an der Universität im Bereich Bioinformatik 
+      programmiert. Hieraus wurde eine Schulversion für den Chemie- bzw. Biologieunterricht entwickelt. Mit BALLView 
+      können Lehrer und Schüler auf einfachste Weise Moleküle, wie Proteine oder DNA selbstständig bauen und 
+      dreidimensional drehen und betrachten. Aber auch größere Moleküle lassen sich durch die Anbindung verschiedener 
+      Datenbanken herunterladen und von allen Seiten betrachten. 
+
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Weiter" onClick="location.href='lehrer/wiki_tutorial02.html' ">
+</div></p>       
+    <br> 
+   
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/index.html b/data/HTMLBasedInterface/html_eng/index.html
index 7bdcfc0..509e6bd 100644
--- a/data/HTMLBasedInterface/html_eng/index.html
+++ b/data/HTMLBasedInterface/html_eng/index.html
@@ -41,6 +41,11 @@
 				mini_index = (mini_index == 2) ? 0 : mini_index + 1
 				window.setTimeout("changeMiniPicture()", 5000);
 			}
+
+			function onBALLViewRepresentationsMessage(int i){
+			
+				alert("Got RepresentationMessage " + i)
+			}
 		</script>
 		<div id="breadcrumb">
 		Main Page
@@ -78,6 +83,7 @@
 					<a href="hiv.html?action=loadProject&module=common_functions&filename=projects/2HMI_DNA.bvp">HIV</a>
 <!-- 					<a href="nucleo1_en.html?action=loadProject&module=common_functions&filename=projects/NCP_start.bvp">The Nucleosome</a> -->
 					<a href="ehec.html?action=loadProject&module=common_functions&filename=projects/intimin.bvp">EHEC</a>
+					<a href="tutorial_dialog.html?action=clearAll&module=common_functions">BALLView Demo tutorial</a>
 				</div>
 				<div id="content">
 					The BALLView project was started in 1999 at the Max-Planck-Institute for Informatics in Saarbrücken.<br> 
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog02.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog02.html
new file mode 100644
index 0000000..a75e80e
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog02.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 2 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog II
+  </div>
+
+  <div id="text-content">
+    <blockquote>
+
+      <h3>Rotating the camera</h3>
+
+      After we created the peptide we can freely position the camera:
+      To do so click with a mouse button into the 3D graphics view and drag the mouse:
+      <br><br>
+         Left button: Rotate <br>
+         Middle or Wheel: Zoom<br>
+         Right button: Move view <br>
+      <br>
+      When you are finished playing around with the camera,
+      center the camera on the peptide:
+      Find the widget with the name <b>Structures</b> and
+      highlight the System by <b>clicking on its name ("ARND").</b><br>
+      Then press the right mouse button to open a context menu and press on the
+      <b>Focus</b> entry.<br>
+      This will enable the next step of the tutorial. <br> 
+      Press Next to continue.
+
+      </blockquote>
+	  
+    
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial_dialog03.html' ">
+       
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog03.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog03.html
new file mode 100644
index 0000000..8302d69
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog03.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 3 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog III
+  </div>
+
+  <div id="text-content">
+    <blockquote>
+
+    <h3>Hierarchy of molecules</h3>
+
+    Now lets have a look at the peptides hierarchy.<br>
+    The "Structures" widget contains a hierarchical list of all loaded
+    molecules. Click the cross to the left of the name of your
+    newly created protein to open the hierarchy tree.<br>
+    Repeat this for the appearing levels to see, that the peptide clearly consists of four amino acids
+    (if you entered the sequence correctly).
+    <br><br>
+    The checkboxes at the right side of the entries can be used to ''mark'' entries e.g.
+    for identifying them in the 3D view. Try to check on some box and then uncheck it again.
+    <br><br>
+    When you are finished playing around with the hierarchy,
+    ''highlight'' the System by clicking on its name ("ARND"). <br>
+    This will take you to the next step of the tutorial. <br>
+    Press Next to continue.
+    </blockquote>
+    
+    
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial_dialog04.html' ">
+       
+   
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog04.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog04.html
new file mode 100644
index 0000000..6fe23d1
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog04.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 4 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog IV
+  </div>
+
+  <div id="text-content">
+    <blockquote>
+
+    <h3> Molecular Dynamics Simulation </h3>
+
+    Now we will simulate the peptides natural movements 
+    by performing a molecular dynamics simulation (MDS). To do so,
+    open the according dialog by using the menu entry <br>
+    <b>"Molecular Mechanics -> Molecular Dynamics"</b><br>
+    (The menu entry is only enabled if a System is highlighted.)<br>
+    <br>
+    Now we have to perform some settings:<br>
+    Set the number of iterations to 100.<br>
+    To accelerate the MDS, set the timestep to 0.001. <br>
+    Set the temperature to 400 K.<br>
+    Select the force field "<b>AMBER</b>".<br>
+    <br>
+    Also, we want to be able to visualise the resulting trajectories.
+    To do so, click the checkbox <b>save to</b>.
+    Then click <b>"Simulate"</b>.
+    <br>
+    The next step becomes available, when the simulation has finished
+    and a trajectory file was created.
+    <br><br>
+    Press Next to continue.
+
+    </blockquote>
+
+    
+    
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial_dialog05.html' ">
+       
+    
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog05.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog05.html
new file mode 100644
index 0000000..817dfad
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog05.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 5 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog V
+  </div>
+
+  <div id="text-content">
+	<blockquote>
+
+      <h3> Visualisation of trajectories </h3>
+
+    To visualise the resulting trajectory, we will have a look at the 
+    DatasetControl. It is one of the listviews in the main window and
+    has the caption "Datasets". 
+    (Maybe it is hidden, if you don't find it, have a look at the menu
+    entry <b>"Windows->Datasets"</b>.)
+    <br><br>
+    The DatasetControl should have an entry for the trajectory.
+    To visualize it, click on the entry and open the context menu with
+    the right mouse button. First choose "<b>Buffer Trajectory</b>" and then 
+    "<b>Visualize Trajectory</b>". <br>
+    In the Snapshot Visualization dialog press "<b>Animate</b>".<br>
+    Feel free to watch the visualization for as long as you want, you can stop it, by pressing
+    the "Cancel" button. Then close the visualization dialog by pressing the <b>Close</b> button.
+    <br>
+    <br>
+    Press Next to continue.
+    </blockquote>
+    
+    
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial_dialog06.html' ">
+       
+    
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog06.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog06.html
new file mode 100644
index 0000000..e4ae366
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog06.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 6 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog VI
+  </div>
+
+  <div id="text-content">
+      <blockquote>
+
+	      <h3> Calculation of electrostatics </h3>
+
+      Now we will have a look at the peptides electrostatics. To do so, 
+      highlight the System again and open the <b>FDPB options dialog</b> via the menu 
+      entry <b>"Tools->FDPB Electrostatics"</b>. <br>
+      In the dialog all kind of settings
+      can be done, but for now we take the <b>Defaults</b> and press "<b>OK</b>". 
+      <br><br>
+      The result is a (so far unvisualized) three dimenisonal grid around the molecule with its
+      electrostatics, which is now added to the Datasets list.
+      <br>
+      <br>
+      Press Next to continue.
+      </blockquote>
+    
+    
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial_dialog07.html' ">
+       
+    
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog07.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog07.html
new file mode 100644
index 0000000..dd5c27a
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog07.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 7 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog VII
+  </div>
+
+  <div id="text-content">
+     <blockquote>
+
+      <h3> Creating a Solvent Excluded Surface </h3>
+
+    Next we want to visualise the peptides electrostatics. To do so, we
+    will first create a Solvent Excluded Surface (SES),
+    which we will colorize accordingly later.
+    <br>
+    To create a SES, highlight the System and open the context menu 
+    with the right mouse button. Select 
+    <br>"<b>Create Representation->SES->by element</b>".<br> 
+    <br>
+    The resulting SES will show up in the "Representations" widget.
+    <br>
+    <br>
+    Press Next to continue.
+    </blockquote>
+	
+    
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial_dialog08.html' ">
+       
+    
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog08.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog08.html
new file mode 100644
index 0000000..f622308
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog08.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 8 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog VIII
+  </div>
+
+  <div id="text-content">
+     <blockquote>
+
+    <h3>Coloring a SES by electrostatics</h3>
+
+    Now we will colorize the SES. 
+    Find the "Representations" widget and
+    highlight its representation.<br>
+    Then press "<b>Modify Representation</b>" in the context menu of the SES.<br>
+    In the newly opened dialog, select the <b>Color By Grid</b> tab.
+    <br>
+    We will now interpolate the colors of the SES
+    between some selected values. For now the most negative and 
+    positive values in the grid are used, but you can also change them
+    to your liking. Just press "<b>OK</b>" and have a look at 
+    the SES. 
+    <br><br>
+    If you want to, you can try some other 
+    settings and colors before we continue with the tutorial. 
+    The colors can be changed by clicking on the button "<b>Select</b>".
+    <br>
+    <br>
+    Press Next to continue.
+
+    </blockquote>
+	
+    
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial_dialog09.html' ">
+       
+    
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog09.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog09.html
new file mode 100644
index 0000000..ca134d0
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog09.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 8 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog IX
+  </div>
+
+  <div id="text-content">
+	<blockquote>
+
+      <h3> Creating a isocontour surface </h3>
+
+    An other way to visualise the electrostatics grid are isocontour surfaces which 
+    connect all neighbouring points in the grid which have the same electrostatic 
+    value. <br>
+    We will now create such a isocontour surface:<br>
+    First find the </b>"Datasets"</b> widget, then highlight the FDPB dataset and use its 
+    context menu or the menu entry "<b>Tools->Grids->Render Contour Surface</b>" to
+    create the surface.<br>
+    In the now open dialog enter the value <b>0.01</b> as threshold and press "<b>OK</b>".
+    <br>
+    It also possible to create multiple iso surface with different colors.
+    <br>
+    <br>
+    Press Next to continue.
+    </blockquote>
+	
+    
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial_dialog10.html' ">
+       
+    
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog10.html b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog10.html
new file mode 100644
index 0000000..5da8c50
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial/tutorial_dialog10.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 10 </script>
+<script type="text/javascript" src="../../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog X
+  </div>
+
+  <div id="text-content">
+    <blockquote>
+
+    <h3>The End</h3>
+
+    <b>Congratulations</b>, you successfully finished the the tutorial, 
+    which showed you a selection of BALLViews main features.<br> 
+    Feel free to explore its other functions, e.g. by having a look at the BALLView documentation.<br>
+    <br>
+    Press Cancel to close the tutorial or Next to open the documentation.
+    </blockquote>
+		
+    
+     <input type="button" id="button1" value="back to index" onClick="location.href='index.html?action=clearAll&module=common_functions' ">
+       
+    
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/html_eng/tutorial_dialog.html b/data/HTMLBasedInterface/html_eng/tutorial_dialog.html
new file mode 100644
index 0000000..edfab16
--- /dev/null
+++ b/data/HTMLBasedInterface/html_eng/tutorial_dialog.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+
+<html>
+<head>
+  <meta name="generator" content=
+  "HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
+
+  <title>Tutorial Dialog</title>
+  <link rel="stylesheet" href="../css/style.css" type="text/css">
+</head>
+
+<body>
+<script type="text/javascript"> var current_step = 1 </script>
+<script type="text/javascript" src="../scripts/connectVIEW.js"></script>
+  <div class="navigation" id="breadcrumb">
+    <a href=
+    "index.html?action=clearAll&module=common_functions">Startseite</a> > Tutorial Dialog
+  </div>
+
+  <div id="text-content">
+      <blockquote>
+
+      <h3>Building a peptide from a given sequence</h3>
+
+      Welcome to the BALLView tutorial. It will show you some of 
+      BALLViews main features. The tutorial takes approximately 15 minutes and 
+      is divided in several steps, which have to be finished one by one.
+      The button "Next" will be enabled after finishing each individual step.
+      <br>
+      <br>
+      We start by building a polypeptide from an aminoacid sequence.
+      To do so, open the PeptideBuilder dialog by clicking the menu entry
+      <br>
+      <b>"Build->BuildPeptide"</b>.
+      <br>
+      <br>
+      Then enter the sequence ARND with the keyboard in the label field at the top. 
+      (As an alternative you can also press the upper four amino acid buttons.)
+      This will create a polypeptide with the aminosequence
+      (Alanin, Arginin, Asparagine, Aspartic acid). 
+      <br>
+      Then press the "<b>Build</b>" button.This will enable the next step of the tutorial.
+      Press Next to continue.
+
+      </blockquote>
+	  
+     <input type="button" id="button1" value="Next" disabled="disabled" onClick="location.href='tutorial/tutorial_dialog02.html' ">
+       
+    <br> 
+   
+  </div>
+</body>
+</html>
diff --git a/data/HTMLBasedInterface/images/ballview_menueleiste.jpg b/data/HTMLBasedInterface/images/ballview_menueleiste.jpg
new file mode 100644
index 0000000..f188387
Binary files /dev/null and b/data/HTMLBasedInterface/images/ballview_menueleiste.jpg differ
diff --git a/data/HTMLBasedInterface/images/ballview_repraesentation.jpg b/data/HTMLBasedInterface/images/ballview_repraesentation.jpg
new file mode 100644
index 0000000..fe89faa
Binary files /dev/null and b/data/HTMLBasedInterface/images/ballview_repraesentation.jpg differ
diff --git a/data/HTMLBasedInterface/images/ballview_uebersicht.jpg b/data/HTMLBasedInterface/images/ballview_uebersicht.jpg
new file mode 100644
index 0000000..62101cc
Binary files /dev/null and b/data/HTMLBasedInterface/images/ballview_uebersicht.jpg differ
diff --git a/data/HTMLBasedInterface/scripts/common_functions.py b/data/HTMLBasedInterface/scripts/common_functions.py
index 7ae2afd..0b04d4b 100644
--- a/data/HTMLBasedInterface/scripts/common_functions.py
+++ b/data/HTMLBasedInterface/scripts/common_functions.py
@@ -384,6 +384,7 @@ def addPlane(plane_specifier, height, boundary, bottom = True):
   getMainControl().insert(r)
   getMainControl().update(r)
 
+###################### PRESENTABALL: #######################
 def selectByExpression(expression):
   getMainControl().clearSelection()
   getMolecularControl().applySelector(String(expression)) 
@@ -403,7 +404,8 @@ def setViewPoint(view_point, look_at, look_up):
   camera.setLookUpVector(getVectorFromURLString(look_up))
   setCamera(camera)
   Scene.getInstance(0).applyStereoDefaults()
-
+  # trigger an update
+  getMainControl().update(getRepresentations()[0])
 
 def selectByExpressionAndSetViewPoint(expression, view_point, look_at, look_up):
   setViewPoint(view_point, look_at, look_up)
@@ -417,21 +419,44 @@ def toggleRepresentationByName(name):
       rep.setHidden(not rep.isHidden())
       getMainControl().update(rep)
 
+def toggleRepresentationsByNames(names):
+  reps = getRepresentations()
+  rep_names = names.split(",")
+  #for name in rep_names:
+  #  print "++"+name + "++"
+  for rep in reps:
+    if rep.getName() in rep_names:
+      rep.setHidden(not rep.isHidden())
+      #print "switch rep", rep.getName(), rep.isHidden()
+      getMainControl().update(rep)
 
 def toggleSelectionByExpression(expression):
   if (len(getSelection()) == 0):
     getMolecularControl().applySelector(String(expression))
   else:
     getMainControl().clearSelection()
-    
+
 def showOnlyRepresentationByName(name):
+  showOnlyRepresentationsByNames(name)
+
+def showOnlyRepresentationsByNames(names):
   reps = getRepresentations()
-  
+  rep_names = names.split(",")
+
   for rep in reps:
-    print rep.getName()," ",name, rep.getName() == name
-    if rep.getName() == name:
+    print rep.getName()," ",rep.getName() in rep_names
+    if rep.getName() in rep_names:
       rep.setHidden(False)
     else:
       rep.setHidden(True)
-  getMainControl().update(rep)
+    getMainControl().update(rep)
+
+# for debugging
+def listRepresentations():
+  print "available representations:"
+  reps = getRepresentations()
+  for rep in reps:
+    print rep.getName()
+  print "-------------"
+
 
diff --git a/data/HTMLBasedInterface/scripts/connectVIEW.js b/data/HTMLBasedInterface/scripts/connectVIEW.js
new file mode 100644
index 0000000..bbbe1e0
--- /dev/null
+++ b/data/HTMLBasedInterface/scripts/connectVIEW.js
@@ -0,0 +1,282 @@
+// include this file (connectVIEW.js) to every webpage that
+// shall be able to react on VIEW messages
+current_action = -1;
+
+var MsgClass = {
+		    "UNDEFINED" : -1,
+		    "COMPOSITE" : 0,  
+		    "REPRESENTATION": 1, 
+		    "SCENE": 2,
+		    "DATASET": 3
+		};
+
+var MsgTypeComp = { 
+		// Undefinded (default) type
+		"UNDEFINED" : -1,
+		
+		
+		//Composite ENUMS
+		/* A new composite to be added 
+		 		MolecularStructure will add bonds, normalize names and send a msg with type NEW_MOLECULE afterwards.
+		*/
+		"NEW_COMPOSITE": 0,
+		
+		// A Composite to be removed
+		"REMOVED_COMPOSITE": 1,
+		
+		// Update all datas for a Composite (but not in the MolecularControl)
+		"CHANGED_COMPOSITE": 2,
+		
+		// Update all datas for a composite (also in MolecularControl)
+		"CHANGED_COMPOSITE_HIERARCHY": 3,
+		
+		// selected a composite (e.g. per checkboxes in MolecularControl)
+		"SELECTED_COMPOSITE": 4,
+		
+		// deselected a composite (e.g. per checkboxes in MolecularControl)
+		"DESELECTED_COMPOSITE": 5,
+		
+		// center the camera on a composite
+		"CENTER_CAMERA": 6
+		/* MolecularControl will add the Composite.
+		  	DisplayProperties will create a Representation
+		*/
+		};
+var MsgTypeSce = {		
+		// Undefinded (default) type
+		"UNDEFINED" : -1,
+		
+		//Build new molecule
+		"NEW_MOLECULE": 0,
+
+		// Rebuild the GLDisplayList objects in the GLRenderer
+		"REBUILD_DISPLAY_LISTS": 1,
+		
+		// Redraw from the GLDisplayList objects
+		"REDRAW": 2,
+
+		// Move the Camera in the Scene to the value in this message
+		"UPDATE_CAMERA": 3,
+		
+		// Remove the coordinate system in the Scene.
+		"REMOVE_COORDINATE_SYSTEM": 4,
+
+		// Export a PNG
+		"EXPORT_PNG": 5,
+
+		// Export a POVRay
+		"EXPORT_POVRAY": 6,
+
+		// 
+		"ENTER_ROTATE_MODE": 7,
+
+		// 
+		"ENTER_PICKING_MODE": 8,
+
+		// Move Composites or a Clipping Plane
+		"ENTER_MOVE_MODE": 9,
+
+		// A previous export has finished
+		"EXPORT_FINISHED": 10
+		};
+		
+var MsgTypeRep = {	
+		// Undefinded (default) type
+		"UNDEFINED" : -1,
+		
+		// Add a Representation
+		"ADD": 0,
+
+		// Remove a Representation
+		"REMOVE": 1,
+
+		// Update the Representation
+		"UPDATE": 2,
+
+		// Representation was selected in GeometriControl
+		"SELECTED": 3,
+
+		// Started the update of a Representation, no changes allowed in GeometricControl
+		"STARTED_UPDATE": 4,
+
+		// Finished the update of a Representation
+		"FINISHED_UPDATE": 5,
+
+		// Add a Representation to GeometricControl, but dont update in Scene
+		"ADD_TO_GEOMETRIC_CONTROL": 6
+	}; 
+
+var MsgTypeDataSet = {
+			/// Default Value
+			"UNDEFINED": -1,
+
+			/// To add 
+			"ADD": 0,
+
+			/// To be removed 
+			"REMOVE": 1,
+
+			/// Update 
+			"UPDATE": 2,
+
+			/// Was selected in Control
+			"SELECTED": 3,
+
+			///
+			"VISUALIZE": 4,
+
+			/// Allow >90 different kinds of visualization
+			"VISUALIZE_END": 100
+		};
+
+function onJSMessage(i, j) { //i = Message Class, j = Message Type
+	switch (current_step)
+	{
+	  case 1: // Create a peptide
+	  {
+		  if (j != MsgTypeSce.NEW_MOLECULE) return; 
+	    
+		  document.getElementById('button1').disabled=false;
+		  
+		  
+		  break;
+	  }
+	  case 2: // Focusing
+	  {
+		  if (i != MsgClass.SCENE) return;
+		  document.getElementById('button1').disabled=false;
+		  break;
+	  }
+	  case 3: // Hierarchy
+	  {
+		    document.getElementById('button1').disabled=false;
+		    break;
+	  }
+	  case 4: //Molecular Dynamics Simulation
+	  {
+		    
+		   if (i != MsgClass.DATASET) return;
+		   
+		  document.getElementById('button1').disabled=false;  
+		  break; 
+	  }
+	  case 5: // Visualisation of trajectories
+	  {
+		    
+		   if (j != MsgTypeComp.CHANGED_COMPOSITE) return;
+		   
+		  document.getElementById('button1').disabled=false;  
+		  break; 
+	  }
+	  case 6: // Calculation of electrostatics
+	  {
+		    
+		   if (i != MsgClass.DATASET && j != MsgTypeDataSet.ADD) return;
+		   
+		  document.getElementById('button1').disabled=false;  
+		  break; 
+	  }
+	  case 7: // Creating a Solvent Excluded Surface
+	  {
+		    
+		   if (j != MsgTypeRep.ADD_TO_GEOMETRIC_CONTROL) return;
+		   
+		  document.getElementById('button1').disabled=false;  
+		  break; 
+	  }
+	  case 8: // Coloring a SES by electrostatics
+	  {
+		    
+		   if (j != MsgTypeRep.UPDATE) return;
+		   
+		  document.getElementById('button1').disabled=false;  
+		  break; 
+	  }
+	  case 9: // Creating a isocontour surface
+	  {
+		    
+		   if (j != MsgTypeRep.ADD) return;
+		   
+		  document.getElementById('button1').disabled=false;  
+		  break; 
+	  }
+	  
+	  case 10: // Ending
+	  { 
+		  break; 
+	  }
+	
+	}
+	
+}//end function onJSMessage
+
+
+function onJSActionSignal(i) { //i = ActionType
+	
+	if (current_action == i)
+	{
+		return;
+	}
+	current_action = i;
+
+	// alert("Action Type " + i);
+	switch (current_step)
+	{
+	  case 11: // optimizing = 2
+	  {
+		  if (i != 2) return; 
+	    
+		  document.getElementById('button1').disabled=false;
+		  
+		  break;
+	  }
+	  case 12: // bondorder = 3
+	  {
+		  if (i != 3) return;
+		 
+		  document.getElementById('button1').disabled=false;
+		 
+		  break;
+	  }
+	  case 13: // add_hydrogens = 1
+	  {
+		  if (i != 1) return;
+		  
+		  document.getElementById('button1').disabled=false;
+		  
+		  break;
+	  }
+	  case 14: // Ending
+	  { 
+		  break; 
+	  }
+	//break;
+	}
+	
+}
+
+try
+{
+	mywebview.fireJSActionSignal.connect(onJSActionSignal);
+}
+catch (e)
+{
+	// if connection does not work an exception is thrown
+	alert(e);
+}
+
+try
+{
+	// connect handler method to the fireJSCompositeMessage signal
+	// of the exposed HTMLBasedInterface object
+	mywebview.fireJSMessage.connect(onJSMessage);
+}
+catch (e)
+{
+	// if connection does not work an exception is thrown
+	alert(e);
+}
+
+
+ 
+
diff --git a/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h b/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h
index 98cb7d5..05818b5 100644
--- a/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h
+++ b/include/BALL/DATATYPE/GRAPH/graphAlgorithms.h
@@ -150,7 +150,7 @@ namespace BALL
 		{
 			typename GraphTraits<UndirectedGraph>::NeighbourIterator ai, bi, ai_end;
 
-			for (tie(ai, ai_end) = adjacent_vertices(vertex, graph); ai != ai_end; ++ai)
+			for (boost::tie(ai, ai_end) = adjacent_vertices(vertex, graph); ai != ai_end; ++ai)
 			{
 				bi = ai; ++bi;
 				for (; bi != ai_end; ++bi)
@@ -177,7 +177,7 @@ namespace BALL
 			typename GraphTraits<UndirectedGraph>::NeighbourIterator ai, bi, ai_end;
 			UndoEliminateOperation<UndirectedGraph> result(graph, vertex);
 
-			for (tie(ai, ai_end) = adjacent_vertices(vertex, graph); ai != ai_end; ++ai)
+			for (boost::tie(ai, ai_end) = adjacent_vertices(vertex, graph); ai != ai_end; ++ai)
 			{
 				result.getNeighbours().push_back(boost::get(boost::vertex_index, graph, *ai));
 
diff --git a/include/BALL/DATATYPE/string.h b/include/BALL/DATATYPE/string.h
index bd033ed..bf9a54a 100644
--- a/include/BALL/DATATYPE/string.h
+++ b/include/BALL/DATATYPE/string.h
@@ -59,7 +59,6 @@ namespace BALL
 			\ingroup String
 	*/
  	class BALL_EXPORT String
-		: public string
 	{
 		///
 		friend class Substring;
@@ -99,6 +98,10 @@ namespace BALL
 		*/
 		static const Size EndPos;
 
+		/** Constant with a value of the greatest posible value for an element of type size_t.
+		 */
+		static const size_t npos = -1;
+
 		//@}
 		/**	@name	Predefined character classes
 				There exist several predefined character classes, that may
@@ -256,14 +259,18 @@ namespace BALL
 		/// Construct a String from a double value
 		String(double d);
 
+		/// Cast the String to a std::string reference
+		operator string&();
+
+		/// Cast the String to a std::string reference, const version
+		operator string const&() const;
+
 		/// Destructor
 		virtual ~String();
 
 		/// Clear the string (reset to the empty string)
 		void destroy();
 
-		/// Clears the string (same as destroy)
-		virtual void clear();
 		//@}
 
 		/**	@name	Assignment methods 
@@ -852,23 +859,35 @@ namespace BALL
 		 */
 		int compare(char c, Index from = 0) const;
 
-		///
-		bool operator == (const String& string) const;
+		/** Equality operator.
+		 */ 
+		BALL_EXPORT
+		friend bool operator == (const String& s1, const String& s2);
 
-		///
-		bool operator != (const String& string) const;
+		/** Inequality operator.
+		 */ 
+		BALL_EXPORT
+		friend bool operator != (const String& s1, const String& s2);
 
-		///
-		bool operator < (const String& string) const;
+		/** Less than comparison
+		 */ 
+		BALL_EXPORT
+		friend bool operator < (const String& s1, const String& s2);
 
-		///
-		bool operator <= (const String& string) const;
+		/** Less than or equal comparison
+		 */ 
+		BALL_EXPORT
+		friend bool operator <= (const String& s1, const String& s2);
 
-		///
-		bool operator >= (const String& string) const;
+		/** Greater than comparison
+		 */ 
+		BALL_EXPORT
+		friend bool operator > (const String& s1, const String& s2);
 
-		///
-		bool operator > (const String& string) const;
+		/** Greater than or equal comparison
+		 */ 
+		BALL_EXPORT
+		friend bool operator >= (const String& s1, const String& s2);
 
 		/** Equality operator.
 		 *	@exception Exception::NullPointer if <tt>char_ptr == NULL</tt>
@@ -997,14 +1016,364 @@ namespace BALL
 		std::istream& getline(std::istream& s = std::cin, char delimiter = '\n');
 
 		///
-		BALL_EXPORT
-		friend std::istream& getline(std::istream& s,  String& string,  char delimiter = '\n');
+//		BALL_EXPORT
+//		friend std::istream& getline(std::istream& s,  String& string,  char delimiter);
 
 		//@}
 
 		/// Constant empty string.
 		static const String EMPTY;
 
+		/**@ std::string compatibility layer
+		 */
+	  //@{
+
+		/** name typedefs
+		 */
+		//@{
+		typedef string::value_type             valuetype;
+		typedef string::traits_type            traits_type;
+		typedef string::allocator_type         allocator_type;
+		typedef string::reference              reference;
+		typedef string::const_reference        const_reference;
+		typedef string::pointer                pointer;
+		typedef string::const_pointer          const_pointer;
+		typedef string::iterator               iterator;
+		typedef string::const_iterator         const_iterator;
+		typedef string::reverse_iterator       reverse_iterator;
+		typedef string::const_reverse_iterator const_reverse_iterator;
+		typedef string::difference_type        difference_type;
+		typedef string::size_type              size_type;
+		//@}
+
+		/** @name Iterators
+		 */
+		//@{
+
+		///
+		iterator begin() BALL_NOEXCEPT;
+		///
+		const_iterator begin() const BALL_NOEXCEPT;
+		///
+		iterator end() BALL_NOEXCEPT;
+		///
+		const_iterator end() const BALL_NOEXCEPT;
+		///
+		reverse_iterator rbegin() BALL_NOEXCEPT;
+		///
+		const_reverse_iterator rbegin() const BALL_NOEXCEPT;
+		///
+		reverse_iterator rend() BALL_NOEXCEPT;
+		///
+		const_reverse_iterator rend() const BALL_NOEXCEPT;
+
+#ifdef BALL_HAS_STD_STRING_CONST_ITERATORS
+		///
+		const_iterator cbegin() const BALL_NOEXCEPT;
+		///
+		const_iterator cend() const BALL_NOEXCEPT;
+		///
+		const_reverse_iterator crbegin() const BALL_NOEXCEPT;
+		///
+		const_reverse_iterator crend() const BALL_NOEXCEPT;
+#endif
+
+		//@}
+
+		/** @name Capacity
+		 */
+		//@{
+
+		///
+		size_t size() const BALL_NOEXCEPT;
+		///
+		size_t length() const BALL_NOEXCEPT;
+		///
+		size_t max_size() const BALL_NOEXCEPT;
+		///
+		void resize(size_t n);
+		///
+		void resize(size_t n, char c);
+		///
+		size_t capacity() const BALL_NOEXCEPT;
+		///
+		void reserve(size_t n = 0);
+		///
+		void clear() BALL_NOEXCEPT;
+		///
+		bool empty() const BALL_NOEXCEPT;
+
+#ifdef BALL_HAS_STD_STRING_SHRINK_TO_FIT
+		///
+		void shrink_to_fit();
+#endif
+		//@}
+
+		/** @name Element Access
+		 */
+		//@{
+
+		///
+		char& operator[] (size_t pos);
+		///
+		const char& operator[] (size_t pos) const;
+		///
+		char& at(size_t pos);
+		///
+		const char& at(size_t pos) const;
+
+#ifdef BALL_HAS_STD_STRING_FRONT_BACK
+		///
+		char& front();
+		///
+		const char& front() const;
+		///
+		char& back();
+		///
+		const char& back() const;
+#endif
+
+		//@}
+
+		/** @name Modifiers
+		 */
+		//@{
+		///
+		String& operator += (const String& str);
+		///
+		String& operator += (const string& str);
+		///
+		String& operator += (const char* s);
+		///
+		String& operator += (char c);
+#ifdef BALL_HAS_INITIALIZER_LISTS
+		///
+		String& operator += (std::initializer_list<char> il);
+#endif
+		///
+		String& append(const String& str);
+		///
+		String& append(const string& str);
+		///
+		String& append(const string& str, size_t subpos, size_t sublen);
+		///
+		String& append(const char* s);
+		///
+		String& append(const char* s, size_t n);
+		///
+		String& append(size_t n, char c);
+		///
+		template <class InputIterator>
+		String& append(InputIterator first, InputIterator last);
+#ifdef BALL_HAS_INITIALIZER_LISTS
+		///
+		String& append(std::initializer_list<char> li);
+#endif
+		///
+		void push_back(char c);
+		///
+		String& assign(const String& str);
+		///
+		String& assign(const string& str);
+		///
+		String& assign(const string& str, size_t subpos, size_t sublen);
+		///
+		String& assign(const char* s);
+		///
+		String& assign(const char* s, size_t n);
+		///
+		String& assign(size_t n, char c);
+		///
+		template <class InputIterator>
+		String& assign(InputIterator first, InputIterator last);
+#ifdef BALL_HAS_INITIALIZER_LISTS
+		///
+		String& assign(std::initializer_list<char> li);
+#endif
+#ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
+		///
+		String& assign(string&& str) BALL_NOEXCEPT;
+#endif
+
+		///
+		String& insert(size_t pos, const string& str);
+		///
+		String& insert(size_t pos, const string& str, size_t subpos, size_t sublen);
+		///
+		String& insert(size_t pos, const char* s);
+		///
+		String& insert(size_t pos, const char* s, size_t n);
+		///
+		String& insert(size_t pos, size_t n, char c);
+#ifdef BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS
+		///
+		iterator insert(const_iterator p, size_t n, char c);
+		///
+		iterator insert(const_iterator p, char c);
+#else
+		///
+		void insert(iterator p, size_t n, char c);
+		///
+		iterator insert(iterator p, char c);
+#endif
+		///
+		template <class InputIterator>
+		iterator insert(iterator p, InputIterator first, InputIterator last);
+#if defined(BALL_HAS_INITIALIZER_LISTS) && defined(BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS)
+		///
+		String& insert(const_iterator p, std::initializer_list<char> li);
+#endif
+
+		///
+		String& erase(size_t pos = 0, size_t len = npos);
+#ifdef BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS
+		///
+		iterator erase(const_iterator p);
+		///
+		iterator erase(const_iterator first, const_iterator last);
+#else
+		///
+		iterator erase(iterator p);
+		///
+		iterator erase(iterator first, iterator last);
+#endif
+
+		///
+		String& replace(size_t pos, size_t len, const string& str);
+		///
+		String& replace(size_t pos, size_t len, const string& str, size_t subpos, size_t sublen);
+		///
+		String& replace(size_t pos, size_t len, const char* s);
+		///
+		String& replace(size_t pos, size_t len, const char* s, size_t n);
+		///
+		String& replace(size_t pos, size_t len, size_t n, char c);
+#ifdef BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS
+		///
+		String& replace(const_iterator i1, const_iterator i2, const string& str);
+		///
+		String& replace(const_iterator i1, const_iterator i2, const char* s);
+		///
+		String& replace(const_iterator i1, const_iterator i2, const char* s, size_t n);
+		///
+		String& replace(const_iterator i1, const_iterator i2, size_t n, char c);
+		///
+		template <class InputIterator>
+		String& replace(const_iterator i1, const_iterator i2, InputIterator first, InputIterator last);
+#else
+		///
+		String& replace(iterator i1, iterator i2, const string& str);
+		///
+		String& replace(iterator i1, iterator i2, const char* s);
+		///
+		String& replace(iterator i1, iterator i2, const char* s, size_t n);
+		///
+		String& replace(iterator i1, iterator i2, size_t n, char c);
+		///
+		template <class InputIterator>
+		String& replace(iterator i1, iterator i2, InputIterator first, InputIterator last);
+#endif
+#if defined(BALL_HAS_INITIALIZER_LISTS) && defined(BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS)
+		///
+		String& replace(const_iterator i1, const_iterator i2, std::initializer_list<char> li);
+#endif
+
+		///
+		void swap(string& str);
+
+#ifdef BALL_HAS_STD_STRING_POP_BACK
+		///
+		void pop_back();
+#endif
+		//@}
+
+		/** @name String Operations
+		 */
+		//@{
+
+		///
+		const char* c_str() const BALL_NOEXCEPT;
+		///
+		const char* data() const BALL_NOEXCEPT;
+		///
+		allocator_type get_allocator() const BALL_NOEXCEPT;
+		///
+		size_t copy(char* s, size_t len, size_t pos = 0) const;
+
+		///
+		size_t find(const string& str, size_t pos = 0) const BALL_NOEXCEPT;
+		///
+		size_t find(const char* s, size_t pos = 0) const;
+		///
+		size_t find(const char* s, size_t pos, size_t n) const;
+		///
+		size_t find(char c, size_t pos = 0) const BALL_NOEXCEPT;
+
+		///
+		size_t rfind(const string& str, size_t pos = npos) const BALL_NOEXCEPT;
+		///
+		size_t rfind(const char* s, size_t pos = npos) const;
+		///
+		size_t rfind(const char* s, size_t pos, size_t n) const;
+		///
+		size_t rfind(char c, size_t pos = npos) const BALL_NOEXCEPT;
+		
+		///
+		size_t find_first_of(const string& str, size_t pos = 0) const BALL_NOEXCEPT;
+		///
+		size_t find_first_of(const char* s, size_t pos = 0) const;
+		///
+		size_t find_first_of(const char* s, size_t pos, size_t n) const;
+		///
+		size_t find_first_of(char c, size_t pos = 0) const BALL_NOEXCEPT;
+
+		///
+		size_t find_last_of(const string& str, size_t pos = npos) const BALL_NOEXCEPT;
+		///
+		size_t find_last_of(const char* s, size_t pos = npos) const;
+		///
+		size_t find_last_of(const char* s, size_t pos, size_t n) const;
+		///
+		size_t find_last_of(char c, size_t pos = npos) const BALL_NOEXCEPT;
+
+		///
+		size_t find_first_not_of(const string& str, size_t pos = 0) const BALL_NOEXCEPT;
+		///
+		size_t find_first_not_of(const char* s, size_t pos = 0) const;
+		///
+		size_t find_first_not_of(const char* s, size_t pos, size_t n) const;
+		///
+		size_t find_first_not_of(char c, size_t pos = 0) const BALL_NOEXCEPT;
+
+		///
+		size_t find_last_not_of(const string& str, size_t pos = npos) const BALL_NOEXCEPT;
+		///
+		size_t find_last_not_of(const char* s, size_t pos = npos) const;
+		///
+		size_t find_last_not_of(const char* s, size_t pos, size_t n) const;
+		///
+		size_t find_last_not_of(char c, size_t pos = npos) const BALL_NOEXCEPT;
+
+		///
+		string substr(size_t pos = 0, size_t len = npos) const;
+
+		///
+		int compare(const string& str) const BALL_NOEXCEPT;
+		///
+		int compare(size_t pos, size_t len, const string& str) const;
+		///
+		int compare(size_t pos, size_t len, const string& str, size_t subpos, size_t sublen) const;
+		///
+		//int compare(const char* s) const;
+		///
+		int compare(size_t pos, size_t len, const char* s) const;
+		///
+		int compare(size_t pos, size_t len, const char* s, size_t n) const;
+
+		//@}
+		
+	  //@}
+
 		protected:
 	
 		// the validate...  methods check perform a thorough
@@ -1023,6 +1392,9 @@ namespace BALL
 		
 		private:
 
+		/// The encapsulated std::string
+		string str_;
+
 		static int compareAscendingly_(const char* a,  const char* b);
 
 		static int compareDescendingly_(const char* a,  const char* b);
@@ -1125,12 +1497,18 @@ namespace BALL
 		*/
 		//@{
 
-		/** Convert a substring to a string.
+		/** Convert a substring to a String.
 	   *	Return a copy of the substring's contents.
 		 *  @exception Substring::UnboundSubstring if this Substring is not correctly bound
 		 */
 		operator String() const;
 
+		/** Convert a substring to a std::string.
+	   *	Return a copy of the substring's contents.
+		 *  @exception Substring::UnboundSubstring if this Substring is not correctly bound
+		 */
+		//explicit operator string() const;
+
 		/** Convert a substring to a string.
 		 *	Return a copy of the substring's contents.
 		 *  @exception Substring::UnboundSubstring if this Substring is not correctly bound
@@ -1380,11 +1758,141 @@ namespace BALL
 		//_@}
 	};
 	
+	// non-member functions of String
+
+	/** Equality operator.
+	 */ 
+	BALL_EXPORT
+	bool operator == (const String& s1, const String& s2);
+
+	/** Inequality operator.
+	 */ 
+	BALL_EXPORT
+	bool operator != (const String& s1, const String& s2);
+
+	/** Less than comparison
+	 */ 
+	BALL_EXPORT
+	bool operator < (const String& s1, const String& s2);
+
+	/** Less than or equal comparison
+	 */ 
+	BALL_EXPORT
+	bool operator <= (const String& s1, const String& s2);
+
+	/** Greater than comparison
+	 */ 
+	BALL_EXPORT
+	bool operator > (const String& s1, const String& s2);
+
+	/** Greater than or equal comparison
+	 */ 
+	BALL_EXPORT
+	bool operator >= (const String& s1, const String& s2);
+
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (const String& s1, const string& s2);
+		
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (const string& s1, const String& s2);
+
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (const String& s1, const String& s2);
+		
+	/// Concatenates a string and a C type string
+	BALL_EXPORT
+	String operator + (const String& s1, const char* char_ptr);
+
+	/// Concatenates a C type string and a string
+	BALL_EXPORT
+	String operator + (const char* char_ptr, const String& s);
+
+	/// Concatenates a string and a character
+	BALL_EXPORT
+	String operator + (const String& s, char c);
+		
+	/// Concatenates a character and a string
+	BALL_EXPORT
+	String operator + (char c, const String& s);
+
+#ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (String&& s1, const string& s2);
+	
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (String&& s1, const String& s2);
+	
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (String&& s1, String&& s2);
+
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (const String& s1, string&& s2);
+
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (string&& s1, const String& s2);
+
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (const string& s1, String&& s2);
+
+	///	Concatenates two strings
+	BALL_EXPORT
+	String operator + (const String& s1, String&& s2);
+
+	/// Concatenates a string and a C type string
+	BALL_EXPORT
+	String operator + (String&& s1, const char* char_ptr);
+
+	/// Concatenates a C type string and a string
+	BALL_EXPORT
+	String operator + (const char* char_ptr, String&& s);
+
+	/// Concatenates a string and a character
+	BALL_EXPORT
+	String operator + (String&& s, char c);
+		
+	/// Concatenates a character and a string
+	BALL_EXPORT
+	String operator + (char c, String&& s);
+#endif
+} // namespace BALL
+
+namespace std
+{
+	// Non-member functions for string
+
+	///
+	istream& operator>> (istream& is, BALL::String& str);
+
+	///
+	ostream& operator<< (ostream& os, BALL::String const& str);
+
+	///
+	istream& getline(istream& is, BALL::String& str, char delim);
+	///
+	istream& getline(istream& is, BALL::String& str);
+
+
+#ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
+	///
+	istream& getline(istream& is, BALL::String&& str, char delim);
+	///
+	istream& getline(istream& is, BALL::String&& str);
+#endif
+}
+
 	//@}
 
 #	ifndef BALL_NO_INLINE_FUNCTIONS
 #		include <BALL/DATATYPE/string.iC>
 #	endif
-} // namespace BALL
 
 #endif // BALL_DATATYPE_STRING_H
diff --git a/include/BALL/DATATYPE/string.iC b/include/BALL/DATATYPE/string.iC
index b9856ca..954d15b 100644
--- a/include/BALL/DATATYPE/string.iC
+++ b/include/BALL/DATATYPE/string.iC
@@ -2,27 +2,37 @@
 // vi: set ts=2:
 //
 
+namespace BALL
+{
+
 BALL_INLINE 
 String::String()
-	: string()
+	: str_()
+{
+}
+
+BALL_INLINE 
+String::String(const String& s)
+	: str_(s.c_str())
 {
 }
 
-BALL_INLINE String::String(const String& s)
-	: string(s)
+BALL_INLINE 
+String::String(const string& s)
+	: str_(s)
 {
 }
 
 #ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
 BALL_INLINE
 String::String(String&& s)
-	: string(std::move(s))
+	: str_(std::move(s))
 {
 }
 
 BALL_INLINE
 String::String(string&& s)
-	: string(std::move(s))
+	: str_(std::move(s))
 {
 }
 
@@ -31,7 +41,7 @@ String& String::operator=(String&& s)
 {
 	if (this != &s)
 	{
-		string::operator=(std::move(s));
+		str_.operator=(std::move(s));
 	}
 
 	return *this;
@@ -40,10 +50,7 @@ String& String::operator=(String&& s)
 BALL_INLINE
 String& String::operator=(string&& s)
 {
-	if (this != &s)
-	{
-		string::operator=(std::move(s));
-	}
+	str_.operator=(std::move(s));
 
 	return *this;
 }
@@ -51,25 +58,19 @@ String& String::operator=(string&& s)
 
 BALL_INLINE 
 String::String(const unsigned char c)
-	: string(1, (char)c)
+	: str_(1, (char)c)
 {
 }
 
 BALL_INLINE 
 String::String(const char c, Size len)
-	: string(len, c)
-{
-}
-
-BALL_INLINE 
-String::String(const string& s)
-	: string(s)
+	: str_(len, c)
 {
 }
 
 BALL_INLINE 
 String::String(const String& s, Index from, Size len)
-	: string("")
+	: str_("")
 {
 	s.validateRange_(from, len);
 	if (len > 0)
@@ -156,6 +157,20 @@ Substring::operator String() const
   return String(bound_->c_str(), from_, to_ - from_ + 1);
 }
 
+/*
+BALL_INLINE 
+Substring::operator string() const
+{
+	if (bound_ == 0)
+	{
+		throw UnboundSubstring(__FILE__, __LINE__);
+	}
+
+  return string(bound_->c_str(), from_, to_ - from_ + 1);
+}
+*/
+
+
 BALL_INLINE 
 void Substring::unbind()
 {
@@ -579,69 +594,64 @@ String operator + (const String& s1, char c)
 BALL_INLINE
 String operator + (String&& s1, const string& s2)
 {
-	s1.append(s2);
-	return std::move(s1);
+	return std::move(s1.append(s2));
 }
 
 BALL_INLINE
 String operator + (String&& s1, const String& s2)
 {
-	s1.append(s2);
-	return std::move(s1);
+	return std::move(s1.append(s2));
 }
 
 BALL_INLINE
 String operator + (String&& s1, String&& s2)
 {
-	s1.append(s2);
-	return std::move(s1);
+	return std::move(s1.append(s2));
 }
 
 BALL_INLINE
 String operator + (const String& s1, string&& s2)
 {
-	return std::move(std::operator+(s1, std::move(s2)));
+	return std::move(s2.insert(0, s1));
 }
 
 BALL_INLINE
 String operator + (const String& s1, String&& s2)
 {
-	return std::move(std::operator+(s1, std::move(s2)));
+	return std::move(s2.insert(0, s1));
 }
 
 BALL_INLINE
 String operator + (string&& s1, const String& s2)
 {
-	s1.append(s2);
-	return std::move(s1);
+	return std::move(s1.append(s2));
 }
 
 BALL_INLINE
 String operator + (const string& s1, String&& s2)
 {
-	return std::move(std::operator+(s1, std::move(s2)));
+	return std::move(s2.insert(0, s1));
 }
 
 /// Concatenates a string and a C type string
 BALL_INLINE
 String operator + (String&& s1, const char* char_ptr)
 {
-	s1 += char_ptr;
-	return std::move(s1);
+	return std::move(s1.append(char_ptr));
 }
 
 /// Concatenates a C type string and a string
 BALL_INLINE
 String operator + (const char* char_ptr, String&& s)
 {
-	return std::move(std::operator+(char_ptr,std::move(s)));
+	return std::move(s.insert(0, char_ptr));
 }
 
 /// Concatenates a string and a character
 BALL_INLINE
 String operator + (String&& s, char c)
 {
-	s += c;
+	s.push_back(c);
 	return std::move(s);
 }
 
@@ -649,7 +659,8 @@ String operator + (String&& s, char c)
 BALL_INLINE
 String operator + (char c, String&& s)
 {
-	return std::move(std::operator+(c, std::move(s)));
+	s.insert(s.begin(), c);
+	return std::move(s);
 }
 
 #endif
@@ -661,12 +672,6 @@ void String::destroy()
 }
 
 BALL_INLINE 
-void String::clear()
-{
-  assign("");
-}
-
-BALL_INLINE 
 bool String::has(char c) const
 {
   return ((c != (char)0) && (find(c, 0) != string::npos));
@@ -737,42 +742,6 @@ bool String::isWhitespace(char c)
 }
 
 BALL_INLINE 
-bool String::operator != (const String& s) const
-{
-  return (compare(s) != 0);
-}
-
-BALL_INLINE 
-bool String::operator < (const String& s) const
-{
-  return (compare(s) < 0);
-}
-
-BALL_INLINE 
-bool String::operator <= (const String& s) const
-{
-  return (compare(s) <= 0);
-}
-
-BALL_INLINE 
-bool String::operator >= (const String& s) const
-{
-  return (compare(s) >= 0);
-}
-
-BALL_INLINE 
-bool String::operator > (const String& s) const
-{
-  return (compare(s) > 0);
-}
-
-BALL_INLINE
-bool String::operator == (const String& string) const
-{
-	return (compare(string) == 0);
-}
-
-BALL_INLINE 
 bool String::operator < (const char* char_ptr) const
 {
   return (compare(char_ptr) < 0);
@@ -862,7 +831,43 @@ bool operator == (const String& s, const Substring& substring)
 BALL_INLINE 
 void String::swap(String& s)
 {
-	string::swap(s);
+	str_.swap(s);
+}
+
+BALL_INLINE
+bool operator == (const String& s1, const String& s2)
+{
+	return (s1.compare(s2) == 0);
+}
+
+BALL_INLINE 
+bool operator != (const String& s1, const String& s2)
+{
+  return (s1.compare(s2) != 0);
+}
+
+BALL_INLINE 
+bool operator < (const String& s1, const String& s2)
+{
+  return (s1.compare(s2) < 0);
+}
+
+BALL_INLINE 
+bool operator <= (const String& s1, const String& s2)
+{
+  return (s1.compare(s2) <= 0);
+}
+
+BALL_INLINE 
+bool operator >= (const String& s1, const String& s2)
+{
+  return (s1.compare(s2) >= 0);
+}
+
+BALL_INLINE 
+bool operator > (const String& s1, const String& s2)
+{
+  return (s1.compare(s2) > 0);
 }
 
 BALL_INLINE 
@@ -936,3 +941,864 @@ bool operator > (char c, const String &s)
 {
 	return (s.compare(c) < 0);
 }
+
+// ---------------------------------------------
+// std::string compatibility
+// ---------------------------------------------
+
+BALL_INLINE
+String::iterator String::begin() BALL_NOEXCEPT
+{
+	return str_.begin();
+}
+
+BALL_INLINE
+String::const_iterator String::begin() const BALL_NOEXCEPT
+{
+	return str_.begin();
+}
+
+BALL_INLINE
+String::iterator String::end() BALL_NOEXCEPT
+{
+	return str_.end();
+}
+
+BALL_INLINE
+String::const_iterator String::end() const BALL_NOEXCEPT
+{
+	return str_.end();
+}
+
+BALL_INLINE
+String::reverse_iterator String::rbegin() BALL_NOEXCEPT
+{
+	return str_.rbegin();
+}
+
+BALL_INLINE
+String::const_reverse_iterator String::rbegin() const BALL_NOEXCEPT
+{
+	return str_.rbegin();
+}
+
+BALL_INLINE
+String::reverse_iterator String::rend() BALL_NOEXCEPT
+{
+	return str_.rend();
+}
+
+BALL_INLINE
+String::const_reverse_iterator String::rend() const BALL_NOEXCEPT
+{
+	return str_.rend();
+}
+
+#ifdef BALL_HAS_STD_STRING_CONST_ITERATORS
+
+BALL_INLINE
+String::const_iterator String::cbegin() const BALL_NOEXCEPT
+{
+	return str_.cbegin();
+}
+
+BALL_INLINE
+String::const_iterator String::cend() const BALL_NOEXCEPT
+{
+	return str_.cend();
+}
+
+BALL_INLINE
+String::const_reverse_iterator String::crbegin() const BALL_NOEXCEPT
+{
+	return str_.crbegin();
+}
+
+BALL_INLINE
+String::const_reverse_iterator String::crend() const BALL_NOEXCEPT
+{
+	return str_.crend();
+}
+
+#endif
+
+BALL_INLINE
+size_t String::size() const BALL_NOEXCEPT
+{
+	return str_.size();
+}
+
+BALL_INLINE
+size_t String::length() const BALL_NOEXCEPT
+{
+	return str_.length();
+}
+
+BALL_INLINE
+size_t String::max_size() const BALL_NOEXCEPT
+{
+	return str_.max_size();
+}
+
+BALL_INLINE
+void String::resize(size_t n)
+{
+	str_.resize(n);
+}
+
+BALL_INLINE
+void String::resize(size_t n, char c)
+{
+	str_.resize(n, c);
+}
+
+BALL_INLINE
+size_t String::capacity() const BALL_NOEXCEPT
+{
+	return str_.capacity();
+}
+
+BALL_INLINE
+void String::reserve(size_t n)
+{
+	str_.reserve(n);
+}
+
+BALL_INLINE
+void String::clear() BALL_NOEXCEPT
+{
+	str_.clear();
+}
+
+BALL_INLINE
+bool String::empty() const BALL_NOEXCEPT
+{
+	return str_.empty();
+}
+
+#ifdef BALL_HAS_STD_STRING_SHRINK_TO_FIT
+BALL_INLINE
+void String::shrink_to_fit()
+{
+	return str_.shrink_to_fit();
+}
+#endif
+
+BALL_INLINE
+char& String::operator[] (size_t pos)
+{
+	return str_[pos];
+}
+
+BALL_INLINE
+const char& String::operator[] (size_t pos) const
+{
+	return str_[pos];
+}
+
+BALL_INLINE
+char& String::at(size_t pos)
+{
+	return str_.at(pos);
+}
+
+BALL_INLINE
+const char& String::at(size_t pos) const
+{
+	return str_.at(pos);
+}
+
+#ifdef BALL_HAS_STD_STRING_FRONT_BACK
+BALL_INLINE
+char& String::front()
+{
+	return str_.front();
+}
+
+BALL_INLINE
+const char& String::front() const
+{
+	return str_.front();
+}
+
+BALL_INLINE
+char& String::back()
+{
+	return str_.back();
+}
+
+BALL_INLINE
+const char& String::back() const
+{
+	return str_.back();
+}
+#endif
+
+BALL_INLINE
+String& String::operator += (const String& str)
+{
+	str_ += (string const&)str;
+	return *this;
+}
+
+BALL_INLINE
+String& String::operator += (const string& str)
+{
+	str_ += str;
+	return *this;
+}
+
+BALL_INLINE
+String& String::operator += (const char* s)
+{
+	str_ += s;
+	return *this;
+}
+
+BALL_INLINE
+String& String::operator += (char c)
+{
+	str_ += c;
+	return *this;
+}
+
+#ifdef BALL_HAS_INITIALIZER_LISTS
+BALL_INLINE
+String& String::operator += (std::initializer_list<char> il)
+{
+	str_ += il;
+	return *this;
+}
+#endif
+
+BALL_INLINE
+String& String::append(const String& str)
+{
+	str_.append((string const&)str);
+	return *this;
+}
+
+BALL_INLINE
+String& String::append(const string& str)
+{
+	str_.append(str);
+	return *this;
+}
+
+BALL_INLINE
+String& String::append(const string& str, size_t subpos, size_t sublen)
+{
+	str_.append(str, subpos, sublen);
+	return *this;
+}
+
+BALL_INLINE
+String& String::append(const char* s)
+{
+	str_.append(s);
+	return *this;
+}
+
+BALL_INLINE
+String& String::append(const char* s, size_t n)
+{
+	str_.append(s, n);
+	return *this;
+}
+
+BALL_INLINE
+String& String::append(size_t n, char c)
+{
+	str_.append(n, c);
+	return *this;
+}
+
+template <class InputIterator>
+BALL_INLINE
+String& String::append(InputIterator first, InputIterator last)
+{
+	str_.append(first, last);
+	return *this;
+}
+
+#ifdef BALL_HAS_INITIALIZER_LISTS
+BALL_INLINE
+String& String::append(std::initializer_list<char> li)
+{
+	str_.append(li);
+	return *this;
+}
+#endif
+
+BALL_INLINE
+void String::push_back(char c)
+{
+	str_.push_back(c);
+}
+
+BALL_INLINE
+String& String::assign(const String& str)
+{
+	str_.assign((string const&)str);
+	return *this;
+}
+
+BALL_INLINE
+String& String::assign(const string& str)
+{
+	str_.assign(str);
+	return *this;
+}
+
+BALL_INLINE
+String& String::assign(const string& str, size_t subpos, size_t sublen)
+{
+	str_.assign(str, subpos, sublen);
+	return *this;
+}
+
+BALL_INLINE
+String& String::assign(const char* s)
+{
+	str_.assign(s);
+	return *this;
+}
+
+BALL_INLINE
+String& String::assign(const char* s, size_t n)
+{
+	str_.assign(s, n);
+	return *this;
+}
+
+BALL_INLINE
+String& String::assign(size_t n, char c)
+{
+	str_.assign(n, c);
+	return *this;
+}
+
+template <class InputIterator>
+BALL_INLINE
+String& String::assign(InputIterator first, InputIterator last)
+{
+	str_.assign(first, last);
+	return *this;
+}
+
+#ifdef BALL_HAS_INITIALIZER_LISTS
+BALL_INLINE
+String& String::assign(std::initializer_list<char> li)
+{
+	str_.assign(li);
+	return *this;
+}
+#endif
+
+#ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
+BALL_INLINE
+String& String::assign(string&& str) BALL_NOEXCEPT
+{
+	str_.assign(str);
+	return *this;
+}
+#endif
+
+BALL_INLINE
+String& String::insert(size_t pos, const string& str)
+{
+	str_.insert(pos, str);
+	return *this;
+}
+
+BALL_INLINE
+String& String::insert(size_t pos, const string& str, size_t subpos, size_t sublen)
+{
+	str_.insert(pos, str, subpos, sublen);
+	return *this;
+}
+
+BALL_INLINE
+String& String::insert(size_t pos, const char* s)
+{
+	str_.insert(pos, s);
+	return *this;
+}
+
+BALL_INLINE
+String& String::insert(size_t pos, const char* s, size_t n)
+{
+	str_.insert(pos, s, n);
+	return *this;
+}
+
+BALL_INLINE
+String& String::insert(size_t pos, size_t n, char c)
+{
+	str_.insert(pos, n, c);
+	return *this;
+}
+
+#ifdef BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS
+BALL_INLINE
+String::iterator String::insert(const_iterator p, size_t n, char c)
+{
+	return str_.insert(p, n, c);
+}
+
+BALL_INLINE
+String::iterator String::insert(const_iterator p, char c)
+{
+	return str_.insert(p, c);
+}
+#else
+BALL_INLINE
+void String::insert(iterator p, size_t n, char c)
+{
+	return str_.insert(p, n, c);
+}
+
+BALL_INLINE
+String::iterator String::insert(iterator p, char c)
+{
+	return str_.insert(p, c);
+}
+#endif
+
+template <class InputIterator>
+BALL_INLINE
+String::iterator String::insert(iterator p, InputIterator first, InputIterator last)
+{
+	return str_.insert(p, first, last);
+}
+
+#if defined(BALL_HAS_INITIALIZER_LISTS) && defined(BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS)
+BALL_INLINE
+String& String::insert(const_iterator p, std::initializer_list<char> li)
+{
+	str_.insert(p, li);
+	return *this;
+}
+#endif
+
+BALL_INLINE
+String& String::erase(size_t pos, size_t len)
+{
+	str_.erase(pos, len);
+	return *this;
+}
+
+#ifdef BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS
+BALL_INLINE
+String::iterator String::erase(const_iterator p)
+{
+	return str_.erase(p);
+}
+
+BALL_INLINE
+String::iterator String::erase(const_iterator first, const_iterator last)
+{
+	return str_.erase(first, last);
+}
+#else
+BALL_INLINE
+String::iterator String::erase(iterator p)
+{
+	return str_.erase(p);
+}
+
+BALL_INLINE
+String::iterator String::erase(iterator first, iterator last)
+{
+	return str_.erase(first, last);
+}
+#endif
+
+BALL_INLINE
+String& String::replace(size_t pos, size_t len, const string& str)
+{
+	str_.replace(pos, len, str);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(size_t pos, size_t len, const string& str, size_t subpos, size_t sublen)
+{
+	str_.replace(pos, len, str, subpos, sublen);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(size_t pos, size_t len, const char* s)
+{
+	str_.replace(pos, len, s);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(size_t pos, size_t len, const char* s, size_t n)
+{
+	str_.replace(pos, len, s, n);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(size_t pos, size_t len, size_t n, char c)
+{
+	str_.replace(pos, len, n, c);
+	return *this;
+}
+
+#ifdef BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS
+BALL_INLINE
+String& String::replace(const_iterator i1, const_iterator i2, const string& str)
+{
+	str_.replace(i1, i2, str);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(const_iterator i1, const_iterator i2, const char* s)
+{
+	str_.replace(i1, i2, s);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(const_iterator i1, const_iterator i2, const char* s, size_t n)
+{
+	str_.replace(i1, i2, s, n);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(const_iterator i1, const_iterator i2, size_t n, char c)
+{
+	str_.replace(i1, i2, n, c);
+	return *this;
+}
+
+template <class InputIterator>
+BALL_INLINE
+String& String::replace(const_iterator i1, const_iterator i2, InputIterator first, InputIterator last)
+{
+	str_.replace(i1, i2, first, last);
+	return *this;
+}
+#else
+BALL_INLINE
+String& String::replace(iterator i1, iterator i2, const string& str)
+{
+	str_.replace(i1, i2, str);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(iterator i1, iterator i2, const char* s)
+{
+	str_.replace(i1, i2, s);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(iterator i1, iterator i2, const char* s, size_t n)
+{
+	str_.replace(i1, i2, s, n);
+	return *this;
+}
+
+BALL_INLINE
+String& String::replace(iterator i1, iterator i2, size_t n, char c)
+{
+	str_.replace(i1, i2, n, c);
+	return *this;
+}
+
+template <class InputIterator>
+BALL_INLINE
+String& String::replace(iterator i1, iterator i2, InputIterator first, InputIterator last)
+{
+	str_.replace(i1, i2, first, last);
+	return *this;
+}
+#endif
+
+#if defined(BALL_HAS_INITIALIZER_LISTS) && defined(BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS)
+BALL_INLINE
+String& String::replace(const_iterator i1, const_iterator i2, std::initializer_list<char> li)
+{
+	str_.replace(i1, i2, li);
+	return *this;
+}
+#endif
+
+BALL_INLINE
+void String::swap(string& str)
+{
+	str_.swap(str);
+}
+
+#ifdef BALL_HAS_STD_STRING_POP_BACK
+BALL_INLINE
+void String::pop_back()
+{
+	str_.pop_back();
+}
+#endif
+
+BALL_INLINE
+const char* String::c_str() const BALL_NOEXCEPT
+{
+	return str_.c_str();
+}
+
+BALL_INLINE
+const char* String::data() const BALL_NOEXCEPT
+{
+	return str_.data();
+}
+
+BALL_INLINE
+String::allocator_type String::get_allocator() const BALL_NOEXCEPT
+{
+	return str_.get_allocator();
+}
+
+BALL_INLINE
+size_t String::copy(char* s, size_t len, size_t pos) const 
+{
+	return str_.copy(s, len, pos);
+}
+
+BALL_INLINE
+size_t String::find(const string& str, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find(str, pos);
+}
+
+BALL_INLINE
+size_t String::find(const char* s, size_t pos) const
+{
+	return str_.find(s, pos);
+}
+
+BALL_INLINE
+size_t String::find(const char* s, size_t pos, size_t n) const
+{
+	return str_.find(s, pos, n);
+}
+
+BALL_INLINE
+size_t String::find(char c, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find(c, pos);
+}
+
+BALL_INLINE
+size_t String::rfind(const string& str, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.rfind(str, pos);
+}
+
+BALL_INLINE
+size_t String::rfind(const char* s, size_t pos) const
+{
+	return str_.rfind(s, pos);
+}
+
+BALL_INLINE
+size_t String::rfind(const char* s, size_t pos, size_t n) const
+{
+	return str_.rfind(s, pos, n);
+}
+
+BALL_INLINE
+size_t String::rfind(char c, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.rfind(c, pos);
+}
+
+BALL_INLINE
+size_t String::find_first_of(const string& str, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find_first_of(str, pos);
+}
+
+BALL_INLINE
+size_t String::find_first_of(const char* s, size_t pos) const
+{
+	return str_.find_first_of(s, pos);
+}
+
+BALL_INLINE
+size_t String::find_first_of(const char* s, size_t pos, size_t n) const
+{
+	return str_.find_first_of(s, pos, n);
+}
+
+BALL_INLINE
+size_t String::find_first_of(char c, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find_first_of(c, pos);
+}
+
+BALL_INLINE
+size_t String::find_last_of(const string& str, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find_last_of(str, pos);
+}
+
+BALL_INLINE
+size_t String::find_last_of(const char* s, size_t pos) const
+{
+	return str_.find_last_of(s, pos);
+}
+
+BALL_INLINE
+size_t String::find_last_of(const char* s, size_t pos, size_t n) const
+{
+	return str_.find_last_of(s, pos, n);
+}
+
+BALL_INLINE
+size_t String::find_last_of(char c, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find_last_of(c, pos);
+}
+
+BALL_INLINE
+size_t String::find_first_not_of(const string& str, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find_first_not_of(str, pos);
+}
+
+BALL_INLINE
+size_t String::find_first_not_of(const char* s, size_t pos) const
+{
+	return str_.find_first_not_of(s, pos);
+}
+
+BALL_INLINE
+size_t String::find_first_not_of(const char* s, size_t pos, size_t n) const
+{
+	return str_.find_first_not_of(s, pos, n);
+}
+
+BALL_INLINE
+size_t String::find_first_not_of(char c, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find_first_not_of(c, pos);
+}
+
+BALL_INLINE
+size_t String::find_last_not_of(const string& str, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find_last_not_of(str, pos);
+}
+
+BALL_INLINE
+size_t String::find_last_not_of(const char* s, size_t pos) const
+{
+	return str_.find_last_not_of(s, pos);
+}
+
+BALL_INLINE
+size_t String::find_last_not_of(const char* s, size_t pos, size_t n) const
+{
+	return str_.find_last_not_of(s, pos, n);
+}
+
+BALL_INLINE
+size_t String::find_last_not_of(char c, size_t pos) const BALL_NOEXCEPT
+{
+	return str_.find_last_not_of(c, pos);
+}
+
+BALL_INLINE
+string String::substr(size_t pos, size_t len) const
+{
+	return str_.substr(pos, len);
+}
+
+BALL_INLINE
+int String::compare(const string& str) const BALL_NOEXCEPT
+{
+	return str_.compare(str);
+}
+
+BALL_INLINE
+int String::compare(size_t pos, size_t len, const string& str) const
+{
+	return str_.compare(pos, len, str);
+}
+
+BALL_INLINE
+int String::compare(size_t pos, size_t len, const string& str, size_t subpos, size_t sublen) const
+{
+	return str_.compare(pos, len, str, subpos, sublen);
+}
+
+/*
+BALL_INLINE
+int String::compare(const char* s) const
+{
+	return str_.compare(s);
+}
+*/
+
+BALL_INLINE
+int String::compare(size_t pos, size_t len, const char* s) const
+{
+	return str_.compare(pos, len, s);
+}
+
+BALL_INLINE
+int String::compare(size_t pos, size_t len, const char* s, size_t n) const
+{
+	return str_.compare(pos, len, s, n);
+}
+
+} // namespace BALL
+
+namespace std
+{
+
+BALL_INLINE
+istream& operator>> (istream& is, BALL::String& str)
+{
+	return (is >> (string&)str);
+}
+
+BALL_INLINE
+ostream& operator<< (ostream& os, BALL::String const& str)
+{
+	return (os << (string const&)str);
+}
+
+BALL_INLINE
+istream& getline(istream& is, BALL::String& str, char delim)
+{
+	return getline(is, (string&)str, delim);
+}
+
+BALL_INLINE
+istream& getline(istream& is, BALL::String& str)
+{
+	return getline(is, (string&)str);
+}
+
+#ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
+BALL_INLINE
+istream& getline(istream& is, BALL::String&& str, char delim)
+{
+	return getline(is, move((string&)str), delim);
+}
+
+BALL_INLINE
+istream& getline(istream& is, BALL::String&& str)
+{
+	return getline(is, move((string&)str));
+}
+#endif
+
+} // namespace std
diff --git a/include/BALL/DOCKING/COMMON/poseClustering.h b/include/BALL/DOCKING/COMMON/poseClustering.h
index 2eedacb..5ffce0b 100644
--- a/include/BALL/DOCKING/COMMON/poseClustering.h
+++ b/include/BALL/DOCKING/COMMON/poseClustering.h
@@ -46,6 +46,11 @@
 #include <set>
 #include <iostream>
 
+#ifdef BALL_HAS_TBB
+# include <tbb/parallel_reduce.h>
+# include <tbb/blocked_range.h>
+#endif
+
 //#define POSECLUSTERING_DEBUG 1
 #undef POSECLUSTERING_DEBUG
 
@@ -103,6 +108,9 @@ namespace BALL
 			rotation of each pose.
 			Depending on this choice, the option RMSD_TYPE has to be set to SNAPSHOT_RMSD or RIGID_RMSD.
 			If RMSD_TYPE is set to CENTER_OF_MASS_DISTANCE, the option RMSD_LEVEL_OF_DETAIL will be ignored.
+
+			By setting the option RUN_PARALLEL to true, the user can request parallel execution. This will be performed
+			if the execution environment is enabled (BALL_HAS_TBB), and if the algorithm supports it.
 	*/
 
   class BALL_EXPORT PoseClustering
@@ -130,9 +138,10 @@ namespace BALL
 				*/
 				static const String RMSD_TYPE;
 
-				/** flag indicating the computation of a full cluster dendogram 
+				/** flag for requesting parallel execution
 				 */
-				//static const String FULL_CLUSTER_DENDOGRAM;
+				static const String RUN_PARALLEL;
+
 			};
 
 			/// Default values for options
@@ -142,8 +151,8 @@ namespace BALL
 				static const float DISTANCE_THRESHOLD;
 				static const Index RMSD_LEVEL_OF_DETAIL;
 				static const Index RMSD_TYPE;
+				static const bool  RUN_PARALLEL;
 				static const bool USE_CENTER_OF_MASS_PRECLINK;
-				//static const bool FULL_CLUSTER_DENDOGRAM;
 			};
 
 			enum BALL_EXPORT RMSDType
@@ -167,7 +176,8 @@ namespace BALL
 				TRIVIAL_COMPLETE_LINKAGE,
 				SLINK_SIBSON,
 				CLINK_DEFAYS,
-				NEAREST_NEIGHBOR_CHAIN_WARD
+				NEAREST_NEIGHBOR_CHAIN_WARD,
+				CLINK_ALTHAUS
 			};
 
 			class BALL_EXPORT RigidTransformation
@@ -208,6 +218,11 @@ namespace BALL
 			class BALL_EXPORT ClusterProperties
 			{
 				public:
+					/** Serialization method
+					 */
+					template <class Archive>
+					void serialize(Archive& ar, const unsigned int version);
+
 					/** The poses contained in this cluster.
 					 */
 					std::set<Index> poses;
@@ -239,7 +254,9 @@ namespace BALL
 			typedef boost::adjacency_list<boost::vecS,
 			                              boost::vecS,
 			                              boost::directedS,
-			                              ClusterProperties> ClusterTree;
+			                              ClusterProperties,
+																		boost::no_property,
+																		unsigned int> ClusterTree;
 
 			typedef ClusterTree::vertex_descriptor ClusterTreeNode;
 
@@ -277,7 +294,7 @@ namespace BALL
 			//@{
 
 			/// sets the poses to be clustered, the conformation set's reference system will the base system
-			void setConformationSet(ConformationSet* new_set);
+			void setConformationSet(ConformationSet* new_set, bool precompute_atombijection = false);
 
 			/** Set a vector of PosePointers to be clustered
 			 *  Poses (RigidTransformations or SnapShots) can live outside of this class and will not be
@@ -296,6 +313,15 @@ namespace BALL
 			/// returns the poses to be clustered as ConformationSet
 			ConformationSet* getConformationSet() {return  current_set_;}
 
+			/// returns the poses as rigid transformations
+			const std::vector<RigidTransformation> & getRigidTransformations() const {return transformations_;}
+
+			/// returns the centers of mass-vector (non-empty only for CENTER_OF_MASS_DISTANCE)
+			std::vector<Vector3> & getCentersOfMass() {return com_;}
+
+			/// returns the centers of mass-vector, const version (non-empty only for CENTER_OF_MASS_DISTANCE)
+			std::vector<Vector3> const & getCentersOfMass() const {return com_;}
+
 			/// returns the reference pose 
 			const System& getSystem() const;
 
@@ -325,11 +351,38 @@ namespace BALL
 			/// returns the score between two poses given as systems
 			float getScore(const System sys_a, const System sys_b, Options options) const;
 
+			/// returns a reference to the cached AtomBijection
+			AtomBijection& getAtomBijection() {return atom_bijection_;}
+
+			/// returns a const reference to the cached AtomBijection
+			AtomBijection const& getAtomBijection() const {return atom_bijection_;}
+
+			/// apply a transformation to a given system
+			void applyTransformation2System(Index i, System& target_system);
+
+			/// convert the poses to SnapShots
+			void convertTransformations2Snaphots();
+
+			/// convert the poses to rigid transformations
+			void convertSnaphots2Transformations();
+
+			/// returns the complete linkage RMSD of cluster i
+			float computeCompleteLinkageRMSD(Index i, Options options, bool initialize = true);
+
+			/// returns the complete linkage RMSD of a pose set
+			//float computeCompleteLinkageRMSD(boost::shared_ptr<ConformationSet> cluster, Option options) const;
+
 			/// returns the pose i as system
 			boost::shared_ptr<System> getPose(Index i) const;
 
-			/// returns the first conformation of cluster i as system 
-			boost::shared_ptr<System> getClusterRepresentative(Index i) const;
+			/// returns poses as PosePointer
+			std::vector<PosePointer> const&  getPoses() const {return poses_;}
+
+			/// returns the "central cluster" conformation of cluster i as system 
+			boost::shared_ptr<System> getClusterRepresentative(Index i);
+
+			/// returns the index of the cluster representative
+			Index findClusterRepresentative(Index i);
 
 			/// returns cluster i as ConformationSet
 			boost::shared_ptr<ConformationSet> getClusterConformationSet(Index i);
@@ -397,16 +450,29 @@ namespace BALL
 			 *  We use threshold = sqrt(ward_dist / number_of_selected_atoms).
 			 *  see NEAREST_NEIGHBOR_CHAIN_WARD
 			 */
-			std::vector<std::set<Index> > extractClustersForThreshold(float threshold);
+			std::vector<std::set<Index> > extractClustersForThreshold(float threshold, Size min_size = 0);
 
-			/** returns the first n clusters if previously a complete clustering was performed
+			/** returns the first up to n clusters if previously a complete clustering was performed
 			 *  see NEAREST_NEIGHBOR_CHAIN_WARD
 			 */
 			std::vector<std::set<Index> > extractNBestClusters(Size n);
 
+			/** filters the current cluster set wrt to a minimal cluster size
+			 *  see NEAREST_NEIGHBOR_CHAIN_WARD
+			 */
+			std::vector<std::set<Index> > filterClusters(Size min_size = 1);
+
+			/** Export the cluster tree to boost::serialize format.
+ 			*/
+			void serializeWardClusterTree(std::ostream& out, bool binary = false);
+
+			/** Import the cluster tree from boost::serialize format.
+ 			*/
+			void deserializeWardClusterTree(std::istream& in, bool binary = false);
+
 			/** Export the cluster tree in graphviz format.
  			*/
-			void exportWardClusterTree(std::ostream& out);
+			void exportWardClusterTreeToGraphViz(std::ostream& out);
 
 			//@}
 
@@ -417,11 +483,59 @@ namespace BALL
 
 			/// print clusters of pose indices with RMSD between clusters	
 			/// Note: start counting with 0
-			void printClusterRMSDs(std::ostream& out = std::cout);
+			void printClusterScores(std::ostream& out = std::cout);
 
 
 		protected:
 
+#ifdef BALL_HAS_TBB
+			/** A nested class used for parallel execution of the nearest neighbour chain algorithm.
+			 */
+			class ComputeNearestClusterTask_
+			{
+				public:
+					/// Default constructor.
+					ComputeNearestClusterTask_(PoseClustering* parent,
+					                           const std::vector<ClusterTreeNode>& active_clusters,
+					                           Position current_cluster,
+																		 Index rmsd_type);
+
+					/// Splitting constructor.
+					ComputeNearestClusterTask_(ComputeNearestClusterTask_& cnct, tbb::split);
+
+					/// Join two partial results
+					void join(ComputeNearestClusterTask_ const& cnct);
+
+					/// The minimum computation
+					void operator() (const tbb::blocked_range<size_t>& r);
+
+					/// Return the minimum index
+					Position getMinIndex() {return my_min_index_;}
+
+					/// Return the minimum value
+					float getMinValue() {return my_min_value_;}
+
+				protected:
+					// the PoseClustering instance that called us
+					PoseClustering* parent_;
+
+					// the array we work on
+					const std::vector<ClusterTreeNode>& active_clusters_;
+
+					// the cluster to compare to everything else
+					Position current_cluster_;
+
+					// the kind of rmsd computation desired
+					Index rmsd_type_;
+
+					// the minimum index in our own block
+					Position my_min_index_;
+
+					// the minimum value in our own block
+					float my_min_value_;
+			};
+#endif
+
 			/** A nested class used for exporting cluster trees to graphviz format
 			 */
 			class ClusterTreeWriter_
@@ -465,6 +579,9 @@ namespace BALL
 			// space efficient (SLINK or CLINK) clustering
 			bool linearSpaceCompute_();
 
+			//
+			bool althausCompute_();
+
 			//	implementation of a single linkage clustering as described in 
 			//       R. Sibson: SLINK: an optimally efficient algorithm for the single-link cluster method. 
 			//       The Computer Journal. 16, 1, British Computer Society, 1973, p. 30-34
@@ -513,12 +630,6 @@ namespace BALL
 			// store pointers to the snapshots in the poses vector
 			void storeSnapShotReferences_();
 
-			// 
-			void convertTransformations2Snaphots_();
-
-			// 
-			void convertSnaphots2Transformations_();
-
 			//
 			void printCluster_(Index i, std::ostream& out = std::cout) const;
 
@@ -537,6 +648,8 @@ namespace BALL
 			/// the clusters: sets of pose indices 
 			std::vector< std::set<Index> >   clusters_;
 
+			std::vector< Index >   cluster_representatives_;
+
 			/// the scores of the clusters 
 			std::vector< float >             cluster_scores_;
 
@@ -600,8 +713,6 @@ namespace BALL
 
 			/// The tree built during hierarchical clustering
 			ClusterTree       cluster_tree_;
-			//  and its root
-			ClusterTreeNode   cluster_tree_root_;
 	}; //class PoseClustering
 } //namesspace BALL
 
diff --git a/include/BALL/FORMAT/HMOFile.h b/include/BALL/FORMAT/HMOFile.h
new file mode 100644
index 0000000..6951ece
--- /dev/null
+++ b/include/BALL/FORMAT/HMOFile.h
@@ -0,0 +1,212 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#ifndef BALL_FORMAT_HMOFILE_H
+#define BALL_FORMAT_HMOFILE_H
+
+#include <BALL/FORMAT/lineBasedFile.h>
+
+#ifndef BALL_KERNEL_ATOMCONTAINER_H
+# include <BALL/KERNEL/atomContainer.h>
+#endif
+
+#ifndef BALL_MATHS_SURFACE_H
+# include <BALL/MATHS/surface.h>
+#endif
+
+namespace BALL
+{
+	/** HMO mesh file format.
+   *
+	 *  This class enables BALL to read and write the HMO format for
+	 *  polygonal meshes of surfaces. For the moment, we do not implement
+	 *  all variants allowed by HMO, but rather focus on triangular surface
+	 *  meshes. In addition, we read and write an extension to HMO (CHARGE_DATA), 
+	 *  which contains information about positions and magnitudes of partially
+	 *  charged atoms in the system.
+	 *
+	 *  \ingroup Format
+	 *
+	 */
+	class BALL_EXPORT HMOFile 
+		: public LineBasedFile
+	{
+		public:
+		  /** @name Nested classes and enums
+			 */
+		  //@{
+			class HMOCharge
+			{
+				public:
+					Vector3 position;
+					float   value;
+
+					bool operator == (const HMOCharge& c) const
+					{
+						return ((position == c.position) && (value == c.value));
+					}
+			};
+
+			enum ElementType
+			{
+				L2   = 60,          // line element with two nodes
+				L3   = 63,          // line element with three nodes
+				T3   = 103,         // triangular element with three nodes
+				T6   = 106,         // triangular element with six nodes
+				Q4   = 104,         // quadrilateral element with four nodes
+				Q8   = 108,         // quadrilateral element with eight nodes
+				TH4  = 204,         // tetrahedral element with four nodes
+				TH10 = 210,         // tetrahedral element with ten nodes
+				P6   = 206,         // pentahedral element with six nodes
+				P15  = 215,         // pentahedral element with fifteen nodes
+				H8   = 208,         // hexaedral element with eight nodes
+				H20  = 220          // hexaedral element with twenty nodes
+			};
+		  //@}
+
+		  /** @name Constructors and Destructor
+			 */
+		  //@{
+			
+			/// Default constructor	
+			HMOFile();
+
+			/** Detailed constructor
+		   *  @throw Exception::FileNotFound if the file could not be opened
+			 */
+			HMOFile(const String& filename, File::OpenMode open_mode = std::ios::in);
+
+			/// Destructor
+			virtual ~HMOFile();
+
+			//@}
+
+			/** @name Assignment
+			 */
+			//@{
+
+			/// Clear method
+			virtual void clear();
+
+			//@}
+			
+			/** @name Predicates
+			 */
+			//@{
+
+			/// Equality operator
+			bool operator == (const HMOFile& file);
+
+			//@}
+
+			/** @name Accessors
+			 */
+		  //@{
+
+			/// Test for the presence of charges
+			bool hasCharges() const
+			{
+				return (charges_.size() > 0);
+			}
+
+			/// Accessor for the vector of charges
+			std::vector<HMOCharge>& getCharges()
+			{
+				return charges_;
+			}
+
+			/// Accessor for the vector of charges, const version
+			std::vector<HMOCharge> const& getCharges() const
+			{
+				return charges_;
+			}
+
+			/// Test for the presence of comments
+			bool hasComments() const
+			{
+				return (comments_.size() > 0);
+			}
+
+			/// Accessor for the vector of comments
+			std::vector<String>& getComments()
+			{
+				return comments_;
+			}
+
+			/// Accessor for the vector of comments, const version
+			std::vector<String> const& getComments() const
+			{
+				return comments_;
+			}
+			//@}
+
+			/** @name Public methods for file handling
+			 */
+			//@{
+
+			/** Open an HMOFile
+			 *  @throw Exception::FileNotFound if the file could not be opened
+			 */
+			virtual bool open(const String& name, File::OpenMode open_mode = std::ios::in);
+
+			/** Read the file into a Surface
+			 *
+			 *  @throw Exception::ParseError if the file was invalid
+			 */
+			virtual bool read(Surface& surface);
+
+		  /** Write a given surface to an HMO file
+			 *
+			 *  If the vector of comments is not empty, it is prepended to the written file.
+			 *  Otherwise, a generic comment is used.
+			 *
+			 *  Return true if the file could be written succesfully, false otherwise
+			 */
+			virtual bool write(Surface const& surface);
+
+			/** Write a given surface and the charges contained in a given AtomContainer to an HMO file
+			 *
+			 *  If the vector of comments is not empty, it is prepended to the written file.
+			 *  Otherwise, a generic comment is used.
+			 *
+			 *  Return true if the file could be written successfully, false otherwise
+			 */
+		  virtual bool write(Surface const& surface, AtomContainer const& ac);
+
+			//@}
+
+		protected:
+			// The vector of charge positions and magnitudes
+			std::vector<HMOCharge> charges_;
+
+			// The comments contained in the original file
+			std::vector<String> comments_;
+
+			// read the node data
+			void readNodeData_(Surface& surface);
+
+			// read the element data
+			void readElementData_(Surface& surface);
+
+			// read the charge data
+			void readChargeData_();
+
+			// read until a given text is found, and store all comments along the way
+			bool readUntil_(String const& pattern);
+
+			// write the node section of the HMO file
+			void writeNodes_(Surface const& surface);
+
+			// write the elements section of the HMO file
+			void writeElements_(Surface const& surface);
+
+			// write the charges section of the HMO file
+			void writeCharges_(AtomContainer const& ac);
+
+		private:
+			const HMOFile& operator = (const HMOFile& file);
+	};
+}
+
+#endif // BALL_FORMAT_HMOFILE_H
diff --git a/include/BALL/FORMAT/NMRStarFile.h b/include/BALL/FORMAT/NMRStarFile.h
index 4eabb8b..dbfee75 100644
--- a/include/BALL/FORMAT/NMRStarFile.h
+++ b/include/BALL/FORMAT/NMRStarFile.h
@@ -867,12 +867,12 @@ namespace BALL
 			/** Equality operator.
 			    Test if both instances point to the same file.
 			 */
-			bool operator == (const NMRStarFile& f);
+			bool operator == (const NMRStarFile& f) const;
 
 			/** Inequality operator
 			    Test if both instances point to different files.
 			 */
-			bool operator != (const NMRStarFile& f);
+			bool operator != (const NMRStarFile& f) const;
 
 			/** Clear the object.
 			 */
diff --git a/include/BALL/FORMAT/SCWRLRotamerFile.h b/include/BALL/FORMAT/SCWRLRotamerFile.h
index 52b5e87..4d841e6 100644
--- a/include/BALL/FORMAT/SCWRLRotamerFile.h
+++ b/include/BALL/FORMAT/SCWRLRotamerFile.h
@@ -50,19 +50,15 @@ namespace BALL
 		// TODO output operator????
 		//@}
 
-
-		protected:
-
-			/** Backbone dependent read method
-			 *  @throw Exception::ParseError if a syntax error was encountered
-			 */
-			void readSCWRLBackboneDependentLibraryFile_(RotamerLibrary& library);
-
-			/** Backbone independent read method
-			 *  @throw Exception::ParseError if a syntax error was encountered
-			 */
-			void readSCWRLBackboneIndependentLibraryFile_(RotamerLibrary& library);
-
+		/** Backbone depend read md method
+		 *  @throw Exception::ParseError if a syntax error encouncountered
+		 */
+		void readSCWRLBackboneDependentLibraryFile(RotamerLibrary& library);
+
+		/** Backbone independ readead method
+		 *  @throw Exception::ParseError if a syntax error encouncountered
+		 */
+		void readSCWRLBackboneIndependentLibraryFile(RotamerLibrary& library);
 	};
 } // namespace BALL
 
diff --git a/include/BALL/FORMAT/commandlineParser.h b/include/BALL/FORMAT/commandlineParser.h
index 8a022a9..6474e86 100644
--- a/include/BALL/FORMAT/commandlineParser.h
+++ b/include/BALL/FORMAT/commandlineParser.h
@@ -38,6 +38,9 @@ namespace BALL
 			However, if, although this is not necessary, parameters (other than -par) 
 			are specified on the command-line, their values will automatically overload 
 			those stored in the xml-file. 
+
+			The parameter '-env' allows to differentiate between command line ('cmdline') 
+			behaviour and special adaptions to workflow systems like galaxy or knime.
 	*/
 	class BALL_EXPORT CommandlineParser
 	{
@@ -50,12 +53,21 @@ namespace BALL
 			static const String NOT_FOUND;
 			static const list<String> EMTPY_LIST;
 
+			// - CLI switch
+			// - description
+			// - parameter type
+			// - required
+			// - default value
+			// - hidden in galaxy
 			void registerParameter(String name, String description, ParameterType type, bool mandatory = false, String default_value = "", bool hidden = false);
 
-			void registerFlag(String name, String description, bool default_gui_value = false);
+			void registerFlag(String name, String description, bool default_gui_value = false, bool hidden = false);
 
 			void registerAdvancedParameters(Options& options);
 
+			// exclude parameter from showing in help mode e.g. galaxy specific multi-output parameter
+			void setParameterAsAdvanced(String name);
+
 			/** Register the minimal and maximal allowed value for a numerical parameter. */
 			void setParameterRestrictions(String par_name, double min_value, double max_value);
 
@@ -108,7 +120,7 @@ namespace BALL
 			  
 					If 'parameter_names' is specified, only information those parameters is shown. 
 			*/
-			void printHelp(std::set<String>* parameter_names = 0, bool show_manual = true);
+			void printHelp(const std::set<String>& parameter_names = std::set<String>(), bool show_manual = true);
 
 			void printToolInfo();
 
@@ -120,9 +132,13 @@ namespace BALL
 
 		private:
 
-			void replaceExcapedCharacters_(String& parameter_value);
+			void replaceEscapedCharacters_(String& parameter_value);
+
 			void checkAndRegisterParameter(String name, String description, ParameterType type, bool mandatory = false, String default_value = "", bool perform_check = true, bool hidden=false);
-			void checkAndRegisterFlag(String name, String description, bool default_gui_value = false, bool perform_check = true);
+
+			void checkAndRegisterFlag(String name, String description, bool default_gui_value = false, bool perform_check = true, bool hidden=false);
+
+
 			void validateRegisteredFilesHaveFormats();
 
 			/** Throws an exception if the given parameter name is not allowed to be used. */
@@ -131,8 +147,8 @@ namespace BALL
 			/** blacklisted param names */
 			std::set<String> reserved_params_;
 
-			/** map excaped characters to the original characters */
-			std::list<std::pair<String, String> > excaped_chars_;
+			/** map escaped characters to the original characters */
+			std::list<std::pair<String, String> > escaped_chars_;
 			std::map<String, list<String> > parameter_map_;
 			std::map<String, ParameterDescription> registered_parameters_;
 
diff --git a/include/BALL/FORMAT/lineBasedFile.h b/include/BALL/FORMAT/lineBasedFile.h
index 4d31fa1..d5a4fbb 100644
--- a/include/BALL/FORMAT/lineBasedFile.h
+++ b/include/BALL/FORMAT/lineBasedFile.h
@@ -177,9 +177,6 @@ namespace BALL
 
 		bool trim_whitespaces_;
 
-		/// buffer for the line
-		vector<char> line_buffer_;
-
 		/// buffer for column parsing
 		vector<char> col_buffer_;
 
diff --git a/include/BALL/FORMAT/molFileFactory.h b/include/BALL/FORMAT/molFileFactory.h
index be08a6b..56fa8d0 100644
--- a/include/BALL/FORMAT/molFileFactory.h
+++ b/include/BALL/FORMAT/molFileFactory.h
@@ -34,19 +34,22 @@ class BALL_EXPORT MolFileFactory
 		* @return a pointer to a subclass of GenericMolFile, NULL if none is appropriate. Be aware, that
 		*         the file handle has not been checked for validity and that you have to delete it yourself
 		*/
+
+		/** Return a comma-separated string containing the file-extensions that are supported by MolFileFactory */
+		static String getSupportedFormats();
+
+		/** Return true if the extension of the specified filename is supported; otherwise return false. */
+		static bool isFileExtensionSupported(String filename);
+
 		static GenericMolFile* open(const String& name, File::OpenMode open_mode = std::ios::in);
 
-		/** When trying to open a file in write-mode, this function can be used to pass along a desired default-format. If the given filename does not have a supported extension, the specified default format will be used. */
-		static GenericMolFile* open(const String& name, File::OpenMode open_mode, String default_format);
+		/** When trying to open a file in write-mode, this function can be used to pass along a desired default-format. If the given filename does not have a supported extension and/or forced is set, the specified default format will be used. */
+    static GenericMolFile* open(const String& name, File::OpenMode open_mode, String default_format, bool forced = false);
 
 		/** When trying to open a file in write-mode, this function can be used to pass along a desired default-format. If the given filename does not have a supported extension, the format of 'default_format_file' will be used. */
 		static GenericMolFile* open(const String& name, File::OpenMode open_mode, GenericMolFile* default_format_file);
 
-		/** Return a comma-separated string containing the file-extensions that are supported by MolFileFactory */
-		static String getSupportedFormats();
 
-		/** Return true if the extension of the specified filename is supported; otherwise return false. */
-		static bool isFileExtensionSupported(String filename);
 
 	private:
 
diff --git a/include/BALL/FORMAT/paramFile.h b/include/BALL/FORMAT/paramFile.h
index 2ae0d57..b5d7e58 100644
--- a/include/BALL/FORMAT/paramFile.h
+++ b/include/BALL/FORMAT/paramFile.h
@@ -34,7 +34,9 @@ namespace BALL
 		OUTFILELIST,
 		STRINGLIST,
 		INTLIST,
-		DOUBLELIST
+		DOUBLELIST,
+		GALAXY_OPT_OUTDIR,
+		GALAXY_OPT_OUTID
 	};
 
 	struct BALL_EXPORT ParameterDescription
diff --git a/include/BALL/MATHS/analyticalGeometry.h b/include/BALL/MATHS/analyticalGeometry.h
index 9714975..176bcce 100644
--- a/include/BALL/MATHS/analyticalGeometry.h
+++ b/include/BALL/MATHS/analyticalGeometry.h
@@ -951,7 +951,8 @@ namespace BALL
 		if (GetIntersection(plane1,plane2,line))
 		{
 			TVector3<T> diff(s1.p-line.p);
-			T x1, x2;
+			T x1 = 0;
+			T x2 = 0;
 			if (SolveQuadraticEquation(line.d*line.d, -diff*line.d*2, diff*diff-r1_square, x1,x2) > 0)
 			{
 				p1 = line.p+x1*line.d;
diff --git a/include/BALL/QSAR/QSARData.h b/include/BALL/QSAR/QSARData.h
index d27ba15..44dcb4f 100644
--- a/include/BALL/QSAR/QSARData.h
+++ b/include/BALL/QSAR/QSARData.h
@@ -1,23 +1,3 @@
-/* QSARData.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/classificationValidation.h b/include/BALL/QSAR/classificationValidation.h
index 14e9cf6..67d4dc2 100644
--- a/include/BALL/QSAR/classificationValidation.h
+++ b/include/BALL/QSAR/classificationValidation.h
@@ -1,23 +1,3 @@
-/* classificationValidation.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/kernelModel.h b/include/BALL/QSAR/kernelModel.h
index 95df569..1f929dc 100644
--- a/include/BALL/QSAR/kernelModel.h
+++ b/include/BALL/QSAR/kernelModel.h
@@ -1,23 +1,3 @@
-/* kernelModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/latentVariableModel.h b/include/BALL/QSAR/latentVariableModel.h
index 6a63474..8685558 100644
--- a/include/BALL/QSAR/latentVariableModel.h
+++ b/include/BALL/QSAR/latentVariableModel.h
@@ -1,23 +1,3 @@
-/* latentVariableModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/ldaModel.h b/include/BALL/QSAR/ldaModel.h
index abd5a74..8694a51 100644
--- a/include/BALL/QSAR/ldaModel.h
+++ b/include/BALL/QSAR/ldaModel.h
@@ -1,23 +1,3 @@
-/* ldaModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/libsvmModel.h b/include/BALL/QSAR/libsvmModel.h
index 89b7e1e..a3063dd 100644
--- a/include/BALL/QSAR/libsvmModel.h
+++ b/include/BALL/QSAR/libsvmModel.h
@@ -1,23 +1,3 @@
-/* libsvmModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/linearModel.h b/include/BALL/QSAR/linearModel.h
index c05cc98..493a8cf 100644
--- a/include/BALL/QSAR/linearModel.h
+++ b/include/BALL/QSAR/linearModel.h
@@ -1,23 +1,3 @@
-/* linearModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/logitModel.h b/include/BALL/QSAR/logitModel.h
index 8715bdd..089c2f3 100644
--- a/include/BALL/QSAR/logitModel.h
+++ b/include/BALL/QSAR/logitModel.h
@@ -1,23 +1,3 @@
-/* logitModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/mlrModel.h b/include/BALL/QSAR/mlrModel.h
index 4a624c8..884b86a 100644
--- a/include/BALL/QSAR/mlrModel.h
+++ b/include/BALL/QSAR/mlrModel.h
@@ -1,24 +1,4 @@
-/* mlrModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 // 
diff --git a/include/BALL/QSAR/modelFactory.h b/include/BALL/QSAR/modelFactory.h
index 6ddf773..4646e5c 100644
--- a/include/BALL/QSAR/modelFactory.h
+++ b/include/BALL/QSAR/modelFactory.h
@@ -1,28 +1,6 @@
-/* modelFactory.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id: factory.h,v 1.10 2003/08/26 08:04:07 oliver Exp $
-//
 
 #ifndef BALL_QSAR_MODELFACTORY_H
 #define BALL_QSAR_MODELFACTORY_H
diff --git a/include/BALL/QSAR/nBModel.h b/include/BALL/QSAR/nBModel.h
index 080f076..6536b0f 100644
--- a/include/BALL/QSAR/nBModel.h
+++ b/include/BALL/QSAR/nBModel.h
@@ -1,23 +1,3 @@
-/* nBModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/nonlinearModel.h b/include/BALL/QSAR/nonlinearModel.h
index 5795dc2..3041351 100644
--- a/include/BALL/QSAR/nonlinearModel.h
+++ b/include/BALL/QSAR/nonlinearModel.h
@@ -1,23 +1,3 @@
-/* nonlinearModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/oplsModel.h b/include/BALL/QSAR/oplsModel.h
index 12951e1..03f9ec0 100644
--- a/include/BALL/QSAR/oplsModel.h
+++ b/include/BALL/QSAR/oplsModel.h
@@ -1,24 +1,4 @@
-/* oplsModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 //
diff --git a/include/BALL/QSAR/pcrModel.h b/include/BALL/QSAR/pcrModel.h
index 58905e2..4974709 100644
--- a/include/BALL/QSAR/pcrModel.h
+++ b/include/BALL/QSAR/pcrModel.h
@@ -1,23 +1,3 @@
-/* pcrModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/plsModel.h b/include/BALL/QSAR/plsModel.h
index 27de2af..45f0231 100644
--- a/include/BALL/QSAR/plsModel.h
+++ b/include/BALL/QSAR/plsModel.h
@@ -1,24 +1,4 @@
-/* plsModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 //
diff --git a/include/BALL/QSAR/registry.h b/include/BALL/QSAR/registry.h
index 43dc050..b12bcfd 100644
--- a/include/BALL/QSAR/registry.h
+++ b/include/BALL/QSAR/registry.h
@@ -1,23 +1,3 @@
-/* registry.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef BALL_QSAR_REGISTRY_H
 #define BALL_QSAR_REGISTRY_H
 
diff --git a/include/BALL/QSAR/regressionModel.h b/include/BALL/QSAR/regressionModel.h
index 95e356f..04681df 100644
--- a/include/BALL/QSAR/regressionModel.h
+++ b/include/BALL/QSAR/regressionModel.h
@@ -1,23 +1,3 @@
-/* regressionModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/regressionValidation.h b/include/BALL/QSAR/regressionValidation.h
index 747dad9..5906599 100644
--- a/include/BALL/QSAR/regressionValidation.h
+++ b/include/BALL/QSAR/regressionValidation.h
@@ -1,23 +1,3 @@
-/* regressionValidation.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/rrModel.h b/include/BALL/QSAR/rrModel.h
index 8a1956c..bcebe06 100644
--- a/include/BALL/QSAR/rrModel.h
+++ b/include/BALL/QSAR/rrModel.h
@@ -1,24 +1,4 @@
-/* rrModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 // 
diff --git a/include/BALL/QSAR/snBModel.h b/include/BALL/QSAR/snBModel.h
index a467a5c..653aacd 100644
--- a/include/BALL/QSAR/snBModel.h
+++ b/include/BALL/QSAR/snBModel.h
@@ -1,23 +1,3 @@
-/* snBModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/statistics.h b/include/BALL/QSAR/statistics.h
index eb6e021..a88528c 100644
--- a/include/BALL/QSAR/statistics.h
+++ b/include/BALL/QSAR/statistics.h
@@ -1,23 +1,3 @@
-/* statistics.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/svmModel.h b/include/BALL/QSAR/svmModel.h
index c1b8d68..6d985c7 100644
--- a/include/BALL/QSAR/svmModel.h
+++ b/include/BALL/QSAR/svmModel.h
@@ -1,23 +1,3 @@
-/* svmModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/QSAR/svrModel.h b/include/BALL/QSAR/svrModel.h
index 00962d3..83eb810 100644
--- a/include/BALL/QSAR/svrModel.h
+++ b/include/BALL/QSAR/svrModel.h
@@ -1,24 +1,4 @@
-/* svrModel.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 //
diff --git a/include/BALL/QSAR/validation.h b/include/BALL/QSAR/validation.h
index 3faa436..f69c828 100644
--- a/include/BALL/QSAR/validation.h
+++ b/include/BALL/QSAR/validation.h
@@ -1,23 +1,3 @@
-/* validation.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/include/BALL/SCORING/COMMON/diffGridBasedScoring.h b/include/BALL/SCORING/COMMON/diffGridBasedScoring.h
index 10b2128..5a4b34f 100644
--- a/include/BALL/SCORING/COMMON/diffGridBasedScoring.h
+++ b/include/BALL/SCORING/COMMON/diffGridBasedScoring.h
@@ -1,21 +1,3 @@
-/* diffGridBasedScoring.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMMON/diffScoringFunction.h b/include/BALL/SCORING/COMMON/diffScoringFunction.h
index 821eecf..1951fdf 100644
--- a/include/BALL/SCORING/COMMON/diffScoringFunction.h
+++ b/include/BALL/SCORING/COMMON/diffScoringFunction.h
@@ -1,21 +1,3 @@
-/* diffScoringFunction.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMMON/gridBasedScoring.h b/include/BALL/SCORING/COMMON/gridBasedScoring.h
index bce0468..796a150 100644
--- a/include/BALL/SCORING/COMMON/gridBasedScoring.h
+++ b/include/BALL/SCORING/COMMON/gridBasedScoring.h
@@ -1,21 +1,3 @@
-/* gridBasedScoring.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMMON/scoreGridSet.h b/include/BALL/SCORING/COMMON/scoreGridSet.h
index 629a1f0..fb0dd09 100644
--- a/include/BALL/SCORING/COMMON/scoreGridSet.h
+++ b/include/BALL/SCORING/COMMON/scoreGridSet.h
@@ -1,21 +1,3 @@
-/* scoreGridSet.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMMON/scoringComponent.h b/include/BALL/SCORING/COMMON/scoringComponent.h
index 9324d3a..ce09b55 100644
--- a/include/BALL/SCORING/COMMON/scoringComponent.h
+++ b/include/BALL/SCORING/COMMON/scoringComponent.h
@@ -1,21 +1,3 @@
-/* scoringComponent.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMMON/scoringOptimizer.h b/include/BALL/SCORING/COMMON/scoringOptimizer.h
index c1ad75b..32bb988 100644
--- a/include/BALL/SCORING/COMMON/scoringOptimizer.h
+++ b/include/BALL/SCORING/COMMON/scoringOptimizer.h
@@ -1,21 +1,3 @@
-/* scoringOptimizer.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/CHPI.h b/include/BALL/SCORING/COMPONENTS/CHPI.h
index 6f8817e..c974c66 100644
--- a/include/BALL/SCORING/COMPONENTS/CHPI.h
+++ b/include/BALL/SCORING/COMPONENTS/CHPI.h
@@ -1,21 +1,3 @@
-/* CHPI.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/PB.h b/include/BALL/SCORING/COMPONENTS/PB.h
index 5c79b5b..ebc899a 100644
--- a/include/BALL/SCORING/COMPONENTS/PB.h
+++ b/include/BALL/SCORING/COMPONENTS/PB.h
@@ -1,21 +1,3 @@
-/* PB.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/PLP.h b/include/BALL/SCORING/COMPONENTS/PLP.h
index 83d5279..eb38826 100644
--- a/include/BALL/SCORING/COMPONENTS/PLP.h
+++ b/include/BALL/SCORING/COMPONENTS/PLP.h
@@ -1,21 +1,3 @@
-/* PLP.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Jan Fuhrmann, Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/advElectrostatic.h b/include/BALL/SCORING/COMPONENTS/advElectrostatic.h
index 610c371..a40ac77 100644
--- a/include/BALL/SCORING/COMPONENTS/advElectrostatic.h
+++ b/include/BALL/SCORING/COMPONENTS/advElectrostatic.h
@@ -1,21 +1,3 @@
-/* advElectrostatic.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/aromaticRingStacking.h b/include/BALL/SCORING/COMPONENTS/aromaticRingStacking.h
index 7e5417a..636bb87 100644
--- a/include/BALL/SCORING/COMPONENTS/aromaticRingStacking.h
+++ b/include/BALL/SCORING/COMPONENTS/aromaticRingStacking.h
@@ -1,21 +1,3 @@
-/* aromaticRingStacking.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/burialDepth.h b/include/BALL/SCORING/COMPONENTS/burialDepth.h
index c5cc7b7..734e5a9 100644
--- a/include/BALL/SCORING/COMPONENTS/burialDepth.h
+++ b/include/BALL/SCORING/COMPONENTS/burialDepth.h
@@ -1,21 +1,3 @@
-/* burialDepth.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/buriedPolar.h b/include/BALL/SCORING/COMPONENTS/buriedPolar.h
index a7a7686..d231a1c 100644
--- a/include/BALL/SCORING/COMPONENTS/buriedPolar.h
+++ b/include/BALL/SCORING/COMPONENTS/buriedPolar.h
@@ -1,21 +1,3 @@
-/* buriedPolar.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/electrostatic.h b/include/BALL/SCORING/COMPONENTS/electrostatic.h
index a27bfe0..ba62661 100644
--- a/include/BALL/SCORING/COMPONENTS/electrostatic.h
+++ b/include/BALL/SCORING/COMPONENTS/electrostatic.h
@@ -1,21 +1,3 @@
-/* electrostatic.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/fragmentationalSolvation.h b/include/BALL/SCORING/COMPONENTS/fragmentationalSolvation.h
index c85cbd9..8fc9268 100644
--- a/include/BALL/SCORING/COMPONENTS/fragmentationalSolvation.h
+++ b/include/BALL/SCORING/COMPONENTS/fragmentationalSolvation.h
@@ -1,21 +1,3 @@
-/* fragmentationalSolvation.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/fresnoTypes.h b/include/BALL/SCORING/COMPONENTS/fresnoTypes.h
index c595032..c18be65 100644
--- a/include/BALL/SCORING/COMPONENTS/fresnoTypes.h
+++ b/include/BALL/SCORING/COMPONENTS/fresnoTypes.h
@@ -1,21 +1,3 @@
-/* fresnoTypes.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/hydrogenBond.h b/include/BALL/SCORING/COMPONENTS/hydrogenBond.h
index 947a30a..d7f7328 100644
--- a/include/BALL/SCORING/COMPONENTS/hydrogenBond.h
+++ b/include/BALL/SCORING/COMPONENTS/hydrogenBond.h
@@ -1,21 +1,3 @@
-/* hydrogenBond.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/lipophilic.h b/include/BALL/SCORING/COMPONENTS/lipophilic.h
index 5025f9a..8643ec3 100644
--- a/include/BALL/SCORING/COMPONENTS/lipophilic.h
+++ b/include/BALL/SCORING/COMPONENTS/lipophilic.h
@@ -1,21 +1,3 @@
-/* lipophilic.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/polarity.h b/include/BALL/SCORING/COMPONENTS/polarity.h
index 68c6295..97f4b8c 100644
--- a/include/BALL/SCORING/COMPONENTS/polarity.h
+++ b/include/BALL/SCORING/COMPONENTS/polarity.h
@@ -1,21 +1,3 @@
-/* polarity.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/rotationalEntropy.h b/include/BALL/SCORING/COMPONENTS/rotationalEntropy.h
index 2be19ab..5ec5d22 100755
--- a/include/BALL/SCORING/COMPONENTS/rotationalEntropy.h
+++ b/include/BALL/SCORING/COMPONENTS/rotationalEntropy.h
@@ -1,21 +1,3 @@
-/* rotationalEntropy.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/solvation.h b/include/BALL/SCORING/COMPONENTS/solvation.h
index 58a37aa..6377e37 100644
--- a/include/BALL/SCORING/COMPONENTS/solvation.h
+++ b/include/BALL/SCORING/COMPONENTS/solvation.h
@@ -1,21 +1,3 @@
-/* solvation.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/COMPONENTS/vanDerWaals.h b/include/BALL/SCORING/COMPONENTS/vanDerWaals.h
index 3e7fa80..9238a55 100644
--- a/include/BALL/SCORING/COMPONENTS/vanDerWaals.h
+++ b/include/BALL/SCORING/COMPONENTS/vanDerWaals.h
@@ -1,21 +1,3 @@
-/* vdW.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/MMScoring.h b/include/BALL/SCORING/FUNCTIONS/MMScoring.h
index 754c11d..3df28de 100644
--- a/include/BALL/SCORING/FUNCTIONS/MMScoring.h
+++ b/include/BALL/SCORING/FUNCTIONS/MMScoring.h
@@ -1,21 +1,3 @@
-/* MMScoring.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/PBScoring.h b/include/BALL/SCORING/FUNCTIONS/PBScoring.h
index 69bbd69..2068800 100644
--- a/include/BALL/SCORING/FUNCTIONS/PBScoring.h
+++ b/include/BALL/SCORING/FUNCTIONS/PBScoring.h
@@ -1,21 +1,3 @@
-/* PBScoring.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/PLPScoring.h b/include/BALL/SCORING/FUNCTIONS/PLPScoring.h
index 73170ea..39026e3 100755
--- a/include/BALL/SCORING/FUNCTIONS/PLPScoring.h
+++ b/include/BALL/SCORING/FUNCTIONS/PLPScoring.h
@@ -1,21 +1,3 @@
-/* PLPScoring.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/gridedMM.h b/include/BALL/SCORING/FUNCTIONS/gridedMM.h
index 69e2333..f880abe 100755
--- a/include/BALL/SCORING/FUNCTIONS/gridedMM.h
+++ b/include/BALL/SCORING/FUNCTIONS/gridedMM.h
@@ -1,21 +1,3 @@
-/* gridedMM.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/gridedPLP.h b/include/BALL/SCORING/FUNCTIONS/gridedPLP.h
index d5b2f88..82d52dc 100644
--- a/include/BALL/SCORING/FUNCTIONS/gridedPLP.h
+++ b/include/BALL/SCORING/FUNCTIONS/gridedPLP.h
@@ -1,21 +1,3 @@
-/* gridedPLP.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/rescoring.h b/include/BALL/SCORING/FUNCTIONS/rescoring.h
index 5efb4b4..07e1d4b 100755
--- a/include/BALL/SCORING/FUNCTIONS/rescoring.h
+++ b/include/BALL/SCORING/FUNCTIONS/rescoring.h
@@ -1,21 +1,3 @@
-/* rescoring.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/rescoring1D.h b/include/BALL/SCORING/FUNCTIONS/rescoring1D.h
index 898c3a2..8dd3686 100755
--- a/include/BALL/SCORING/FUNCTIONS/rescoring1D.h
+++ b/include/BALL/SCORING/FUNCTIONS/rescoring1D.h
@@ -1,21 +1,3 @@
-/* rescoring1D.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/rescoring3D.h b/include/BALL/SCORING/FUNCTIONS/rescoring3D.h
index 56bc189..ff2cd89 100644
--- a/include/BALL/SCORING/FUNCTIONS/rescoring3D.h
+++ b/include/BALL/SCORING/FUNCTIONS/rescoring3D.h
@@ -1,21 +1,3 @@
-/* rescoring3D.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/SCORING/FUNCTIONS/rescoring4D.h b/include/BALL/SCORING/FUNCTIONS/rescoring4D.h
index 09b3b3b..daff257 100644
--- a/include/BALL/SCORING/FUNCTIONS/rescoring4D.h
+++ b/include/BALL/SCORING/FUNCTIONS/rescoring4D.h
@@ -1,21 +1,3 @@
-/* rescoring4D.h
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/include/BALL/STRUCTURE/RMSDMinimizer.h b/include/BALL/STRUCTURE/RMSDMinimizer.h
index c309545..4035f53 100644
--- a/include/BALL/STRUCTURE/RMSDMinimizer.h
+++ b/include/BALL/STRUCTURE/RMSDMinimizer.h
@@ -25,11 +25,6 @@ namespace BALL
 			problem.
 			 \par
 	\ingroup StructureMapping
-	\remarks{
-		This code requires GSL (GNU Scientific Library) support to be enabled.
-		If you cannot compile/link code using RMSDMinimizer, please rerun configure
-		and enable GSL support (configure --help for details).
-	}
 	*/
 	class BALL_EXPORT RMSDMinimizer
 	{		
diff --git a/include/BALL/STRUCTURE/binaryFingerprintMethods.h b/include/BALL/STRUCTURE/binaryFingerprintMethods.h
index 78d0ed5..63b1636 100644
--- a/include/BALL/STRUCTURE/binaryFingerprintMethods.h
+++ b/include/BALL/STRUCTURE/binaryFingerprintMethods.h
@@ -545,6 +545,7 @@ namespace BALL
 			 * This value is decreased during calculations and finally 0 to indicate that all calculations have been performed!
 			 */
 			LongSize n_comparisons_;
+			LongSize n_comparisons_backup_;
 			
 			
 			/**
@@ -986,12 +987,6 @@ namespace BALL
 			void enumerateClusterMembers(Cluster* cl, unsigned int cluster_id);
 			
 			
-			/** 
-			 * Nearest Neighbour Chain Algorithm: Initialize by moving a random cluster from the set of active clusters to the tip of the NNChain.
-			 */
-			void initNNChain();
-			
-			
 			/**
 			 * Nearest Neighbour Chain Algorithm: Calculate the nearest neighbour of the nn_chain_tip_ within the set of active clusters.
 			 */
@@ -1005,13 +1000,6 @@ namespace BALL
 			
 			
 			/**
-			 * Nearest Neighbour Chain Algorithm: No clusters outside the chain left. Merge chain down and finish clustering.
-			 * @param Cluster* Pointer to return the root cluster.
-			 */
-			void finalizeNNChain(Cluster*& root);
-			
-			
-			/**
 			 * Merge two clusters.
 			 * @param c1 Pointer to first cluster to merge.
 			 * @param c2 Pointer to second cluster to merge.
diff --git a/include/BALL/STRUCTURE/residueChecker.h b/include/BALL/STRUCTURE/residueChecker.h
index 399a870..5fa7359 100644
--- a/include/BALL/STRUCTURE/residueChecker.h
+++ b/include/BALL/STRUCTURE/residueChecker.h
@@ -196,7 +196,7 @@ namespace BALL
 
 		/**	Enable a specific test
 		*/
-		void enable(TestType t) ;
+		void enable(TestType t, bool enable = true) ;
 
 		/**	Disable a specific test
 		*/
diff --git a/include/BALL/SYSTEM/MPISupport.h b/include/BALL/SYSTEM/MPISupport.h
index 34d58ce..3e19643 100644
--- a/include/BALL/SYSTEM/MPISupport.h
+++ b/include/BALL/SYSTEM/MPISupport.h
@@ -187,17 +187,17 @@ namespace BALL
 			/** Combine datapoints from all processes of the communicator.
 			 *  Exactly one process has to accept the data by calling 
 			 *  acceptCombinedDatapoints instead of combineDatapoints.
+			 *  If the required memory cannot be allocated, an Exception::OutOfMemory is thrown.
 			 **/
 			template <typename valuetype>
-			void combineDatapoints(const std::vector<valuetype>& our_share)
-				throw(Exception::OutOfMemory);
+			void combineDatapoints(const std::vector<valuetype>& our_share);
 
 			/** Accept datapoints that are combined from all processes of the
 			 *  communicator. 
+			 *  If the required memory cannot be allocated, an Exception::OutOfMemory is thrown.
 			 */
 			template <typename valuetype>
-			void acceptCombinedDatapoints(std::vector<valuetype>& combined_set, std::vector<valuetype>& our_share)
-				throw(Exception::OutOfMemory);
+			void acceptCombinedDatapoints(std::vector<valuetype>& combined_set, std::vector<valuetype>& our_share);
 
 			/** Distribute input of type datatype as evenly as possible over the
 			 *  processes in the communicator. Returns the datapoints
diff --git a/include/BALL/SYSTEM/fileSystem.h b/include/BALL/SYSTEM/fileSystem.h
index 309d378..dfb582d 100644
--- a/include/BALL/SYSTEM/fileSystem.h
+++ b/include/BALL/SYSTEM/fileSystem.h
@@ -97,6 +97,11 @@ namespace BALL
 		*/
 		static String baseName(const String& filename);
 
+		/** Return the extension of a file of present.
+				If file has no extension an empty String is returned.
+		*/
+		static String fileExtension(const String& filename);
+
 		/** Return the path to a file.
 				This method returns the path to a file, i.e. everything up to
 				and including the last occurence of  \link FileSystem::PATH_SEPARATOR PATH_SEPARATOR \endlink .
diff --git a/include/BALL/VIEW/DIALOGS/materialSettings.h b/include/BALL/VIEW/DIALOGS/materialSettings.h
index 8f2f465..696a615 100644
--- a/include/BALL/VIEW/DIALOGS/materialSettings.h
+++ b/include/BALL/VIEW/DIALOGS/materialSettings.h
@@ -68,7 +68,6 @@ namespace BALL
 			virtual void editAmbientColor();
 			virtual void editSpecularityColor();
 			virtual void editReflectivenessColor();
-			virtual void rendererChanged();
 			private:
 
 			void setLabel_(QLabel& label, float value);
diff --git a/include/BALL/VIEW/KERNEL/message.h b/include/BALL/VIEW/KERNEL/message.h
index 8a81f9d..dd3ff48 100644
--- a/include/BALL/VIEW/KERNEL/message.h
+++ b/include/BALL/VIEW/KERNEL/message.h
@@ -594,8 +594,11 @@ class BALL_VIEW_EXPORT RepresentationMessage: public Message
 		/// Finished the update of a Representation
 		FINISHED_UPDATE,
 
-		/// Add a Representation to GeometricControl, but dont update in Scene
-		ADD_TO_GEOMETRIC_CONTROL
+		/// Add a Representation to GeometricControl, but don't update in Scene
+		ADD_TO_GEOMETRIC_CONTROL,
+
+		/// Update properties of Representation in GeometricControl, but don't update in Scene
+		UPDATE_PROPERTIES
 	};
 
 	///
diff --git a/include/BALL/VIEW/KERNEL/stage.h b/include/BALL/VIEW/KERNEL/stage.h
index 86c8664..7d9885c 100644
--- a/include/BALL/VIEW/KERNEL/stage.h
+++ b/include/BALL/VIEW/KERNEL/stage.h
@@ -241,14 +241,14 @@ namespace BALL
 
 			/** This class holds all material parameters passed on to a raytracer.
 			 */
-			class RaytracingMaterial
+			class BALL_VIEW_EXPORT Material
 				: public PersistentObject
 			{
 				public:
 
-					BALL_CREATE(RaytracingMaterial)
+					BALL_CREATE(Material)
 
-					RaytracingMaterial();
+					Material();
 
 					/** @name Persistence
 					 */
@@ -281,6 +281,14 @@ namespace BALL
 					float     transparency;
 			};
 
+			// needed for backwards compatibilty of project files
+			class BALL_VIEW_EXPORT RaytracingMaterial : public Material
+			{
+				public:
+
+					BALL_CREATE(RaytracingMaterial)
+			};
+
 			/**	@name	Constructors and Destructors
 			*/	
 			//@{
@@ -470,10 +478,10 @@ namespace BALL
 			virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
 
 			/// Gives access to the default material parameters
-			RaytracingMaterial& getRTMaterial() { return rt_material_; }
+			Material& getMaterial() { return material_; }
 
 			/// Gives access to the default material parameters, const version
-			const RaytracingMaterial& getRTMaterial() const { return rt_material_; }
+			const Material& getMaterial() const { return material_; }
 
 			protected:
 
@@ -510,7 +518,7 @@ namespace BALL
 			float 							shininess_;
 
 			// the current default materials used for raytracing
-			RaytracingMaterial  rt_material_;
+			Material  material_;
 		};
 
 	} // namespace VIEW
diff --git a/include/BALL/VIEW/KERNEL/stringStub.h b/include/BALL/VIEW/KERNEL/stringStub.h
deleted file mode 100644
index 3efdfbe..0000000
--- a/include/BALL/VIEW/KERNEL/stringStub.h
+++ /dev/null
@@ -1 +0,0 @@
-// stringStub.h / stringStub.C are needed for VC2010!
diff --git a/include/BALL/VIEW/RENDERING/RENDERERS/XML3DRenderer.h b/include/BALL/VIEW/RENDERING/RENDERERS/XML3DRenderer.h
index bdab52c..84619d6 100644
--- a/include/BALL/VIEW/RENDERING/RENDERERS/XML3DRenderer.h
+++ b/include/BALL/VIEW/RENDERING/RENDERERS/XML3DRenderer.h
@@ -1,8 +1,6 @@
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id: XML3DRenderer.h,v 1.12.16.1 2007/03/25 21:26:13 oliver Exp $
-//
 
 #ifndef BALL_VIEW_RENDERING_RENDERERS_XML3DRENDERER_H
 #define BALL_VIEW_RENDERING_RENDERERS_XML3DRENDERER_H
@@ -84,6 +82,8 @@ namespace BALL
 			 */
 			//@{
 
+			virtual void setSize(float width, float height);
+
 			/** Sets the name of the file we will create.
 			 		\param name The file name
 			 */
@@ -109,9 +109,9 @@ namespace BALL
 			 */
 			String XML3DFinish(const String& object, const ColorRGBA& input);
 
-			/** Converts an RaytracingMaterial into the corresponding shader properties.
+			/** Converts an Material into the corresponding shader properties.
 			 */
-			String XML3DRaytracingMaterial(const Stage::RaytracingMaterial& input);
+			String XML3DRaytracingMaterial(const Stage::Material& input);
 
 			/** Converts a Vector3 into a String in XML3DRay format.
 			 */
@@ -200,7 +200,13 @@ namespace BALL
 				Surface sphere_template_;
 				Surface tube_template_;
 
-				Stage::RaytracingMaterial rt_material_;	
+				Stage::Material rt_material_;
+
+				Index current_sphere_number_;
+				Index current_tube_number_;
+
+				float fov_x_;
+				float fov_y_;
 		};
   
 	} // namespace BALL
diff --git a/include/BALL/VIEW/RENDERING/RENDERERS/glRenderer.h b/include/BALL/VIEW/RENDERING/RENDERERS/glRenderer.h
index 9760655..7cc5056 100644
--- a/include/BALL/VIEW/RENDERING/RENDERERS/glRenderer.h
+++ b/include/BALL/VIEW/RENDERING/RENDERERS/glRenderer.h
@@ -246,6 +246,9 @@ namespace BALL
 			vector<String> getExtensions();
 
 			///
+			bool runningOnVirtualBox();
+
+			///
 			bool enableVertexBuffers(bool state);
 
 			///
@@ -277,6 +280,8 @@ namespace BALL
 
 			virtual void getFrustum(float& near_f, float& far_f, float& left_f, float& right_f, float& top_f, float& bottom_f);
 
+			void updateMaterialForRepresentation(Representation const* rep) { bufferRepresentation(*rep); }
+
 	protected:
 
 			/** Maps the current viewplane to screen coordinates.
@@ -414,6 +419,8 @@ namespace BALL
 			inline Position getTextureIndex_(Position x, Position y, Position z, Size width, Size height);
 			void setupGridClipPlanes_(const GridVisualisation& slice);
 
+			// Sets the current OpenGL material
+			void setMaterial_(const Stage::Material& mat);
 			///
 			DrawingMode 					drawing_mode_;
 
diff --git a/include/BALL/VIEW/RENDERING/RENDERERS/renderer.h b/include/BALL/VIEW/RENDERING/RENDERERS/renderer.h
index 920a368..1bb0b75 100644
--- a/include/BALL/VIEW/RENDERING/RENDERERS/renderer.h
+++ b/include/BALL/VIEW/RENDERING/RENDERERS/renderer.h
@@ -79,13 +79,13 @@ namespace BALL
 			BALL_CREATE(Renderer)
 
 			/**	@name	Constructors and Destructors
-			*/	
+			*/
 			//@{
 
 			/** Default Constructor.
 			*/
 			Renderer();
-			
+
 			/**	Copy constructor.
 			*/
 			Renderer(const Renderer& renderer);
@@ -115,6 +115,11 @@ namespace BALL
 			 */
 			virtual void updateCamera(const Camera* camera = 0);
 
+			/**
+			 * Updates the material for the current representation
+			 */
+			virtual void updateMaterialForRepresentation(Representation const*) {};
+
 			/// Update the background color from the stage
 			virtual void updateBackgroundColor();
 
@@ -130,8 +135,8 @@ namespace BALL
 
 			/** Decide between event based and (threaded) continuous loop rendering.
 			*/
-			virtual void useContinuousLoop(bool use_loop) 
-			{ 
+			virtual void useContinuousLoop(bool use_loop)
+			{
 				// TODO: mutex for use_continuous_loop_ just to be on the safe side
 				use_continuous_loop_ = use_loop;
 			};
@@ -140,6 +145,14 @@ namespace BALL
 			*/
 			bool isContinuous() { return use_continuous_loop_; }
 
+			/** Whether renderer has its own FPS counter.
+			 */
+			virtual bool hasFPScounter() { return false; }
+
+			/** Internal renderer FPS if available, otherwise returns 0.
+			 */
+			virtual double getFPS() { return 0; }
+
 			///
 			virtual bool finish();
 
@@ -155,19 +168,19 @@ namespace BALL
 
 			/** Pick all objects in the given screen rectangle.
 			 */
-			virtual void pickObjects(Position x1, Position y1, Position x2, Position y2, 
+			virtual void pickObjects(Position x1, Position y1, Position x2, Position y2,
 			                         std::list<GeometricObject*>& objects);
 
 			/** Return the frustum used by this renderer.
 			 */
-			virtual void getFrustum(float& near_f, float& far_f, float& left_f, float& right_f, 
+			virtual void getFrustum(float& near_f, float& far_f, float& left_f, float& right_f,
 			                        float& top_f,  float& bottom_f);
 
 			//@}
 			/**	@name	Accessors
 			*/
 			//@{
-			
+
 			/** Render a Representation.
 			*/
 			virtual bool renderOneRepresentation(const Representation& representation);
@@ -185,7 +198,7 @@ namespace BALL
 			 */
 			virtual const Stage& getStage() const
 				{ return *stage_;}
-			
+
 			/** Set the stage for the renderer
 			 */
 			virtual void setStage(const Stage& stage)
@@ -214,7 +227,7 @@ namespace BALL
 			 *  just to ignore this setting.
 			 */
 			virtual void showLightSources(bool show_light_sources) { show_light_sources_ = show_light_sources; }
-			
+
 			/** Render a ruler.
 			 *
 			 *  If supported by the renderer implementation, this function will produce
@@ -237,11 +250,11 @@ namespace BALL
 			/**	@name Predicates
 			*/
 			//@{
-			
+
 			///
 			bool operator == (const Renderer& /*renderer*/) const
 				{ return true; }
-			
+
 			/// Wrapper for the renderering of special GeometricObjects
 			virtual void render_(const GeometricObject* object);
 
@@ -258,7 +271,7 @@ namespace BALL
 			/// Render a line
 			virtual void renderLine_(const Line& /*line*/)
 				{Log.error() << "renderLine_ not implemented in derived Renderer class" << std::endl;}
-			
+
 			/// Render an illuminated line
 			virtual void renderMultiLine_(const MultiLine& /*line*/)
 				{Log.error() << "renderMultiLine_ not implemented in derived Renderer class" << std::endl;}
@@ -266,7 +279,7 @@ namespace BALL
 			/// Render a surface mesh
 			virtual void renderMesh_(const Mesh& /*mesh*/)
 				{Log.error() << "renderMesh_ not implemented in derived Renderer class" << std::endl;}
- 
+
 			/// Render a single point
  			virtual void renderPoint_(const Point& /*point*/)
 				{Log.error() << "renderPoint_ not implemented in derived Renderer class" << std::endl;}
@@ -298,7 +311,7 @@ namespace BALL
 			/// Render a tube with two colors
 			virtual void renderTwoColoredTube_(const TwoColoredTube& /*two_colored_tube*/)
 				{Log.error() << "renderTwoColoredTube_ not implemented in derived Renderer class" << std::endl;}
-			
+
 			/// Render a grid
 			virtual void renderGridVisualisation_(const GridVisualisation&)
 				{Log.error() << "renderGridVisualisation_ not implemented in derived Renderer class" << std::endl;}
@@ -306,7 +319,7 @@ namespace BALL
 			virtual void renderQuadMesh_(const QuadMesh&)
 				{Log.error() << "renderQuadMesh_ not implemented in derived Renderer class" << std::endl;}
 				//@}
-			
+
 			//_
 			Scene* scene_;
 
diff --git a/include/BALL/VIEW/RENDERING/RENDERERS/rtfactRenderer.h b/include/BALL/VIEW/RENDERING/RENDERERS/rtfactRenderer.h
index 5f12245..b2f48e2 100644
--- a/include/BALL/VIEW/RENDERING/RENDERERS/rtfactRenderer.h
+++ b/include/BALL/VIEW/RENDERING/RENDERERS/rtfactRenderer.h
@@ -17,9 +17,47 @@
 #include <BALL/MATHS/vector3.h>
 #include <BALL/DATATYPE/hashMap.h>
 
-//RTRemote proxy to RTfact
-#include <RTremote/Renderer.hpp>
-#include <RTremote/Picking.hpp>
+#include <RTpieCpp/RayTracerHandle.hpp>
+#include <RTfact/Model/Image/BasicImage2D.hpp>
+#include <RTfact/Model/Framebuffer/Image2DFramebuffer.hpp>
+#include <RTfact/Utils/FPSMeter.hpp>
+
+namespace boost
+{
+	template <>
+	struct hash< RTpieCpp::MeshHandle >
+	{
+		public:
+			union conv
+			{
+				size_t s;
+				const void  *p;
+			};
+
+			size_t operator()(const RTpieCpp::MeshHandle& x ) const throw() {
+				conv c;
+				c.p=x.get();
+				return c.s;
+			}
+	};
+
+	template <>
+	struct hash< RTpieCpp::InstanceHandle >
+	{
+		public:
+			union conv
+			{
+				size_t s;
+				const void  *p;
+			};
+
+			size_t operator()(const RTpieCpp::InstanceHandle& x ) const throw() {
+				conv c;
+				c.p=x.get();
+				return c.s;
+			}
+	};
+}
 
 namespace BALL
 {
@@ -31,22 +69,38 @@ namespace BALL
 			*/
 		class BALL_VIEW_EXPORT RTfactRenderer
 			: public RaytracingRenderer
-		{	  
-			public:	  
+		{
+			public:
 
 				/** This class encapsulates RTfact's data structures per Representation.
 				 */
 				class RTfactData
 				{
 					public:
-						/// The top-level group handles this object was assigned to
-						std::vector<RTfact::Remote::GroupHandle> top_group_handles;
-						
-						/// The object handles
-						std::vector<RTfact::Remote::GeoHandle> object_handles;
+
+						/// The object handles (all objects)
+						std::vector<RTpieCpp::GeometryHandle> object_handles;
+
+						/// The meshes
+						std::vector<RTpieCpp::MeshHandle> mesh_handles;
+
+						/// The instances (visible objects)
+						std::vector<RTpieCpp::InstanceHandle> instance_handles;
 
 						/// The materials
-						std::vector<RTfact::Remote::RTAppearanceHandle> material_handles;
+						std::vector<RTpieCpp::AppearanceHandle> material_handles;
+
+						/// Cut-plane geometries
+						std::vector<RTpieCpp::GeometryHandle> cutPlanes;
+
+						/// Cut-plane meshes
+						std::vector<RTpieCpp::MeshHandle> cutPlaneMeshes;
+
+						/// Cut-plane instances
+						std::vector<RTpieCpp::InstanceHandle> cutPlaneInstances;
+
+						/// Cut-planes material
+						RTpieCpp::AppearanceHandle cutPlaneShader;
 
 						/// Mark previously disabled representations
 						bool has_been_disabled;
@@ -64,12 +118,16 @@ namespace BALL
 				{
 				}
 
+				virtual bool hasFPScounter();
+
+				virtual double getFPS();
+
 				/************************************************************************/
 				/* RaytracingRenderer methods					   */
 				/************************************************************************/
 				virtual bool init(Scene& scene);
 
-				virtual String getRenderer()  
+				virtual String getRenderer()
 				{
 					return "RTfact-RTRemote Ray Tracer";
 				}
@@ -82,8 +140,10 @@ namespace BALL
 				virtual void pickObjects(Position x1, Position y1, Position x2, Position y2,
 				                         std::list<GeometricObject*>& objects);
 
+
+
 				virtual void setSize(float width, float height);
-				
+
 				virtual void setupStereo(float eye_separation, float focal_length);
 
 				virtual void getFrustum(float& near_f, float& far_f, float& left_f, float& right_f, float& top_f, float& bottom_f);
@@ -95,71 +155,97 @@ namespace BALL
 				virtual void useContinuousLoop(bool use_loop);
 
 				void bufferRepresentation(const Representation& rep);
+				void bufferRepresentationDynamic(const Representation& rep);
 				void removeRepresentation(const Representation& rep);
 
 				void setLights(bool reset_all = false);
 
 				void updateCamera(const Camera* camera = 0);
-				
+
 				void updateBackgroundColor();
 
 				void setupEnvironmentMap(const QImage& image);
 
 				void updateMaterialForRepresentation(Representation const* rep);
 
-				RTfact::Remote::GroupHandle transformTube(const TwoColoredTube& tube);
-				RTfact::Remote::GroupHandle transformLine(const TwoColoredLine& line);
-				void updateMaterialFromStage(RTfact::Remote::RTAppearanceHandle& material);
-				void convertMaterial(Stage::RaytracingMaterial const& rt_material, RTfact::Remote::RTAppearanceHandle& material);
+				void transformTube(const TwoColoredTube& tube, float *trafo);
+				void transformLine(const TwoColoredLine& line, float *trafo);
+
+				void updateMaterialFromStage(RTpieCpp::AppearanceHandle& material);
+				void convertMaterial(Stage::Material const& rt_material, RTpieCpp::AppearanceHandle& material);
 
 				/** Raytracing-related functionality **/
-				//@{ 
+				//@{
 				/** Intersect a set of rays with the geometry buffered by this renderer.
 				 *
-				 *  This function will intersect the rays 
+				 *  This function will intersect the rays
 				 *
 				 *     origins[i] + l * directions[i]
 				 *
 				 *  with the geometry that has been buffered by this renderer previously.
 				 */
-				virtual std::vector<float> intersectRaysWithGeometry(const std::vector<Vector3>& origins, 
-																														 const std::vector<Vector3>& directions);
+                virtual std::vector<float> intersectRaysWithGeometry(const std::vector<Vector3>& origins, const std::vector<Vector3>& directions);
 
-				//@}
+                //@}
 
-			private:
+                private:
 
-				std::vector<RTfact::Remote::RTLightHandle> lights_;
+                static const float vectorDifferenceTolerance_;
 
-				RTfact::Remote::Renderer m_renderer;
+                bool doVectorsDiffer(const Vector3& vecA, const Vector3& vecB);
 
-				boost::shared_ptr<RTfact::Remote::Picking>  m_picking;
+                template<typename taPixelType>
+                void renderImpl(taPixelType* buffer, const unsigned int width, const unsigned int height, const unsigned int pitch);
 
-				HashMap<Representation const*, RTfactData> objects_;
-				HashMap<RTfact::Remote::GeoHandle, GeometricObject*> geometric_objects_;
+                void renderImpl(float* buffer, const unsigned int width, const unsigned int height, const unsigned int pitch)
+                {
+                }
 
-				Surface sphere_template_;
-				Surface tube_template_;
+                std::vector<RTpieCpp::LightHandle>                      lights_;
 
-				template<typename taPixelType>
-				void renderImpl(taPixelType* buffer, const unsigned int width, const unsigned int height, const unsigned int pitch);
+                typedef RTfact::BasicImage2D<float>                     t_ColorImage;
+                typedef RTfact::BasicImage2D<float>                     t_DistanceImage;
+                typedef RTfact::Image2DFramebuffer<
+                                                t_ColorImage,
+                                                t_DistanceImage>        t_Framebuffer;
 
-				void renderImpl(float* buffer, const unsigned int width, const unsigned int height, const unsigned int pitch)
-				{
-				}
+                typedef RTfact::BasicImage2D<unsigned char>             t_ByteColorImage;
+                typedef RTfact::BasicImage2D<unsigned char>             t_ByteDistanceImage;
+                typedef RTfact::Image2DFramebuffer<
+                                                t_ByteColorImage,
+                                                t_ByteDistanceImage>    t_ByteFramebuffer;
+
+                RTpieCpp::SceneHandle                                   sceneHandle;
+                RTpieCpp::RayTracerHandle                               rayTracer;
+                RTpieCpp::CameraHandle                                  cameraHandle;
+                RTpieCpp::FrameBufferHandle                             renderBuffer;
+                RTpieCpp::RenderTaskHandle                              renderTask;
+                t_Framebuffer                                           framebuffer;
+                t_ByteFramebuffer                                       byteFramebuffer;
+
+
+                RTfact::FPSMeter                                        fpsMeter;
+                RTpieCpp::PickTaskHandle                                pickTask;
+
+                HashMap<Representation const*, RTfactData>              objects_;
+                HashMap<RTpieCpp::InstanceHandle, GeometricObject*>     geometric_objects_inst;
+                HashMap<RTpieCpp::MeshHandle, GeometricObject*>         geometric_objects_;
+
+                Surface                                                 sphere_template_;
+                Surface                                                 tube_template_;
 
-				bool rtfact_needs_update_;
+                bool                                                    rtfact_needs_update_;
 
-				Vector3 last_camera_position;
-				Vector3 last_camera_view_vec;
-				Vector3 last_camera_lookup;
+                Vector3                                                 last_camera_position;
+                Vector3                                                 last_camera_view_vec;
+                Vector3                                                 last_camera_lookup;
 
-				float x_scale_;
-				float y_scale_;
-		};
+                float                                                   x_scale_;
+                float                                                   y_scale_;
 
+        };
 
-	} // namespace VIEW
+    } // namespace VIEW
 } // namespace BALL
 
 #endif // BALL_VIEW_RENDERING_RTFACTRENDERER_H
diff --git a/include/BALL/VIEW/WIDGETS/geometricControl.h b/include/BALL/VIEW/WIDGETS/geometricControl.h
index 39420ff..e11bc11 100644
--- a/include/BALL/VIEW/WIDGETS/geometricControl.h
+++ b/include/BALL/VIEW/WIDGETS/geometricControl.h
@@ -92,7 +92,7 @@ namespace BALL
 
 			/** Update a Representation.
 			*/
-			virtual void updateRepresentation(Representation& rep);
+			virtual void updateRepresentation(Representation& rep, bool force=false);
 			
 			/** Mutable inspection of the selection.
 			*/
diff --git a/include/BALL/VIEW/WIDGETS/molecularStructure.h b/include/BALL/VIEW/WIDGETS/molecularStructure.h
index 764b16f..3cc61f3 100644
--- a/include/BALL/VIEW/WIDGETS/molecularStructure.h
+++ b/include/BALL/VIEW/WIDGETS/molecularStructure.h
@@ -171,6 +171,10 @@ namespace BALL
 			*/
 			ForceField& getForceField();
 
+      /** Get the force_field_id of the currently selected ForceField
+      */
+      Position getForceFieldID();
+
 			/** Get the instance of the AMBER forcefield.
 					The forcefield will be created, when this function is called the first time.
 			*/
diff --git a/include/BALL/VIEW/WIDGETS/scene.h b/include/BALL/VIEW/WIDGETS/scene.h
index 612d0a1..3717f21 100644
--- a/include/BALL/VIEW/WIDGETS/scene.h
+++ b/include/BALL/VIEW/WIDGETS/scene.h
@@ -51,13 +51,13 @@
 
 #include <boost/shared_ptr.hpp>
 
-#ifdef BALL_HAS_RTFACT 
+#ifdef BALL_HAS_RTFACT
 
 #ifndef BALL_VIEW_RENDERING_RAYTRACINGRENDERER_H
 # include <BALL/VIEW/RENDERING/RENDERERS/raytracingRenderer.h>
 #endif
 
-#endif // BALL_HAS_RTFACT 
+#endif // BALL_HAS_RTFACT
 
 class QMouseEvent;
 class QRubberBand;
@@ -97,11 +97,11 @@ namespace BALL
 		/**	Scene is the main visualization widget that shows the graphical Representation 's.
 				To do this, the class Scene must be a child of the MainControl.
 				Because the MainControl is also the main application object
-				a Scene must be created with the pointer to the MainControl 
+				a Scene must be created with the pointer to the MainControl
 				as parent widget. <br>
-				Scene is capable of stereo 3D view with shutter glasses and CRT monitors. This only works, if the 
+				Scene is capable of stereo 3D view with shutter glasses and CRT monitors. This only works, if the
 				OpenGL-driver supports this. NVIDIA cards need a Quad buffer, like they are used in the "Quad" cards.
-				For other NVIDIA cards, you can try the tool <a href="http://www.guru3d.com/rivatuner">"Rivatuner"</a>, 
+				For other NVIDIA cards, you can try the tool <a href="http://www.guru3d.com/rivatuner">"Rivatuner"</a>,
 				which tries to enable this feature for cards, which natively dont support this. To enter
 				and leave the stereo mode, press ALT-Y. If your OpenGL doesnt support the stereo view, you will see an
 				error message in the message bar at the bottom of the main window.
@@ -111,15 +111,15 @@ namespace BALL
 				- Picking Mode: To select Composite 's, e.g. Molecules
 				- Rotate Mode: Transform your view point in the threedimensional room, e.g. rotate or zoom
 				- Eye Distance: Change the eye distance for stereo view
-					
+
 				To change between the first two modi, there is a menu entry with checkboxes in the main
-				menu bar of the application. 
+				menu bar of the application.
 				<br>
 				In Picking mode, left mouse button selects composites and right mouse button deselects.
 				There are two ways to (de-)select: Either click on single items, or draw a selection rectangle
 				by keeping the mouse button pressed and moving the mouse.
 				Users with only one mouse button can use the SHIFT button, while pressing the mouse button
-				to deselect. 
+				to deselect.
 				<br>
 				In Rotate mode, left mouse button rotates, mid mouse button zooms in and out and right button
 				moves the view.
@@ -140,6 +140,8 @@ namespace BALL
 				public ModularWidget
 		{
 			friend class AnimationThread;
+			friend class RenderSetup;
+			friend class HTMLBasedInterface;
 
 #ifdef BALL_HAS_RTFACT
       typedef boost::shared_ptr<RaytracingRenderer> RaytracingRendererPtr;
@@ -181,21 +183,21 @@ namespace BALL
 					the camera position.
 					\par
 					Calls registerWidget.
-					\param      parent_widget the parent widget of this scene 
-					\param      name the name of this scene 
-					\param      w_flags the flags the scene widget should have 
+					\param      parent_widget the parent widget of this scene
+					\param      name the name of this scene
+					\param      w_flags the flags the scene widget should have
 					(See documentation of QT-library for information concerning widget flags)
 					*/
 				Scene(QWidget* parent_widget = 0, const char* name = NULL, Qt::WFlags w_flags = 0);
 
 				/** Copy constructor.
 					Initialize the width, height and camera position.
-					\par					
+					\par
 					Calls registerWidget.
 					\param  scene the scene to be copied
-					\param  parent_widget the parent widget of this scene 
-					\param  name the name of this scene 
-					\param  wflags the flags the scene widget should have 
+					\param  parent_widget the parent widget of this scene
+					\param  name the name of this scene
+					\param  wflags the flags the scene widget should have
 					(See documentation of QT-library for information concerning widget flags)
 					*/
 				BALL_DEPRECATED Scene(const Scene& scene, QWidget* parent_widget = NULL, const char* name = NULL, Qt::WFlags wflags = 0);
@@ -237,7 +239,7 @@ namespace BALL
 				//@{
 
 				/** Handles messages sent by other registered ConnectionObject objects.
-					Filters for SceneMessage and sets the Camera appropriate or updates the visualization. 
+					Filters for SceneMessage and sets the Camera appropriate or updates the visualization.
 					\param message the pointer to the message that should be processed
 					\see   ConnectionObject
 					\see   Message
@@ -260,7 +262,7 @@ namespace BALL
 					translating and zooming the scene)
 					- the <b> picking mode</b> (all mouse actions are attached to picking objects from the scene)
 					\par
-					This method is called automatically	immediately before the main application is started 
+					This method is called automatically	immediately before the main application is started
 					by MainControl::show().
 					\param main_control the MainControl object to be initialized with this scene
 					*/
@@ -295,7 +297,7 @@ namespace BALL
 				virtual bool isValid() const;
 
 				/** Internal value dump.
-					Dump the current internal state of this scene to 
+					Dump the current internal state of this scene to
 					the output ostream <b> s</b> with dumping depth <b> depth</b>.
 					\param   s output stream where to output the internal state of this scene
 					\param   depth the dumping depth
@@ -466,7 +468,7 @@ namespace BALL
 				/** Move the view. \\
 					v.x = right  \\
 					v.y = up     \\
-					v.z = view direction 
+					v.z = view direction
 					*/
 				void move(Vector3 v);
 
@@ -474,14 +476,14 @@ namespace BALL
 				/** Move some Composites. \\
 					v.x = right  \\
 					v.y = up     \\
-					v.z = view direction 
+					v.z = view direction
 					*/
 				void moveComposites(const std::list<Composite*>& composites, Vector3 v);
 
 				/** Rotate some Composites. \\
 					v.x = right  \\
 					v.y = up     \\
-					v.z = view direction 
+					v.z = view direction
 					*/
 				void rotateComposites(const std::list<Composite*>& composites, float degree_right, float degree_up, float degree_clockwise = 0);
 
@@ -511,13 +513,11 @@ namespace BALL
 				void resetTracking() {tracking_initialized_ = false;}
 
 				// TODO: this pretty hacky!
-#ifdef BALL_HAS_RTFACT
-				void updateAllRTMaterials();
+				void updateAllMaterials();
 
-				void updateRTMaterialForRepresentation(Representation* rep, const Stage::RaytracingMaterial& new_material);
-#endif
-				
-				void lightsUpdated(bool redraw = false); 
+				void updateMaterialForRepresentation(Representation* rep, const Stage::Material& new_material);
+
+				void lightsUpdated(bool redraw = false);
 
 				/// Try to setup an environment map for all renderers that support it
 				void setupEnvironmentMap(const QImage& image);
@@ -568,13 +568,13 @@ namespace BALL
 
 				/// Export to POVRay whithout showing file dialog
 				void exportNextPOVRay();
-			
+
 				///
 				void exportXML3D();
 
 				///
 				void dumpXML3D(std::ostream& xml3ddump);
-				
+
 				///
 				void printScene();
 
@@ -765,7 +765,7 @@ namespace BALL
 
 				void renderGrid_();
 
-				QAction *new_molecule_action_, *optimize_action_; 
+				QAction *new_molecule_action_, *optimize_action_;
 				QAction *add_hydrogens_action_;
 				QAction *bondorders_action_;
 
@@ -799,7 +799,7 @@ namespace BALL
 				virtual void paintGL();
 
 				/** Resize the widget.
-						Overridden qt method for resizing this scene. 
+						Overridden qt method for resizing this scene.
 						This method will be called automatically every time a rezize event is handled.
 						\param  width the new width of this scene
 						\param  height the new height of this scene
@@ -807,7 +807,7 @@ namespace BALL
 				virtual void resizeEvent(QResizeEvent* event);
 
 				/**
-				 * This function handles custom events that for example are sent 
+				 * This function handles custom events that for example are sent
 				 * by the input device drivers
 				 * \param evt A pointer to the event that shell be processed
 				 */
@@ -871,7 +871,7 @@ namespace BALL
 				void pickParent_(QPoint p);
 
 				void writeLights_(INIFile& inifile) const;
-				
+
 				void readLights_(const INIFile& inifile);
 
 				void createCoordinateSystem_(bool at_origin);
@@ -879,19 +879,19 @@ namespace BALL
 				void registerRenderers_();
 
 				/// Estimate current fps and convert into a string
-				String createFPSInfo_();
+				String createFPSInfo_(Renderer* renderer);
 
 				// Menu entry IDs
 				QAction *no_stereo_action_, *enter_stereo_action_, *active_stereo_action_, *dual_stereo_action_, *dual_stereo_different_display_action_;
 				QAction *record_animation_action_, *start_animation_action_, *clear_animation_action_, *cancel_animation_action_;
 				QAction *animation_export_POV_action_, *animation_export_VRML_action_, 	*animation_export_PNG_action_, *animation_repeat_action_;
 
-#ifdef BALL_HAS_RTFACT	
-				QAction *start_continuous_loop_action_, *stop_continuous_loop_action_, *toggle_continuous_loop_action_;
-#endif			
+#ifdef BALL_HAS_RTFACT
+                QAction *toggle_continuous_loop_action_;
+#endif
 				QAction *switch_grid_;
 				QMenu* create_coordinate_system_;
-				
+
 				Vector3 system_origin_;
 				Vector3 old_trackorigin_;
 				bool tracking_initialized_;
@@ -909,7 +909,7 @@ namespace BALL
 				GLRenderer* gl_renderer_;
 
 #ifdef BALL_HAS_RTFACT
-				RaytracingRendererPtr rt_renderer_;
+				RaytracingRenderer* rt_renderer_;
 				RaytracingWindowPtr rt_window_;
 #endif
 
diff --git a/source/APPLICATIONS/BALLVIEW/aboutDialog.ui b/source/APPLICATIONS/BALLVIEW/aboutDialog.ui
index 6367b2d..82b017b 100755
--- a/source/APPLICATIONS/BALLVIEW/aboutDialog.ui
+++ b/source/APPLICATIONS/BALLVIEW/aboutDialog.ui
@@ -587,11 +587,9 @@
    <item>
     <widget class="QLabel" name="TextLabel1">
      <property name="text">
-      <string notr="true">Stefan Nickels
-Sabine C. Mueller
+			 <string notr="true">Anna Katharina Dehof
+Stefan Nickels
 Daniel Stöckel
-Wolfgang Herget
-Anna Katharina Dehof
 Oliver Kohlbacher
 Hans-Peter Lenhof
 Andreas Hildebrandt</string>
diff --git a/source/APPLICATIONS/BALLVIEW/demoTutorialDialog.C b/source/APPLICATIONS/BALLVIEW/demoTutorialDialog.C
index fe9adca..82c6c28 100644
--- a/source/APPLICATIONS/BALLVIEW/demoTutorialDialog.C
+++ b/source/APPLICATIONS/BALLVIEW/demoTutorialDialog.C
@@ -205,7 +205,7 @@ void DemoTutorialDialog::initTutorials_()
 	else if  (tutorial_type_ == RAYTRACING_TUTORIAL)
 	{ 
 #ifdef BALL_HAS_RTFACT
-		Stage::RaytracingMaterial& rt_material = stage->getRTMaterial();
+		Stage::Material& rt_material = stage->getMaterial();
 
 		rt_material.ambient_color = ColorRGBA(255, 255, 255, 255);
 		rt_material.ambient_intensity = 0.;
diff --git a/source/APPLICATIONS/QuEasyRun/CMakeLists.txt b/source/APPLICATIONS/QuEasyRun/CMakeLists.txt
index 254a70c..7a92d52 100644
--- a/source/APPLICATIONS/QuEasyRun/CMakeLists.txt
+++ b/source/APPLICATIONS/QuEasyRun/CMakeLists.txt
@@ -40,7 +40,7 @@ ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 	SET_TARGET_PROPERTIES(QuEasyRun PROPERTIES MACOSX_BUNDLE TRUE)
 ENDIF()
 
-TARGET_LINK_LIBRARIES(QuEasyRun BALL ${Qwt5_Qt4_LIBRARY})
+TARGET_LINK_LIBRARIES(QuEasyRun BALL)
 
 INSTALL(TARGETS QuEasyRun
 	COMPONENT "${COMPONENT_QUEASY}"
@@ -67,5 +67,3 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 	INSTALL(CODE "SET(CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})" COMPONENT "${COMPONENT_QUEASY}")
 	INSTALL(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/BALLViewCreateBundle.cmake" COMPONENT "${COMPONENT_QUEASY}")
 ENDIF()
-
-TARGET_LINK_LIBRARIES(QuEasyRun BALL VIEW)
diff --git a/source/APPLICATIONS/QuEasyRun/featureSelector.C b/source/APPLICATIONS/QuEasyRun/featureSelector.C
index 13d8651..3e64d2d 100644
--- a/source/APPLICATIONS/QuEasyRun/featureSelector.C
+++ b/source/APPLICATIONS/QuEasyRun/featureSelector.C
@@ -1,23 +1,3 @@
-/* featureSelector.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <fstream>
 #include <BALL/QSAR/registry.h>
 #include <BALL/QSAR/featureSelection.h>
diff --git a/source/APPLICATIONS/QuEasyRun/inputPartitioner.C b/source/APPLICATIONS/QuEasyRun/inputPartitioner.C
index b5a8d2e..48768b5 100644
--- a/source/APPLICATIONS/QuEasyRun/inputPartitioner.C
+++ b/source/APPLICATIONS/QuEasyRun/inputPartitioner.C
@@ -1,23 +1,3 @@
-/* inputPartitioner.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <fstream>
 #include <BALL/QSAR/registry.h>
 #include <BALL/QSAR/featureSelection.h>
diff --git a/source/APPLICATIONS/QuEasyRun/inputReader.C b/source/APPLICATIONS/QuEasyRun/inputReader.C
index 48e81e0..6a20656 100644
--- a/source/APPLICATIONS/QuEasyRun/inputReader.C
+++ b/source/APPLICATIONS/QuEasyRun/inputReader.C
@@ -1,23 +1,3 @@
-/* inputReader.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <fstream>
 #include <BALL/QSAR/registry.h>
 #include <BALL/QSAR/configIO.h>
diff --git a/source/APPLICATIONS/QuEasyRun/main.C b/source/APPLICATIONS/QuEasyRun/main.C
index 929beac..c74455b 100644
--- a/source/APPLICATIONS/QuEasyRun/main.C
+++ b/source/APPLICATIONS/QuEasyRun/main.C
@@ -1,23 +1,3 @@
-/* main.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <fstream>
 #include <BALL/QSAR/registry.h>
 #include <BALL/QSAR/featureSelection.h>
diff --git a/source/APPLICATIONS/QuEasyRun/modelCreator.C b/source/APPLICATIONS/QuEasyRun/modelCreator.C
index 1f8fcfd..29f55f1 100644
--- a/source/APPLICATIONS/QuEasyRun/modelCreator.C
+++ b/source/APPLICATIONS/QuEasyRun/modelCreator.C
@@ -1,23 +1,3 @@
-/* modelCreator.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <fstream>
 #include <BALL/QSAR/registry.h>
 #include <BALL/QSAR/featureSelection.h>
diff --git a/source/APPLICATIONS/QuEasyRun/predictor.C b/source/APPLICATIONS/QuEasyRun/predictor.C
index 93f077d..0e3a768 100644
--- a/source/APPLICATIONS/QuEasyRun/predictor.C
+++ b/source/APPLICATIONS/QuEasyRun/predictor.C
@@ -1,23 +1,3 @@
-/* predictor.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <fstream>
 #include <BALL/QSAR/registry.h>
 #include <BALL/QSAR/configIO.h>
diff --git a/source/APPLICATIONS/QuEasyRun/validator.C b/source/APPLICATIONS/QuEasyRun/validator.C
index 2e35e66..6eb7eca 100644
--- a/source/APPLICATIONS/QuEasyRun/validator.C
+++ b/source/APPLICATIONS/QuEasyRun/validator.C
@@ -1,23 +1,3 @@
-/* validator.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <fstream>
 #include <BALL/QSAR/registry.h>
 #include <BALL/QSAR/featureSelection.h>
diff --git a/source/APPLICATIONS/QuEasyViz/CMakeLists.txt b/source/APPLICATIONS/QuEasyViz/CMakeLists.txt
index 9515260..7d548a3 100644
--- a/source/APPLICATIONS/QuEasyViz/CMakeLists.txt
+++ b/source/APPLICATIONS/QuEasyViz/CMakeLists.txt
@@ -1,5 +1,10 @@
 PROJECT(QuEasyViz)
 
+IF(NOT BALL_HAS_VIEW)
+	MESSAGE(STATUS "BALL is configured not to build the VIEW components. Diabling QuEasyViz.")
+	RETURN()
+ENDIF()
+
 FIND_PACKAGE(Qwt5)
 
 IF(NOT Qwt5_Qt4_FOUND)
diff --git a/source/APPLICATIONS/QuEasyViz/CSVInputDataItem.C b/source/APPLICATIONS/QuEasyViz/CSVInputDataItem.C
index fc2ed6a..f49b72c 100644
--- a/source/APPLICATIONS/QuEasyViz/CSVInputDataItem.C
+++ b/source/APPLICATIONS/QuEasyViz/CSVInputDataItem.C
@@ -1,23 +1,3 @@
-/* CSVInputDataItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <CSVInputDataItem.h>
 #include <mainWindow.h>
 
diff --git a/source/APPLICATIONS/QuEasyViz/CSVInputDataItem.h b/source/APPLICATIONS/QuEasyViz/CSVInputDataItem.h
index a0eb8bd..864442a 100644
--- a/source/APPLICATIONS/QuEasyViz/CSVInputDataItem.h
+++ b/source/APPLICATIONS/QuEasyViz/CSVInputDataItem.h
@@ -1,23 +1,3 @@
-/* CSVInputDataItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef CVS_INPUTDATAITEM_H
 #define CVS_INPUTDATAITEM_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/CSVInputDialog.C b/source/APPLICATIONS/QuEasyViz/CSVInputDialog.C
index b9dd591..f23ecc6 100644
--- a/source/APPLICATIONS/QuEasyViz/CSVInputDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/CSVInputDialog.C
@@ -1,23 +1,3 @@
-/* CSVInputDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <CSVInputDialog.h>
 #include <BALL/QSAR/exception.h>
 #include <QtGui/QMessageBox>
@@ -156,4 +136,4 @@ namespace BALL
 			return no_y_;
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/CSVInputDialog.h b/source/APPLICATIONS/QuEasyViz/CSVInputDialog.h
index e4d9a93..52566d8 100644
--- a/source/APPLICATIONS/QuEasyViz/CSVInputDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/CSVInputDialog.h
@@ -1,23 +1,3 @@
-/* CSVInputDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef CSVINPUTDIALOG_H
 #define CSVINPUTDIALOG_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/SDFInputDataItem.C b/source/APPLICATIONS/QuEasyViz/SDFInputDataItem.C
index 38284ec..74e5631 100644
--- a/source/APPLICATIONS/QuEasyViz/SDFInputDataItem.C
+++ b/source/APPLICATIONS/QuEasyViz/SDFInputDataItem.C
@@ -1,23 +1,3 @@
-/* SDFInputDataItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <SDFInputDataItem.h>
 #include <mainWindow.h>
 
diff --git a/source/APPLICATIONS/QuEasyViz/SDFInputDataItem.h b/source/APPLICATIONS/QuEasyViz/SDFInputDataItem.h
index 9ccdd20..1a942e0 100644
--- a/source/APPLICATIONS/QuEasyViz/SDFInputDataItem.h
+++ b/source/APPLICATIONS/QuEasyViz/SDFInputDataItem.h
@@ -1,23 +1,3 @@
-/* SDFInputDataItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef SDFInputDataItem_H
 #define SDFInputDataItem_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/SDFInputDialog.C b/source/APPLICATIONS/QuEasyViz/SDFInputDialog.C
index 5916b94..4ae4484 100644
--- a/source/APPLICATIONS/QuEasyViz/SDFInputDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/SDFInputDialog.C
@@ -1,23 +1,3 @@
-/* SDFInputDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <SDFInputDialog.h>
 #include <BALL/QSAR/exception.h>
 #include <QtGui/QMessageBox>
diff --git a/source/APPLICATIONS/QuEasyViz/SDFInputDialog.h b/source/APPLICATIONS/QuEasyViz/SDFInputDialog.h
index 1328264..9487e2c 100644
--- a/source/APPLICATIONS/QuEasyViz/SDFInputDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/SDFInputDialog.h
@@ -1,23 +1,3 @@
-/* SDFInputDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef SDFInputDialog_H
 #define SDFInputDialog_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/bayesPlotter.C b/source/APPLICATIONS/QuEasyViz/bayesPlotter.C
index fd463c5..089cb3d 100644
--- a/source/APPLICATIONS/QuEasyViz/bayesPlotter.C
+++ b/source/APPLICATIONS/QuEasyViz/bayesPlotter.C
@@ -1,23 +1,3 @@
-/* bayesPlotter.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <bayesPlotter.h>
 #include <qwt_plot_zoomer.h>
 #include <qwt_scale_widget.h>
@@ -175,4 +155,4 @@ namespace BALL
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/bayesPlotter.h b/source/APPLICATIONS/QuEasyViz/bayesPlotter.h
index 58c5e50..aa289d5 100644
--- a/source/APPLICATIONS/QuEasyViz/bayesPlotter.h
+++ b/source/APPLICATIONS/QuEasyViz/bayesPlotter.h
@@ -1,23 +1,3 @@
-/* bayesPlotter.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef BAYES_PLOTTER
 #define BAYES_PLOTTER
 
diff --git a/source/APPLICATIONS/QuEasyViz/coefficientPlotter.C b/source/APPLICATIONS/QuEasyViz/coefficientPlotter.C
index 34cffbb..9accab4 100644
--- a/source/APPLICATIONS/QuEasyViz/coefficientPlotter.C
+++ b/source/APPLICATIONS/QuEasyViz/coefficientPlotter.C
@@ -1,23 +1,3 @@
-/* coefficientPlotter.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <coefficientPlotter.h>
 #include <qwt_plot_curve.h>
 #include <qwt_plot_marker.h>
diff --git a/source/APPLICATIONS/QuEasyViz/coefficientPlotter.h b/source/APPLICATIONS/QuEasyViz/coefficientPlotter.h
index 91dbfeb..1ba8e57 100644
--- a/source/APPLICATIONS/QuEasyViz/coefficientPlotter.h
+++ b/source/APPLICATIONS/QuEasyViz/coefficientPlotter.h
@@ -1,23 +1,3 @@
-/* coefficientPlotter.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef COEFF_PLOTTER
 #define COEFF_PLOTTER
 
diff --git a/source/APPLICATIONS/QuEasyViz/componentPlotter.C b/source/APPLICATIONS/QuEasyViz/componentPlotter.C
index aec2333..0ad6c06 100644
--- a/source/APPLICATIONS/QuEasyViz/componentPlotter.C
+++ b/source/APPLICATIONS/QuEasyViz/componentPlotter.C
@@ -1,24 +1,3 @@
-/* componentPlotter.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- 
 #include <componentPlotter.h>
 
 #include <qwt_plot_curve.h>
@@ -300,4 +279,4 @@ namespace BALL
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/componentPlotter.h b/source/APPLICATIONS/QuEasyViz/componentPlotter.h
index 973d573..03a807b 100644
--- a/source/APPLICATIONS/QuEasyViz/componentPlotter.h
+++ b/source/APPLICATIONS/QuEasyViz/componentPlotter.h
@@ -1,23 +1,3 @@
-/* componentPlotter.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef COMP_PLOTTER
 #define COMP_PLOTTER
 
diff --git a/source/APPLICATIONS/QuEasyViz/connectionManager.C b/source/APPLICATIONS/QuEasyViz/connectionManager.C
index 719dc8f..a9526b9 100644
--- a/source/APPLICATIONS/QuEasyViz/connectionManager.C
+++ b/source/APPLICATIONS/QuEasyViz/connectionManager.C
@@ -1,23 +1,3 @@
-/* connectionManager.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <connectionManager.h>
 #include <QtGui/QGridLayout>
 #include <QtGui/QVBoxLayout>
@@ -199,4 +179,4 @@ namespace BALL
 		{
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/connectionManager.h b/source/APPLICATIONS/QuEasyViz/connectionManager.h
index 1ae7fa7..a676fbe 100644
--- a/source/APPLICATIONS/QuEasyViz/connectionManager.h
+++ b/source/APPLICATIONS/QuEasyViz/connectionManager.h
@@ -1,23 +1,3 @@
-/* connectionManager.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef CONMANAGER_H
 #define CONMANAGER_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/dataItem.C b/source/APPLICATIONS/QuEasyViz/dataItem.C
index 0a708fa..3350987 100644
--- a/source/APPLICATIONS/QuEasyViz/dataItem.C
+++ b/source/APPLICATIONS/QuEasyViz/dataItem.C
@@ -1,23 +1,3 @@
-/* dataItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <dataItem.h>
 #include <edge.h>
 #include <mainWindow.h>
@@ -497,4 +477,4 @@ namespace BALL
 			return result;
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/dataItem.h b/source/APPLICATIONS/QuEasyViz/dataItem.h
index 9b81032..c920294 100644
--- a/source/APPLICATIONS/QuEasyViz/dataItem.h
+++ b/source/APPLICATIONS/QuEasyViz/dataItem.h
@@ -1,23 +1,3 @@
-/* dataItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef DATAITEM_H
 #define DATAITEM_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/dataItemScene.C b/source/APPLICATIONS/QuEasyViz/dataItemScene.C
index d43f10b..181070a 100644
--- a/source/APPLICATIONS/QuEasyViz/dataItemScene.C
+++ b/source/APPLICATIONS/QuEasyViz/dataItemScene.C
@@ -1,23 +1,3 @@
-/* dataItemScene.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <dataItemScene.h>
 #include <edge.h>
 #include <mainWindow.h>
@@ -764,4 +744,4 @@ namespace BALL
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/dataItemScene.h b/source/APPLICATIONS/QuEasyViz/dataItemScene.h
index 86a7e06..40974b4 100644
--- a/source/APPLICATIONS/QuEasyViz/dataItemScene.h
+++ b/source/APPLICATIONS/QuEasyViz/dataItemScene.h
@@ -1,23 +1,3 @@
-/* dataItemScene.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef DATAITEMSCENE_H
 #define DATAITEMSCENE_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/dataItemView.C b/source/APPLICATIONS/QuEasyViz/dataItemView.C
index f6da969..0179f27 100644
--- a/source/APPLICATIONS/QuEasyViz/dataItemView.C
+++ b/source/APPLICATIONS/QuEasyViz/dataItemView.C
@@ -1,23 +1,3 @@
-/* dataItemView.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <dataItemView.h>
 #include <edge.h>
 #include <dataItem.h>
diff --git a/source/APPLICATIONS/QuEasyViz/dataItemView.h b/source/APPLICATIONS/QuEasyViz/dataItemView.h
index 2b95aef..35c4cc1 100644
--- a/source/APPLICATIONS/QuEasyViz/dataItemView.h
+++ b/source/APPLICATIONS/QuEasyViz/dataItemView.h
@@ -1,23 +1,3 @@
-/* dataItemView.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef DATAITEMVIEW_H
 #define DATAITEMVIEW_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/dottedEdge.C b/source/APPLICATIONS/QuEasyViz/dottedEdge.C
index bafb743..8f0168c 100644
--- a/source/APPLICATIONS/QuEasyViz/dottedEdge.C
+++ b/source/APPLICATIONS/QuEasyViz/dottedEdge.C
@@ -1,23 +1,3 @@
-/* dottedEdge.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <dottedEdge.h>
 #include <dataItem.h>
 
@@ -90,4 +70,4 @@ namespace BALL
 			return dest_position_;
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/dottedEdge.h b/source/APPLICATIONS/QuEasyViz/dottedEdge.h
index 65c499a..6fb3897 100644
--- a/source/APPLICATIONS/QuEasyViz/dottedEdge.h
+++ b/source/APPLICATIONS/QuEasyViz/dottedEdge.h
@@ -1,23 +1,3 @@
-/* dottedEdge.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef DEDGE_H
 #define DEDGE_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/edge.C b/source/APPLICATIONS/QuEasyViz/edge.C
index 47c6741..e73de6d 100644
--- a/source/APPLICATIONS/QuEasyViz/edge.C
+++ b/source/APPLICATIONS/QuEasyViz/edge.C
@@ -1,23 +1,3 @@
-/* edge.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <edge.h>
 #include <dataItem.h>
 
diff --git a/source/APPLICATIONS/QuEasyViz/edge.h b/source/APPLICATIONS/QuEasyViz/edge.h
index 9ffa6be..12572ab 100644
--- a/source/APPLICATIONS/QuEasyViz/edge.h
+++ b/source/APPLICATIONS/QuEasyViz/edge.h
@@ -1,22 +1,3 @@
-/* edge.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #ifndef EDGE_H
 #define EDGE_H
diff --git a/source/APPLICATIONS/QuEasyViz/exception.C b/source/APPLICATIONS/QuEasyViz/exception.C
index 788cf0a..5240aa8 100644
--- a/source/APPLICATIONS/QuEasyViz/exception.C
+++ b/source/APPLICATIONS/QuEasyViz/exception.C
@@ -1,23 +1,3 @@
-/* exception.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/APPLICATIONS/QuEasyViz/exception.h b/source/APPLICATIONS/QuEasyViz/exception.h
index f0da0d0..bb9a998 100644
--- a/source/APPLICATIONS/QuEasyViz/exception.h
+++ b/source/APPLICATIONS/QuEasyViz/exception.h
@@ -1,23 +1,3 @@
-/* exception.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/APPLICATIONS/QuEasyViz/featurePlotter.C b/source/APPLICATIONS/QuEasyViz/featurePlotter.C
index ebc4293..e27c372 100644
--- a/source/APPLICATIONS/QuEasyViz/featurePlotter.C
+++ b/source/APPLICATIONS/QuEasyViz/featurePlotter.C
@@ -1,23 +1,3 @@
-/* featurePlotter.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/VIEW/KERNEL/iconLoader.h>
 
 #include <featurePlotter.h>
diff --git a/source/APPLICATIONS/QuEasyViz/featurePlotter.h b/source/APPLICATIONS/QuEasyViz/featurePlotter.h
index 209dc41..f7d650c 100644
--- a/source/APPLICATIONS/QuEasyViz/featurePlotter.h
+++ b/source/APPLICATIONS/QuEasyViz/featurePlotter.h
@@ -1,23 +1,3 @@
-/* featurePlotter.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef FEATURE_PLOTTER
 #define FEATURE_PLOTTER
 
diff --git a/source/APPLICATIONS/QuEasyViz/featureSelectionDialog.C b/source/APPLICATIONS/QuEasyViz/featureSelectionDialog.C
index c9799c3..a222b0c 100644
--- a/source/APPLICATIONS/QuEasyViz/featureSelectionDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/featureSelectionDialog.C
@@ -1,23 +1,3 @@
-/* featureSelectionDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <featureSelectionDialog.h>
 #include <iostream>
 #include <BALL/QSAR/exception.h>
@@ -196,4 +176,4 @@ namespace BALL
 			return k_;
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/featureSelectionDialog.h b/source/APPLICATIONS/QuEasyViz/featureSelectionDialog.h
index a7b76df..2c5321f 100644
--- a/source/APPLICATIONS/QuEasyViz/featureSelectionDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/featureSelectionDialog.h
@@ -1,23 +1,3 @@
-/* featureSelectionDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef FSDIALOG_H
 #define FSDIALOG_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/featureSelectionItem.C b/source/APPLICATIONS/QuEasyViz/featureSelectionItem.C
index 18b4a59..1b3ef1e 100644
--- a/source/APPLICATIONS/QuEasyViz/featureSelectionItem.C
+++ b/source/APPLICATIONS/QuEasyViz/featureSelectionItem.C
@@ -1,23 +1,3 @@
-/* featureSelectionItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/VIEW/KERNEL/iconLoader.h>
 #include <BALL/QSAR/exception.h>
 
@@ -154,7 +134,7 @@ namespace BALL
 			view_->data_scene->addItem(edge2);
 			
 			setSavedAs(conf.output.c_str());
-			filenames_map.insert(make_pair(conf.output,model_item_));
+			filenames_map.insert(std::make_pair(conf.output,model_item_));
 			setPixmap(findPixmap("feature_selection"));
 			
 			done_ = 0;
diff --git a/source/APPLICATIONS/QuEasyViz/featureSelectionItem.h b/source/APPLICATIONS/QuEasyViz/featureSelectionItem.h
index c624612..587449b 100644
--- a/source/APPLICATIONS/QuEasyViz/featureSelectionItem.h
+++ b/source/APPLICATIONS/QuEasyViz/featureSelectionItem.h
@@ -1,23 +1,3 @@
-/* featureSelectionItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef FEATURESELECTIONITEM_H
 #define FEATURESELECTIONITEM_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/fileBrowser.C b/source/APPLICATIONS/QuEasyViz/fileBrowser.C
index 382ad21..0aa432a 100644
--- a/source/APPLICATIONS/QuEasyViz/fileBrowser.C
+++ b/source/APPLICATIONS/QuEasyViz/fileBrowser.C
@@ -1,23 +1,3 @@
-/* fileBrowser.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/VIEW/KERNEL/iconLoader.h>
 #include <fileBrowser.h>
 #include <QtGui/QHeaderView>
diff --git a/source/APPLICATIONS/QuEasyViz/fileBrowser.h b/source/APPLICATIONS/QuEasyViz/fileBrowser.h
index 340dc0f..1e4dd35 100644
--- a/source/APPLICATIONS/QuEasyViz/fileBrowser.h
+++ b/source/APPLICATIONS/QuEasyViz/fileBrowser.h
@@ -1,23 +1,3 @@
-/* fileBrowser.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef FILEBROWSER_H
 #define FILEBROWSER_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/inputDataDialog.C b/source/APPLICATIONS/QuEasyViz/inputDataDialog.C
index 685914a..083a6df 100644
--- a/source/APPLICATIONS/QuEasyViz/inputDataDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/inputDataDialog.C
@@ -3,26 +3,6 @@
 		Necessary for lupdate.
 */
 
-/* inputDataDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <inputDataDialog.h>
 
 #include <QtGui/QDialogButtonBox>
diff --git a/source/APPLICATIONS/QuEasyViz/inputDataDialog.h b/source/APPLICATIONS/QuEasyViz/inputDataDialog.h
index 8817fbb..e41127d 100644
--- a/source/APPLICATIONS/QuEasyViz/inputDataDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/inputDataDialog.h
@@ -1,23 +1,3 @@
-/* inputDataDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef DATADIALOG_H
 #define DATADIALOG_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/inputDataItem.C b/source/APPLICATIONS/QuEasyViz/inputDataItem.C
index 995d13b..c7786aa 100644
--- a/source/APPLICATIONS/QuEasyViz/inputDataItem.C
+++ b/source/APPLICATIONS/QuEasyViz/inputDataItem.C
@@ -3,26 +3,6 @@
 		Necessary for lupdate.
 */
 
-/* inputDataItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <inputDataItem.h>
 #include <mainWindow.h>
 
diff --git a/source/APPLICATIONS/QuEasyViz/inputDataItem.h b/source/APPLICATIONS/QuEasyViz/inputDataItem.h
index be5f64e..d634917 100644
--- a/source/APPLICATIONS/QuEasyViz/inputDataItem.h
+++ b/source/APPLICATIONS/QuEasyViz/inputDataItem.h
@@ -1,23 +1,3 @@
-/* inputDataItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef INPUTDATAITEM_H
 #define INPUTDATAITEM_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/inputDataItemIO.C b/source/APPLICATIONS/QuEasyViz/inputDataItemIO.C
index 6311473..7c00dcd 100644
--- a/source/APPLICATIONS/QuEasyViz/inputDataItemIO.C
+++ b/source/APPLICATIONS/QuEasyViz/inputDataItemIO.C
@@ -1,23 +1,3 @@
-/* inputDataItemIO.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <inputDataItemIO.h>
 #include <mainWindow.h>
 #include <BALL/QSAR/configIO.h>
@@ -163,7 +143,7 @@ namespace BALL
 				InputPartitionItem* train_part = new InputPartitionItem(0,partitioner);
 				view_->scene()->addItem(train_part);
 				train_part->addToPipeline();
-				filenames_map.insert(make_pair(train_part->savedAs().toStdString(),train_part));
+				filenames_map.insert(std::make_pair(train_part->savedAs().toStdString(),train_part));
 				if(item_positions!=0 && item_positions->size()>0)
 				{
 					std::pair<double,double> pos = item_positions->front();
@@ -176,7 +156,7 @@ namespace BALL
 				InputPartitionItem* test_part = new InputPartitionItem(1,partitioner);
 				view_->scene()->addItem(test_part);
 				test_part->addToPipeline();
-				filenames_map.insert(make_pair(test_part->savedAs().toStdString(),test_part));
+				filenames_map.insert(std::make_pair(test_part->savedAs().toStdString(),test_part));
 				if(item_positions!=0 && item_positions->size()>0)
 				{
 					std::pair<double,double> pos = item_positions->front();
@@ -242,7 +222,7 @@ namespace BALL
 				{
 					QMessageBox::critical(view_,"Error reading SD-input",e.getMessage());
 				}
-				filenames_map.insert(make_pair(conf.output,sd_item));
+				filenames_map.insert(std::make_pair(conf.output,sd_item));
 			}
 
 			try
@@ -279,7 +259,7 @@ namespace BALL
 						csv_item->setAppend(false);
 						csv_item->setCenterDataFlag(conf.center_data);
 						csv_item->setCenterResponseFlag(conf.center_y);
-						if(i==0) filenames_map.insert(make_pair(conf.output,csv_item));
+						if(i==0) filenames_map.insert(std::make_pair(conf.output,csv_item));
 					}
 					csv_item->setNonNumericClassNames(conf.nonnumeric_class_names);
 					csv_item->setXLabelFlag(conf.csv_desc_labels[i]);
@@ -310,4 +290,4 @@ namespace BALL
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/inputDataItemIO.h b/source/APPLICATIONS/QuEasyViz/inputDataItemIO.h
index f287184..e0766ae 100644
--- a/source/APPLICATIONS/QuEasyViz/inputDataItemIO.h
+++ b/source/APPLICATIONS/QuEasyViz/inputDataItemIO.h
@@ -1,22 +1,3 @@
-/* inputDataItemIO.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #ifndef INPUTDATAITEMIO_H
 #define INPUTDATAITEMIO_H
diff --git a/source/APPLICATIONS/QuEasyViz/inputDialog.C b/source/APPLICATIONS/QuEasyViz/inputDialog.C
index 7ced3b8..d07456c 100644
--- a/source/APPLICATIONS/QuEasyViz/inputDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/inputDialog.C
@@ -1,23 +1,3 @@
-/* inputDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <SDFInputDialog.h>
 #include <BALL/QSAR/exception.h>
 #include <QtGui/QMessageBox>
diff --git a/source/APPLICATIONS/QuEasyViz/inputDialog.h b/source/APPLICATIONS/QuEasyViz/inputDialog.h
index c474636..39d5ea6 100644
--- a/source/APPLICATIONS/QuEasyViz/inputDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/inputDialog.h
@@ -1,23 +1,3 @@
-/* inputDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef SDFInputDialog_H
 #define SDFInputDialog_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/inputPartitionItem.C b/source/APPLICATIONS/QuEasyViz/inputPartitionItem.C
index 2f04c03..dfab2f4 100644
--- a/source/APPLICATIONS/QuEasyViz/inputPartitionItem.C
+++ b/source/APPLICATIONS/QuEasyViz/inputPartitionItem.C
@@ -1,22 +1,3 @@
-/* inputPartitionItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #include <BALL/VIEW/KERNEL/iconLoader.h>
 #include <inputPartitionItem.h>
diff --git a/source/APPLICATIONS/QuEasyViz/inputPartitionItem.h b/source/APPLICATIONS/QuEasyViz/inputPartitionItem.h
index e971476..0a8bbc9 100644
--- a/source/APPLICATIONS/QuEasyViz/inputPartitionItem.h
+++ b/source/APPLICATIONS/QuEasyViz/inputPartitionItem.h
@@ -1,22 +1,3 @@
-/* inputPartitionItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #ifndef INPUTPARTDATAITEM_H
 #define INPUTPARTDATAITEM_H
diff --git a/source/APPLICATIONS/QuEasyViz/inputPlotter.C b/source/APPLICATIONS/QuEasyViz/inputPlotter.C
index 785c620..f484ce6 100644
--- a/source/APPLICATIONS/QuEasyViz/inputPlotter.C
+++ b/source/APPLICATIONS/QuEasyViz/inputPlotter.C
@@ -1,23 +1,3 @@
-/* inputPlotter.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <inputPlotter.h>
 
 #include <qwt_plot_marker.h>
diff --git a/source/APPLICATIONS/QuEasyViz/inputPlotter.h b/source/APPLICATIONS/QuEasyViz/inputPlotter.h
index 9cea4c5..f79b5cc 100644
--- a/source/APPLICATIONS/QuEasyViz/inputPlotter.h
+++ b/source/APPLICATIONS/QuEasyViz/inputPlotter.h
@@ -1,23 +1,3 @@
-/* inputPlotter.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef INPUT_PLOTTER
 #define INPUT_PLOTTER
 
diff --git a/source/APPLICATIONS/QuEasyViz/main.C b/source/APPLICATIONS/QuEasyViz/main.C
index 51dce51..9f08a0e 100644
--- a/source/APPLICATIONS/QuEasyViz/main.C
+++ b/source/APPLICATIONS/QuEasyViz/main.C
@@ -1,22 +1,3 @@
-/* main.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #include <QtGui/QApplication>
 #include <BALL/COMMON/global.h>
diff --git a/source/APPLICATIONS/QuEasyViz/mainWindow.C b/source/APPLICATIONS/QuEasyViz/mainWindow.C
index 07581f0..c6ac5ac 100644
--- a/source/APPLICATIONS/QuEasyViz/mainWindow.C
+++ b/source/APPLICATIONS/QuEasyViz/mainWindow.C
@@ -3,26 +3,6 @@
 		Necessary for lupdate.
 */
 
-/* mainWindow.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <mainWindow.h>
 #include <BALL/QSAR/exception.h>
 #include <exception.h>
@@ -1871,8 +1851,8 @@ namespace BALL
 					std::cout << "Error: feature-description file '" << abs_filename << "' not found!" << std::endl;
 					return;
 				}
-				string name;
-				string explanation;
+				String name;
+				String explanation;
 				while(in)
 				{
 					String line; 
diff --git a/source/APPLICATIONS/QuEasyViz/mainWindow.h b/source/APPLICATIONS/QuEasyViz/mainWindow.h
index 9b0263d..1952d3b 100644
--- a/source/APPLICATIONS/QuEasyViz/mainWindow.h
+++ b/source/APPLICATIONS/QuEasyViz/mainWindow.h
@@ -1,22 +1,3 @@
-/* mainWindow.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
diff --git a/source/APPLICATIONS/QuEasyViz/modelConfigurationDialog.C b/source/APPLICATIONS/QuEasyViz/modelConfigurationDialog.C
index b3acbfc..203fd2a 100644
--- a/source/APPLICATIONS/QuEasyViz/modelConfigurationDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/modelConfigurationDialog.C
@@ -3,33 +3,12 @@
 		Necessary for lupdate.
 */
 
-/* modelConfigurationDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <modelConfigurationDialog.h>
 #include <BALL/QSAR/exception.h>
 #include <exception.h>
 #include <BALL/MATHS/parsedFunction.h>
 #include <BALL/VIEW/KERNEL/iconLoader.h>
 
-
 #include <QtGui/QLabel>
 #include <QtGui/QGroupBox>
 #include <QtGui/QComboBox>
diff --git a/source/APPLICATIONS/QuEasyViz/modelConfigurationDialog.h b/source/APPLICATIONS/QuEasyViz/modelConfigurationDialog.h
index 54a3b22..1384fa8 100644
--- a/source/APPLICATIONS/QuEasyViz/modelConfigurationDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/modelConfigurationDialog.h
@@ -1,22 +1,3 @@
-/* modelConfigurationDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #ifndef CONFIGDIALOG_H
 #define CONFIGDIALOG_H
diff --git a/source/APPLICATIONS/QuEasyViz/modelConfigurationDialogPages.C b/source/APPLICATIONS/QuEasyViz/modelConfigurationDialogPages.C
index 055c104..c636615 100644
--- a/source/APPLICATIONS/QuEasyViz/modelConfigurationDialogPages.C
+++ b/source/APPLICATIONS/QuEasyViz/modelConfigurationDialogPages.C
@@ -3,26 +3,6 @@
 		Necessary for lupdate.
 */
 
-/* modelConfigurationDialogPages.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <modelConfigurationDialogPages.h>
 #include <QtGui/QLabel>
 #include <QtGui/QHBoxLayout>
diff --git a/source/APPLICATIONS/QuEasyViz/modelConfigurationDialogPages.h b/source/APPLICATIONS/QuEasyViz/modelConfigurationDialogPages.h
index 53fb4b7..aa95687 100644
--- a/source/APPLICATIONS/QuEasyViz/modelConfigurationDialogPages.h
+++ b/source/APPLICATIONS/QuEasyViz/modelConfigurationDialogPages.h
@@ -1,23 +1,3 @@
-/* modelConfigurationDialogPages.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef PAGES_H
 #define PAGES_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/modelItem.C b/source/APPLICATIONS/QuEasyViz/modelItem.C
index 40313ee..77e1e28 100644
--- a/source/APPLICATIONS/QuEasyViz/modelItem.C
+++ b/source/APPLICATIONS/QuEasyViz/modelItem.C
@@ -3,26 +3,6 @@
 		Necessary for lupdate.
 */
 
-/* modelItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <modelItem.h>
 #include <QtGui/QDrag>
 #include <QtCore/QMimeData>
@@ -304,7 +284,7 @@ namespace BALL
 			save_attribute_ = 1;
 			setName(QString(entry_->name_abreviation.c_str()));
 			
-			filenames_map.insert(make_pair(conf.output,this));
+			filenames_map.insert(std::make_pair(conf.output,this));
 			setSavedAs(conf.output.c_str());
 		}
 
diff --git a/source/APPLICATIONS/QuEasyViz/modelItem.h b/source/APPLICATIONS/QuEasyViz/modelItem.h
index 0e569e6..a6d9d3c 100644
--- a/source/APPLICATIONS/QuEasyViz/modelItem.h
+++ b/source/APPLICATIONS/QuEasyViz/modelItem.h
@@ -1,22 +1,3 @@
-/* modelItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #ifndef MODELITEM_H
 #define MODELITEM_H
diff --git a/source/APPLICATIONS/QuEasyViz/modelPropertiesDialog.C b/source/APPLICATIONS/QuEasyViz/modelPropertiesDialog.C
index da387ec..44228ac 100644
--- a/source/APPLICATIONS/QuEasyViz/modelPropertiesDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/modelPropertiesDialog.C
@@ -3,27 +3,6 @@
 		Necessary for lupdate.
 */
 
-
-/* modelPropertiesDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <modelPropertiesDialog.h>
 #include <QtGui/QPushButton>
 #include <QtGui/QMessageBox>
diff --git a/source/APPLICATIONS/QuEasyViz/modelPropertiesDialog.h b/source/APPLICATIONS/QuEasyViz/modelPropertiesDialog.h
index 9ba6a65..5693260 100644
--- a/source/APPLICATIONS/QuEasyViz/modelPropertiesDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/modelPropertiesDialog.h
@@ -1,23 +1,3 @@
-/* modelPropertiesDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef MODELPROPERTIESDIALOG_H
 #define MODELPROPERTIESDIALOG_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/partitioningItem.C b/source/APPLICATIONS/QuEasyViz/partitioningItem.C
index 93e3311..bd777d6 100644
--- a/source/APPLICATIONS/QuEasyViz/partitioningItem.C
+++ b/source/APPLICATIONS/QuEasyViz/partitioningItem.C
@@ -1,23 +1,3 @@
-/* partitioningItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <partitioningItem.h>
 #include <exception.h>
 #include <mainWindow.h>
diff --git a/source/APPLICATIONS/QuEasyViz/partitioningItem.h b/source/APPLICATIONS/QuEasyViz/partitioningItem.h
index e9a0f6d..bfc4f0c 100644
--- a/source/APPLICATIONS/QuEasyViz/partitioningItem.h
+++ b/source/APPLICATIONS/QuEasyViz/partitioningItem.h
@@ -1,23 +1,3 @@
-/* partitioningItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef PARTITIONINGITEM_H
 #define PARTITIONINGITEM_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/pipeline.C b/source/APPLICATIONS/QuEasyViz/pipeline.C
index 4af35a5..866205f 100644
--- a/source/APPLICATIONS/QuEasyViz/pipeline.C
+++ b/source/APPLICATIONS/QuEasyViz/pipeline.C
@@ -1,22 +1,3 @@
-/* pipeline.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 #include <pipeline.h>
 
diff --git a/source/APPLICATIONS/QuEasyViz/pipeline.h b/source/APPLICATIONS/QuEasyViz/pipeline.h
index 1a56a85..9d88533 100644
--- a/source/APPLICATIONS/QuEasyViz/pipeline.h
+++ b/source/APPLICATIONS/QuEasyViz/pipeline.h
@@ -1,23 +1,3 @@
-/* pipeline.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef PIPELINE_H 
 #define PIPELINE_H 
 
diff --git a/source/APPLICATIONS/QuEasyViz/plotter.C b/source/APPLICATIONS/QuEasyViz/plotter.C
index a7c4ae3..7b98986 100644
--- a/source/APPLICATIONS/QuEasyViz/plotter.C
+++ b/source/APPLICATIONS/QuEasyViz/plotter.C
@@ -3,27 +3,6 @@
 		Necessary for lupdate.
 */
 
-
-/* plotter.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <plotter.h>
 #include <iostream>
 #include <QPrinter>
diff --git a/source/APPLICATIONS/QuEasyViz/plotter.h b/source/APPLICATIONS/QuEasyViz/plotter.h
index ec2dfa2..5977fbb 100644
--- a/source/APPLICATIONS/QuEasyViz/plotter.h
+++ b/source/APPLICATIONS/QuEasyViz/plotter.h
@@ -1,23 +1,3 @@
-/* plotter.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef PLOTTER_H
 #define PLOTTER_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/predictionItem.C b/source/APPLICATIONS/QuEasyViz/predictionItem.C
index eb6541a..b10b7ea 100644
--- a/source/APPLICATIONS/QuEasyViz/predictionItem.C
+++ b/source/APPLICATIONS/QuEasyViz/predictionItem.C
@@ -3,27 +3,6 @@
 		Necessary for lupdate.
 */
 
-
-/* predictionItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <predictionItem.h>
 #include <exception.h>
 #include <mainWindow.h>
diff --git a/source/APPLICATIONS/QuEasyViz/predictionItem.h b/source/APPLICATIONS/QuEasyViz/predictionItem.h
index abdfdd6..bfcb8ac 100644
--- a/source/APPLICATIONS/QuEasyViz/predictionItem.h
+++ b/source/APPLICATIONS/QuEasyViz/predictionItem.h
@@ -1,23 +1,3 @@
-/* predictionItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef PREDICTIONITEM_H
 #define PREDICTIONITEM_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/predictionPlotter.C b/source/APPLICATIONS/QuEasyViz/predictionPlotter.C
index 2c0bc11..f135f44 100644
--- a/source/APPLICATIONS/QuEasyViz/predictionPlotter.C
+++ b/source/APPLICATIONS/QuEasyViz/predictionPlotter.C
@@ -1,23 +1,3 @@
-/* predictionPlotter.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <predictionPlotter.h>
 #include <validationItem.h>
 #include <predictionItem.h>
@@ -455,4 +435,4 @@ namespace BALL
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/predictionPlotter.h b/source/APPLICATIONS/QuEasyViz/predictionPlotter.h
index e5039d0..04c93d4 100644
--- a/source/APPLICATIONS/QuEasyViz/predictionPlotter.h
+++ b/source/APPLICATIONS/QuEasyViz/predictionPlotter.h
@@ -1,23 +1,3 @@
-/* predictionPlotter.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef PRED_PLOTTER
 #define PRED_PLOTTER
 
diff --git a/source/APPLICATIONS/QuEasyViz/predictionResultDialog.C b/source/APPLICATIONS/QuEasyViz/predictionResultDialog.C
index e932d20..6b84839 100644
--- a/source/APPLICATIONS/QuEasyViz/predictionResultDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/predictionResultDialog.C
@@ -3,28 +3,6 @@
 		Necessary for lupdate.
 */
 
-
-/* predictionResultDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-
 #include <predictionResultDialog.h>
 #include <mainWindow.h>
 
diff --git a/source/APPLICATIONS/QuEasyViz/predictionResultDialog.h b/source/APPLICATIONS/QuEasyViz/predictionResultDialog.h
index f216001..7d9dfbc 100644
--- a/source/APPLICATIONS/QuEasyViz/predictionResultDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/predictionResultDialog.h
@@ -1,23 +1,3 @@
-/* predictionResultDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef PREDDIALOG_H
 #define PREDDIALOG_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/validationDialog.C b/source/APPLICATIONS/QuEasyViz/validationDialog.C
index f5aa661..bc141fd 100644
--- a/source/APPLICATIONS/QuEasyViz/validationDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/validationDialog.C
@@ -1,23 +1,3 @@
-/* validationDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <validationDialog.h>
 #include <exception.h>
 #include <mainWindow.h>
@@ -217,4 +197,4 @@ namespace BALL
 			return k_;
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/source/APPLICATIONS/QuEasyViz/validationDialog.h b/source/APPLICATIONS/QuEasyViz/validationDialog.h
index a6cf350..9e00055 100644
--- a/source/APPLICATIONS/QuEasyViz/validationDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/validationDialog.h
@@ -1,24 +1,3 @@
-/* validationDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-
 #ifndef VALDIALOG_H
 #define VALDIALOG_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/validationItem.C b/source/APPLICATIONS/QuEasyViz/validationItem.C
index 26e0687..a654d66 100644
--- a/source/APPLICATIONS/QuEasyViz/validationItem.C
+++ b/source/APPLICATIONS/QuEasyViz/validationItem.C
@@ -2,28 +2,6 @@
 
 		Necessary for lupdate.
 */
-
-
-/* validationItem.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <validationItem.h>
 #include <exception.h>
 #include <mainWindow.h>
diff --git a/source/APPLICATIONS/QuEasyViz/validationItem.h b/source/APPLICATIONS/QuEasyViz/validationItem.h
index 000deb7..187f733 100644
--- a/source/APPLICATIONS/QuEasyViz/validationItem.h
+++ b/source/APPLICATIONS/QuEasyViz/validationItem.h
@@ -1,23 +1,3 @@
-/* validationItem.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef VALIDATIONITEM_H
 #define VALIDATIONITEM_H
 
diff --git a/source/APPLICATIONS/QuEasyViz/validationResultDialog.C b/source/APPLICATIONS/QuEasyViz/validationResultDialog.C
index 30d74e3..79407f0 100644
--- a/source/APPLICATIONS/QuEasyViz/validationResultDialog.C
+++ b/source/APPLICATIONS/QuEasyViz/validationResultDialog.C
@@ -1,28 +1,3 @@
-/* TRANSLATOR BALL::QSAR
-
-		Necessary for lupdate.
-*/
-
-/* validationResultDialog.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <validationResultDialog.h>
 
 #include <QtGui/QDialogButtonBox>
diff --git a/source/APPLICATIONS/QuEasyViz/validationResultDialog.h b/source/APPLICATIONS/QuEasyViz/validationResultDialog.h
index aee1332..a6cbb14 100644
--- a/source/APPLICATIONS/QuEasyViz/validationResultDialog.h
+++ b/source/APPLICATIONS/QuEasyViz/validationResultDialog.h
@@ -1,23 +1,3 @@
-/* validationResultDialog.h
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #ifndef VALRESDIALOG_H
 #define VALRESDIALOG_H
 
diff --git a/source/APPLICATIONS/TOOLS/AddMissingAtoms.C b/source/APPLICATIONS/TOOLS/AddMissingAtoms.C
new file mode 100644
index 0000000..014c5a8
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/AddMissingAtoms.C
@@ -0,0 +1,100 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALL/FORMAT/molFileFactory.h>
+#include <BALL/FORMAT/commandlineParser.h>
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/MOLMEC/AMBER/amber.h>
+#include <BALL/MOLMEC/MINIMIZATION/conjugateGradient.h>
+#include <BALL/MOLMEC/COMMON/assignTypes.h>
+#include <BALL/KERNEL/selector.h>
+#include <BALL/STRUCTURE/defaultProcessors.h>
+#include <BALL/STRUCTURE/residueChecker.h>
+#include <BALL/STRUCTURE/fragmentDB.h>
+
+#include "version.h"
+
+using namespace BALL;
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+	CommandlineParser parpars("AddMissingAtoms", "add missing atoms to protein structures", VERSION, String(__DATE__), "Preparation");
+	parpars.registerParameter("i", "input file", INFILE, true);
+	parpars.registerParameter("o", "output file", OUTFILE, true);
+
+	parpars.setSupportedFormats("i","pdb");
+	parpars.setSupportedFormats("o","pdb,drf");
+	parpars.setOutputFormatSource("o","i");
+
+	parpars.registerFlag("opt_hyd", "optimize the positions of hydrogens", false);
+
+	String manual = "AddMissingAtoms tool allows you to missing atoms, i.e. hydrogens to a protein structure.\n\n Optional parameter is the optimize_hydrogens flag (-opt_hyd), which uses the AMBER force field to run a quick energy minization for all hydrogen atoms.\n\nOutput of this tool is one pdb-file containing the input protein structure with added atoms.";
+	parpars.setToolManual(manual);
+
+	parpars.parse(argc, argv);
+
+	PDBFile input(parpars.get("i"), ios::in);
+	//GenericMolFile* input = MolFileFactory::open(parpars.get("i"), ios::in);
+	//PDBFile* pdb_input = dynamic_cast<PDBFile*>(input);
+	if (!input)
+	{
+		Log.error() << "Cannot open PDB input file " << parpars.get("i") << endl;
+		return 2;
+	}
+
+	System S;
+	input >> S;
+	input.close();
+
+	FragmentDB fragdb("");
+
+	Log.disableOutput();
+	S.apply(fragdb.normalize_names);
+	S.apply(fragdb.add_hydrogens);
+	S.apply(fragdb.build_bonds);
+	Log.enableOutput();
+
+	if (parpars.has("opt_hyd") && parpars.get("opt_hyd").toBool())
+	{
+		AmberFF FF;
+
+		// we then select all hydrogens (element(H))
+		// using a specialized processor (Selector)
+		S.deselect();
+		FF.setup(S);
+		Selector selector("element(H)");
+		S.apply(selector);
+
+		// now we create a minimizer object that uses a conjugate 
+		// gradient algorithm to optimize the atom positions
+		ConjugateGradientMinimizer minimizer;
+
+		// calculate the total energy of the system
+		float initial_energy = FF.updateEnergy();
+		Log << "initial energy: " << initial_energy << " kJ/mol" << endl;
+
+		// initialize the minimizer and perform (up to)
+		// 1000 optimization steps
+		minimizer.setup(FF);
+		minimizer.setEnergyOutputFrequency(1);
+		minimizer.minimize(50);
+
+		// calculate the terminal energy and print it
+		float terminal_energy = FF.getEnergy();
+
+		Log << "energy before/after minimization: " << initial_energy << "/" << terminal_energy << " kJ/mol" << endl;
+	}
+
+	// write the optimized structure to a file whose
+	// name is given as the second command line argument
+	String outfile_name = String(parpars.get("o"));
+	PDBFile outfile(outfile_name, ios::out);
+	outfile << S;
+	outfile.close();
+
+	Log << "wrote file " << outfile_name << endl;
+}
+
+
diff --git a/source/APPLICATIONS/TOOLS/BindingDBCleaner.C b/source/APPLICATIONS/TOOLS/BindingDBCleaner.C
index a53fc19..4a6b7fb 100644
--- a/source/APPLICATIONS/TOOLS/BindingDBCleaner.C
+++ b/source/APPLICATIONS/TOOLS/BindingDBCleaner.C
@@ -53,8 +53,8 @@ int main(int argc, char* argv[])
 	Size no_invalid = 0;
 	for (Molecule* mol = input->read(); mol; mol = input->read(), total++)
 	{
-		bool found = 0;
-		bool prop_id = 0;
+        bool found = false;
+        int prop_id = 0;
 		int target_no = 1;
 
 		for (NamedPropertyIterator it = mol->beginNamedProperty();
@@ -96,26 +96,35 @@ int main(int argc, char* argv[])
 					if (use_IC50)
 					{
 						String name = "Enzymologic: pIC50 nM";
-						if (prop_id > 0) name += " "+String(prop_id);
+                        if (prop_id > 0)
+                        {
+                            name += " "+String(prop_id);
+                        }
 						mol->setProperty(name, -log10(value));
 					}
 					else if (use_Ki)
 					{
 						String name = "Enzymologic: pKi nM";
-						if (prop_id > 0) name += " "+String(prop_id);
+                        if (prop_id > 0)
+                        {
+                            name += " " + String(prop_id);
+                        }
 						mol->setProperty(name, -log10(value));
 					}
 
 					String name = "binding_free_energy";
-					if (prop_id > 0) name += " "+String(prop_id);
+                    if (prop_id > 0)
+                    {
+                        name += " " + String(prop_id);
+                    }
 					float free_energy = 1.987*298.15*log(1e-09*value)*4.184/1000;
 					mol->setProperty(name, free_energy);
 
 					// remove compounds with completely senseless binding-affinity data
 					if (free_energy > -125 && free_energy < 0 && !BALL::Maths::isNan(free_energy) && BALL::Maths::isFinite(free_energy))
 					{
-						found = 1;
-						prop_id++;
+                        found = true;
+                        prop_id++;
 						no_acitivities_found++;
 					}
 					break;
diff --git a/source/APPLICATIONS/TOOLS/BondOrderAssigner.C b/source/APPLICATIONS/TOOLS/BondOrderAssigner.C
index 1621a24..9926691 100644
--- a/source/APPLICATIONS/TOOLS/BondOrderAssigner.C
+++ b/source/APPLICATIONS/TOOLS/BondOrderAssigner.C
@@ -34,11 +34,17 @@ int main (int argc, char **argv)
 	// - description
 	// - Outputfile
 	// - required
-	parpars.registerParameter("o", "output mol2-file name for first solution", STRING, true, "", true);
+	parpars.registerParameter("o", "output mol2-file name for first solution", OUTFILE, true, "", true);
 
-	parpars.registerParameter("o_id", "output id", STRING, true, "", true);
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_id", "output id", GALAXY_OPT_OUTID, false, "$o.id", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_id");
 
-	parpars.registerParameter("o_dir", "output directory for 2nd to last solution", STRING, true, "", true);
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_dir", "output directory for 2nd to last solution", GALAXY_OPT_OUTDIR, false, "$__new_file_path__", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_dir");
 
 	// register String parameter for supplying max number of solutions
 	parpars.registerParameter("max_sol", "maximal number of assignments solutions to compute", INT, false, 25);
@@ -52,14 +58,15 @@ int main (int argc, char **argv)
 	//parpars.registerFlag("add_hyd", "add hydrogens as well", false);
 
 	// choice of penalty table 
-	parpars.registerParameter("scr_pen", "penalty table", STRING, false, "Antechamber");
+	parpars.registerParameter("scr_pen", "penalty table (Antechamber, BALL)", STRING, false, "Antechamber");
 	list<String> ini_files;
 	ini_files.push_back("Antechamber");
 	ini_files.push_back("BALL");
 	parpars.setParameterRestrictions("scr_pen", ini_files);
 
-  // the manual
-	String man = "This tool computes optimal and sub-optimal bond order assignments based on an atomic penalty function for a given ligand in mol2 file format.\n\nOptional parameters are the maximal number of solutions to be computed ('-max_sol'), the penalty table specifiying the atomic penalty rules ('-scr_pen'), a flag indicating if sub-optimal solutions should be computed as well ('-non_opt') and a flag indicating if hydrogens should be computed as well ('-add_hyd').\n\nOutput of this t [...]
+	// the manual
+	String man = String("This tool computes optimal and sub-optimal bond order assignments based on an atomic penalty function for a given ligand in mol2 file format.\n\nOptional parameters are the maximal number of solutions to be computed ('-max_sol'), the penalty table specifiying the atomic penalty rules ('-scr_pen'),and a flag indicating if sub-optimal solutions should be computed as well ('-non_opt')") + // and a flag indicating if hydrogens should be computed as well ('-add_hyd')
+	".\n\nOutput of this tool is a number of mol2 files each containing one bond order assignment.\n\nTo upload an input file please use the upload tool (Get Data -> Upload File).\n\n**Further information and help** can be found in our wiki http://ball-trac.bioinf.uni-sb.de/wiki/ballaxy/BOAConstructor_Help.\n\nPlease cite the following: Dehof, A.K., Rurainski, A., Bui, Q.B.A., Boecker, S., Lenhof, H.-P. & Hildebrandt, A. (2011). Automated Bond Order Assignment as an Optimization Problem. Bi [...]
 
 	parpars.setToolManual(man);
 
@@ -84,7 +91,7 @@ int main (int argc, char **argv)
 	if (parpars.has("max_sol"))
 	{
 		int max_sol = parpars.get("max_sol").toInt();
-		//cout << "   limit number of solutions to " << max_sol << endl;
+		Log << "  Limit number of solutions to " << max_sol << endl;
 		abop.options.setInteger(AssignBondOrderProcessor::Option::MAX_NUMBER_OF_SOLUTIONS, String(max_sol).toInt());
 	}
 
@@ -92,8 +99,8 @@ int main (int argc, char **argv)
 	if (parpars.has("non_opt"))
 	{
 		non_opt = parpars.get("non_opt").toBool();
-		//if (non_opt)
-		//	cout << "   Compute also non-optimal solutions." << endl;
+		if (non_opt)
+			Log << "  Compute also non-optimal solutions." << endl;
 		abop.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, non_opt);
 	}
 
@@ -108,17 +115,24 @@ int main (int argc, char **argv)
 	if (parpars.has("scr_pen"))
 	{
 		String penalty_table = parpars.get("scr_pen");
-		//cout << "   Use penalty table " << penalty_table << endl;
 		if (penalty_table == "Antechamber")
+		{
+			Log << "  Use Antechamber scoring function" << endl;
 			abop.options[AssignBondOrderProcessor::Option::INIFile] = "/bond_lengths/BondOrderGAFF.xml";
+		}
 		else
+		{
+			Log << "  Use BALL scoring function" << endl;
 			abop.options[AssignBondOrderProcessor::Option::INIFile] = "/bond_lengths/BondOrder.xml";
+		}
 	}
 
 	// set the solver
-	//abop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::A_STAR);
 	abop.options.set(AssignBondOrderProcessor::Option::ALGORITHM, AssignBondOrderProcessor::Algorithm::FPT);
-	abop.options.dump();
+	//Log << "parameters are: " << endl;
+	//abop.options.dump();
+	Log << "run ..." << endl;
+
 	system.apply(abop);
 	Size num_of_sols = abop.getNumberOfComputedSolutions();
 
@@ -129,25 +143,50 @@ int main (int argc, char **argv)
 	}
 	else
 	{
+		// called as command line or e.g. via galaxy?
+		bool is_cmd =    !parpars.has("env")
+			            || ((parpars.has("env") && parpars.get("env")=="cmdline"));
+
 		//Log << "Found " << num_of_sols << " solutions:" << endl;
 		for (Size i=0; (i<num_of_sols) && (non_opt || (abop.getTotalPenalty(0)==abop.getTotalPenalty(i))); i++)
 		{
-			Log << "   Solution " << i << " has penalty " << abop.getTotalPenalty(i) << endl;
+			Log << "   Solution " << i << " has penalty " << abop.getTotalPenalty(i) << " ... ";
 
 			// apply the solution
 			if (abop.apply(i))
 			{
-				String outfile_name = (i == 0) ? String(parpars.get("o"))
+				// create the output name
+				String outfile_name = String(parpars.get("o")) + "solution_" + String(i) + ".mol2";
+				if (parpars.has("o_dir") && is_cmd && (parpars.get("o_dir") != "$__new_file_path__"))
+				{
+					outfile_name =  String(parpars.get("o_dir")) + "/" + outfile_name;
+				}
+
+				// NOTE: Galaxy requires this strange naming convention 
+				//       including the fact, that zero-th element has a different name
+				if (!is_cmd)
+				{
+					outfile_name = (i == 0) ? String(parpars.get("o"))
 				                               :   String(parpars.get("o_dir")) + "/primary_"
 				                                 + String(parpars.get("o_id"))  + "_solution" + String(i)
 				                                 + "_visible_mol2";
+				}
 				//Log << "   Writing solution " << String(i) << " as " << outfile_name << endl;
 				//	GenericMolFile* outfile = MolFileFactory::open(outfile_name, ios::out);
 				MOL2File outfile(outfile_name, ios::out);
+
+				if (outfile.bad())
+				{
+					Log.error() << endl << "cannot write file " << outfile_name << endl;
+					return 2;
+				}
+
 				system.beginMolecule()->setProperty("BOA_Constructor_penalty", abop.getTotalPenalty(i));
 
 				outfile << system;
 				outfile.close();
+
+				Log << "wrote file " << outfile_name << endl;
 			}
 		}
 	}
diff --git a/source/APPLICATIONS/TOOLS/CMakeLists.txt b/source/APPLICATIONS/TOOLS/CMakeLists.txt
index bd69cbb..62c458f 100644
--- a/source/APPLICATIONS/TOOLS/CMakeLists.txt
+++ b/source/APPLICATIONS/TOOLS/CMakeLists.txt
@@ -18,9 +18,13 @@ SET(TOOLS_EXECUTABLES)
 INCLUDE(sources.cmake)
 
 FOREACH(i ${TOOLS_EXECUTABLES})
-	ADD_EXECUTABLE(${i} ${i}.C stringStub.C)
+	ADD_EXECUTABLE(${i} ${i}.C)
 	TARGET_LINK_LIBRARIES(${i} BALL)
 	SET_PROPERTY(TARGET ${i} PROPERTY FOLDER TOOLS)
+	INSTALL(TARGETS ${i}
+		COMPONENT "${COMPONENT_TOOLS}"
+		RUNTIME DESTINATION "${BALL_TOOLS_INSTALL_DIRECTORY}"
+	)
 ENDFOREACH(i)
 
 CONFIGURE_FILE(
diff --git a/source/APPLICATIONS/TOOLS/CalculateBindingFreeEnergy.C b/source/APPLICATIONS/TOOLS/CalculateBindingFreeEnergy.C
new file mode 100644
index 0000000..c87c974
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/CalculateBindingFreeEnergy.C
@@ -0,0 +1,126 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALL/MOLMEC/AMBER/amber.h>
+#include <BALL/STRUCTURE/fragmentDB.h>
+#include <BALL/ENERGY/atomicContactEnergy.h>
+#include <BALL/ENERGY/coulomb.h>
+#include <BALL/FORMAT/PDBFile.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+
+#include "version.h"
+
+using namespace std;
+using namespace BALL;
+
+int main(int argc, char* argv[])
+{
+	// instantiate CommandlineParser object
+	CommandlineParser parpars("CalculateBindingFreeEnergy", "calculate binding energy of two proteins using AMBER", VERSION, String(__DATE__), "ForceFields");
+	parpars.registerParameter("pdb_a",  "first input pdb file ", INFILE,  true);
+	parpars.registerParameter("pdb_b",  "second input pdb file ", INFILE,  true);
+
+	// the manual
+	String man = String("This tool computes the binding energy of two given pdb files using the AMBER force field.");
+
+	parpars.setToolManual(man);
+
+	parpars.setSupportedFormats("pdb_a", "pdb");
+	parpars.setSupportedFormats("pdb_b", "pdb");
+
+	// parse the command line
+	parpars.parse(argc, argv);
+
+
+	PDBFile pdb_a;
+	pdb_a.open(parpars.get("pdb_a"), std::ios::in);
+
+	if (!pdb_a)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("pdb_a") << " for input." << std::endl;
+		exit(2);
+	}
+
+	PDBFile pdb_b;
+	pdb_b.open(parpars.get("pdb_b"), std::ios::in);
+
+	if (!pdb_b)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("pdb_b") << " for output." << std::endl;
+		exit(2);
+	}
+
+	// read the contents of the file A into a system
+	System A;
+	pdb_a >> A;
+	pdb_a.close();
+
+	// read the contents of the file B into a system
+	System B;
+	pdb_b >> B;
+	pdb_b.close();
+
+	// normalize the names and build all bonds
+	FragmentDB db("");
+	A.apply(db.normalize_names);
+	A.apply(db.build_bonds);
+	B.apply(db.normalize_names);
+	B.apply(db.build_bonds);
+
+
+	// TODO: Ask ResidueChecker if everything is ok!
+
+
+	// calculate the atomic contact energies of A and B
+	// NOTE: these methods use BALL internal parameter files
+	float ACE_A = calculateACE(A);
+	float ACE_B = calculateACE(B);
+
+
+	// calculate the electrostatic energies of A and B
+	AmberFF amber;
+	amber.options[AmberFF::Option::ASSIGN_CHARGES] = true;
+	amber.options[AmberFF::Option::OVERWRITE_CHARGES] = true;
+	amber.setup(A);
+	amber.updateEnergy();
+	float ES_A = amber.getESEnergy();
+	float C_A = calculateCoulomb(A);
+	amber.setup(B);
+	amber.updateEnergy();
+	float ES_B = amber.getESEnergy();
+	float C_B = calculateCoulomb(B);
+
+	// finally, join the to systems into a single system
+	Log << "atoms in A:  " << A.countAtoms() << endl;
+	Log << "atoms in B:  " << B.countAtoms() << endl;
+	A.splice(B);
+	Log << "final atoms: " << A.countAtoms() << endl;
+	Log << "======================" << endl;
+	float ACE_AB = calculateACE(A);
+	amber.setup(A);
+	amber.updateEnergy();
+	float ES_AB = amber.getESEnergy();
+	float C_AB = calculateCoulomb(A);
+
+	// print the resulting energies
+	Log << "ES energy of A: " << ES_A << endl;
+	Log << "ES energy of B: " << ES_B << endl;
+	Log << "ES energy of AB:" << ES_AB << endl;
+	Log << "C energy of A: " << C_A << endl;
+	Log << "C energy of B: " << C_B << endl;
+	Log << "C energy of AB:" << C_AB << endl;
+	Log << "======================" << endl;
+	Log << "change in atomic contact energy on binding:   "
+       << (ACE_AB - ACE_A - ACE_B) << " kJ/mol" << endl;
+	Log << "change in electrostatic energy on binding:    "
+       << (ES_AB - ES_A - ES_B) << " kJ/mol" << endl;
+	Log << "total binding free energy:                     "
+			 << (ACE_AB - ACE_A - ACE_B) + (ES_AB - ES_A - ES_B) << " kJ/mol" << endl;
+
+	// done
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/CalculateEnergy.C b/source/APPLICATIONS/TOOLS/CalculateEnergy.C
new file mode 100644
index 0000000..5a35f5a
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/CalculateEnergy.C
@@ -0,0 +1,279 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+#include <BALL/MOLMEC/AMBER/amber.h>
+#include <BALL/MOLMEC/MMFF94/MMFF94.h>
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/STRUCTURE/fragmentDB.h>
+#include <BALL/STRUCTURE/residueChecker.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+
+#include "version.h"
+
+using namespace std;
+using namespace BALL;
+
+int main(int argc, char* argv[])
+{
+	// instantiate CommandlineParser object
+	CommandlineParser parpars("CalculateEnergy", "calculate free energy of a protein ", VERSION, String(__DATE__), "ForceFields");
+	parpars.registerParameter("pdb",  "input pdb file ", INFILE,  true);
+
+	// TODO: offer upload of a distinguished fragDB file?
+
+	// choice of force field
+	parpars.registerParameter("force_field", "force field (AMBER, MMFF94)", STRING, false, "AMBER");
+	list<String> force_fields;
+	force_fields.push_back("AMBER");
+	force_fields.push_back("MMFF94");
+	// TODO: shall we offer CHARM as well?
+	parpars.setParameterRestrictions("force_field", force_fields);
+
+	// TODO: shall we offer a force field parameter file upload?
+
+	// TODO: check the naming!
+	parpars.registerParameter("non_bond_cutoff",  "cutoff radius in calculations of nonbonded interactions", DOUBLE, false, 20.0);
+	parpars.registerParameter("elec_stat_cuton", "electrostatic cuton", DOUBLE, false, 13.0);
+	parpars.registerParameter("elec_stat_cutoff", "electrostatic cutoff", DOUBLE, false, 15.0);
+	parpars.registerFlag("dist_dep_dielec", "apply distance dependent dielectric constant", false);
+	// NOTE: assign is the default
+	//parpars.registerFlag("assign_typenames","automatically assign type names to the system", false);
+	//parpars.registerFlag("assign_types","automatically assign types to the system if missing", false);
+	//parpars.registerFlag("assign_charges", "automatically assign charges to the system if missing", false);
+	// TODO: if we only allow PDBFile to upload then from where do we get stuff to overwrite?? 
+	parpars.registerFlag("overwrite_types", "overwrite even non-empty type names", false);
+	parpars.registerFlag("overwrite_charges","overwrite even non-zero charges", false);
+
+	// the manual
+	String man = String("This tool computes the free energy of a pdb file using a specified force field (-force_field) and force field parameters (-non_bond_cutoff, -elec_stat_cuton ... ).");
+
+	parpars.setToolManual(man);
+
+	parpars.setSupportedFormats("pdb", "pdb");
+
+	// parse the command line
+	parpars.parse(argc, argv);
+
+
+	PDBFile pdb;
+	pdb.open(parpars.get("pdb"), std::ios::in);
+
+	if (!pdb)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("pdb") << " for input." << std::endl;
+		exit(2);
+	}
+
+	System sys;
+	pdb >> sys;
+	pdb.close();
+
+	// normalize the names and build all bonds
+	FragmentDB db("");
+	sys.apply(db.normalize_names);
+	sys.apply(db.build_bonds);
+
+	// check the structure
+	Log.info() << " checking residues..." << std::endl;
+	ResidueChecker rc(db);
+	sys.apply(rc);
+
+	if (!rc.getStatus())
+	{
+		Log.error() << "There are errors in the given structure. Use the ResidueChecker tool for further investigation." << std::endl;
+		exit(2);
+	}
+
+	// create a force field	
+	AmberFF* amber_force_field = NULL;
+	MMFF94*  mmff_force_field = NULL;
+	ForceField* force_field = NULL;
+
+	if (parpars.has("force_field"))
+	{
+		String penalty_table = parpars.get("force_field");
+		if (penalty_table == "AMBER")
+		{
+			amber_force_field = new AmberFF();
+			force_field = amber_force_field;
+			Log << " using the amber force field" << std::endl;
+		}
+		else if (penalty_table == "MMFF94")
+		{
+			mmff_force_field = new MMFF94();
+			force_field = mmff_force_field;
+			Log << " using the MMFF94 force field" << std::endl;
+		}
+		else
+		{
+			Log.error() << "Unknown force field " << parpars.get("force_field") << " Abort." << std::endl;
+			exit(2);
+		}
+	}
+
+	if (!amber_force_field && !mmff_force_field)
+	{
+		Log.error() << "Invalid force field. Abort." << std::endl;
+		exit(2);
+	}
+
+	// set the ff options according the parameters
+	float non_bonded_cutoff = 0;
+	if (parpars.has("non_bond_cutoff"))
+	{
+		non_bonded_cutoff = parpars.get("non_bond_cutoff").toFloat();
+
+		if (amber_force_field)
+		{
+			//TODO: something wents awfully wrong with the FF default options!
+//	cout  << "non_bond_cutoff " << amber_force_field->options.getReal(AmberFF::Option::NONBONDED_CUTOFF) << " "<< amber_force_field->options.getReal(AmberFF::Default::NONBONDED_CUTOFF)  << endl;
+			amber_force_field->options[AmberFF::Option::NONBONDED_CUTOFF] = non_bonded_cutoff;
+		}
+		else if (mmff_force_field)
+		{
+			mmff_force_field->options[MMFF94::Option::NONBONDED_CUTOFF] = non_bonded_cutoff;
+		}
+		Log << " used non bonded cutoff: " << non_bonded_cutoff << std::endl;
+	}
+
+	float elec_stat_cuton = 0;
+	if (parpars.has("elec_stat_cuton"))
+	{
+		elec_stat_cuton = parpars.get("elec_stat_cuton").toFloat();
+
+		if (amber_force_field)
+		{
+//	cout  << "elec_stat_cuton" << force_field->options[AmberFF::Option::ELECTROSTATIC_CUTON]  << endl;
+			amber_force_field->options[AmberFF::Option::ELECTROSTATIC_CUTON] = elec_stat_cuton;
+		}
+		else if (mmff_force_field)
+		{
+//	cout  << "elec_stat_cuton" << force_field->options[MMFF94::Option::ELECTROSTATIC_CUTON]  << endl;
+			mmff_force_field->options[MMFF94::Option::ELECTROSTATIC_CUTON] = elec_stat_cuton;
+		}
+		Log << " used electrostatic cuton: " << elec_stat_cuton << std::endl;
+	}
+
+	float elec_stat_cutoff = 0;
+	if (parpars.has("elec_stat_cutoff"))
+	{
+		elec_stat_cutoff = parpars.get("elec_stat_cutoff").toFloat();
+
+		if (amber_force_field)
+		{
+			amber_force_field->options[AmberFF::Option::ELECTROSTATIC_CUTOFF] = elec_stat_cutoff;
+		}
+		else if (mmff_force_field)
+		{
+			mmff_force_field->options[MMFF94::Option::ELECTROSTATIC_CUTOFF] = elec_stat_cutoff;
+		}
+		Log << " used electrostatic cutoff: " << elec_stat_cutoff << std::endl;
+	}
+
+	bool dist_dep_dielectric = true;
+	if (parpars.has("dist_dep_dielec"))
+	{
+		dist_dep_dielectric = parpars.get("dist_dep_dielec").toBool();
+
+		if (amber_force_field)
+		{
+			amber_force_field->options[AmberFF::Option::DISTANCE_DEPENDENT_DIELECTRIC] = dist_dep_dielectric;
+		}
+		else if (mmff_force_field)
+		{
+			mmff_force_field->options[MMFF94::Option::DISTANCE_DEPENDENT_DIELECTRIC] = dist_dep_dielectric;
+		}
+	}
+	Log << " distance dependent dielectric constant " << (dist_dep_dielectric ? "on" : "off") << std::endl;
+
+	// we handle ASSIGN_TYPES and ASSIGN_TYPENAMES together
+	bool assign_types = true;
+	if (parpars.has("assign_types"))
+	{
+		assign_types = parpars.get("assign_types").toBool();
+
+		if (amber_force_field)
+		{
+			amber_force_field->options[AmberFF::Option::ASSIGN_TYPENAMES] = assign_types;
+			amber_force_field->options[AmberFF::Option::ASSIGN_TYPES] = assign_types;
+		}
+		else if (mmff_force_field)
+		{
+			mmff_force_field->options[MMFF94::Option::ASSIGN_TYPENAMES] = assign_types;
+			mmff_force_field->options[MMFF94::Option::ASSIGN_TYPES] = assign_types;
+		}
+	}
+	Log << " assignment of missing types " << (assign_types ? "on" : "off") << std::endl;
+
+
+	bool overwrite_types = true;
+	if (parpars.has("overwrite_types"))
+	{
+		overwrite_types = parpars.get("overwrite_types").toBool();
+
+		if (amber_force_field)
+		{
+			amber_force_field->options[AmberFF::Option::OVERWRITE_TYPENAMES] = overwrite_types;
+		}
+		else if (mmff_force_field)
+		{
+			mmff_force_field->options[MMFF94::Option::OVERWRITE_TYPENAMES] = overwrite_types;
+		}
+	}
+	Log << " overwrite types " << (overwrite_types ? "on" : "off") << std::endl;
+
+
+	bool assign_charges = true;
+	if (parpars.has("assign_charges"))
+	{
+		assign_charges = parpars.get("assign_charges").toBool();
+
+		if (amber_force_field)
+		{
+			amber_force_field->options[AmberFF::Option::ASSIGN_CHARGES] = assign_charges;
+		}
+		else if (mmff_force_field)
+		{
+			mmff_force_field->options[MMFF94::Option::ASSIGN_CHARGES] = assign_charges;
+		}
+	}
+	Log << " assignment of missing charges " << (assign_charges ? "on" : "off") << std::endl;
+
+	bool overwrite_charges = true;
+	if (parpars.has("overwrite_charges"))
+	{
+		overwrite_charges = parpars.get("overwrite_charges").toBool();
+
+		if (amber_force_field)
+		{
+			amber_force_field->options[AmberFF::Option::OVERWRITE_CHARGES] = overwrite_charges;
+		}
+		else if (mmff_force_field)
+		{
+			mmff_force_field->options[MMFF94::Option::OVERWRITE_CHARGES] = overwrite_charges;
+		}
+	}
+	Log << " overwrite charges " << (overwrite_charges ? "on" : "off") << std::endl;
+
+	// setup the force field
+	Log.info() << " setting up the force field..." << endl;
+	force_field->setup(sys);
+
+	// setup successful?
+	if (   (force_field->getUnassignedAtoms().size() > 0)
+		  || !force_field->isValid())
+	{
+		Log.error() << "There are parameterless atoms in the structure. Use the ResidueChecker tool for further investigation." << std::endl;
+		exit(2);
+	}
+
+	// trigger the energy computations
+	force_field->updateEnergy();
+
+	// print the result
+	Log.info() << force_field->getResults() << endl;
+
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/CalculateSolvationFreeEnergy.C b/source/APPLICATIONS/TOOLS/CalculateSolvationFreeEnergy.C
new file mode 100644
index 0000000..e661aa9
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/CalculateSolvationFreeEnergy.C
@@ -0,0 +1,109 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+#include <BALL/MOLMEC/AMBER/amber.h>
+#include <BALL/SOLVATION/poissonBoltzmann.h>
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/STRUCTURE/defaultProcessors.h>
+#include <BALL/STRUCTURE/fragmentDB.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+
+#include "version.h"
+
+using namespace std;
+using namespace BALL;
+
+int main(int argc, char* argv[])
+{
+	FDPB fdpb;
+
+	// instantiate CommandlineParser object
+	CommandlineParser parpars("CalculateSolvationFreeEnergy", "calculate solvation free energy of a protein using AMBER ", VERSION, String(__DATE__), "ForceFields");
+	parpars.registerParameter("pdb",  "input pdb file ", INFILE,  true);
+	parpars.registerParameter("epsilon_medium", "dielectric constant in medium", DOUBLE, false,  fdpb.options.getReal(FDPB::Option::SOLVENT_DC));
+	parpars.registerParameter("epsilon_vacuum", "dielectric constant in vacuum", DOUBLE, false, 1);
+
+	// the manual
+	String man = String("This tool computes the solvation free energy of a pdb file using the Jackson-Sternberg approach (bonded energy using a force field and a non bonded energy (electrostatics only) by solving the Poisson-Boltzmann equation. Parameters are the dielectric constants for the medium (-epsilon_medium) and the vacuum (-epsilon_vacuum).");
+
+	parpars.setToolManual(man);
+
+	parpars.setSupportedFormats("pdb", "pdb");
+
+	// parse the command line
+	parpars.parse(argc, argv);
+
+
+	PDBFile pdb;
+	pdb.open(parpars.get("pdb"), std::ios::in);
+
+	if (!pdb)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("pdb") << " for input." << std::endl;
+		exit(2);
+	}
+
+	System sys;
+	pdb >> sys;
+	pdb.close();
+
+	// normalize the names and build all bonds
+	FragmentDB db("");
+	sys.apply(db.normalize_names);
+	sys.apply(db.build_bonds);
+
+	// TODO: Ask ResidueChecker if everything is ok! see tool CalculateEnergy
+
+	// create an AMBER force field without non-bonded interactions
+	AmberFF FF(sys);
+
+	// calculate the total energy
+	float total_energy = FF.updateEnergy();
+	//Log << FF.getResults() << std::endl;
+	//Log << "   total energy using force field evaluation: " << total_energy << " kJ/mol" << std::endl;
+
+	//Log << "removing non bonded energy terms ..." << std::endl;
+	FF.removeComponent("Amber NonBonded");
+
+	// calculate the internal energy (neglecting internal VdW interactions)
+	float internal_energy = FF.updateEnergy();
+	//Log << FF.getResults() << std::endl;
+	Log << "  internal energy: " << internal_energy << " kJ/mol" << std::endl;
+
+	// assign atom radii
+	AssignRadiusProcessor radius_processor("radii/PARSE.siz");
+	sys.apply(radius_processor);
+
+	// calculate the electrostatic part of the solvation energy	
+	//FDPB fdpb;
+
+	float dielectric_const = fdpb.options.getReal(FDPB::Option::SOLVENT_DC);
+	if (parpars.has("epsilon_medium"))
+		dielectric_const = parpars.get("epsilon_medium").toFloat();
+	fdpb.options[FDPB::Option::SOLVENT_DC] = dielectric_const;
+	Log << "... using dielectric constant in medium: " << fdpb.options[FDPB::Option::SOLVENT_DC].toFloat() << std::endl;
+
+	fdpb.setup(sys);
+	fdpb.solve();
+
+	float solvent_energy = fdpb.getEnergy();
+
+	dielectric_const = 1.0;
+	if (parpars.has("epsilon_vacuum"))
+		dielectric_const = parpars.get("epsilon_vacuum").toFloat();
+	fdpb.options[FDPB::Option::SOLVENT_DC] = dielectric_const;
+	Log << "... using dielectric constant in vacuum: " << fdpb.options[FDPB::Option::SOLVENT_DC].toFloat() << std::endl;
+
+	fdpb.setup(sys);
+	fdpb.solve();
+
+	float vacuum_energy = fdpb.getEnergy();
+	Log << "\n  electrostatic solvation free energy: "	<< solvent_energy - vacuum_energy << std::endl;
+
+	Log << "\n  total energy using a combination of force field and FDPB evaluation: "
+		  << internal_energy - vacuum_energy + solvent_energy << " kJ/mol" << std::endl;
+
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/Converter.C b/source/APPLICATIONS/TOOLS/Converter.C
index a842fbd..885a641 100755
--- a/source/APPLICATIONS/TOOLS/Converter.C
+++ b/source/APPLICATIONS/TOOLS/Converter.C
@@ -4,6 +4,7 @@
 
 #include <BALL/FORMAT/molFileFactory.h>
 #include <BALL/FORMAT/dockResultFile.h>
+#include <BALL/FORMAT/PDBFile.h>
 #include <BALL/KERNEL/molecule.h>
 #include <BALL/FORMAT/commandlineParser.h>
 #include "version.h"
@@ -11,19 +12,59 @@
 using namespace BALL;
 using namespace std;
 
+void validateParameters(CommandlineParser& params)
+{
+	String formats = MolFileFactory::getSupportedFormats();
+	vector<String> v;
+	formats.split(v,",");
+	
+	String input_format = params.get("if");
+	String output_format = params.get("of");
+	bool correct_input_format = false;
+	bool correct_output_format = false;
+	for (Size i=0; i<v.size(); i++)
+	{
+		if (input_format == v[i])
+		{
+			correct_input_format = true;
+		}
+		if (output_format == v[i])
+		{
+			correct_output_format = true;
+		}
+	}
+	if (!correct_input_format)
+	{
+		Log.error() << "Input file format " << input_format << " is not supported\nSupported formats are " << formats << endl;
+		exit(1);
+	}
+	
+	if (!correct_output_format)
+	{
+		Log.error() << "Output file format " << output_format << " is not supported\nSupported formats are " << formats << endl;
+		exit(1);
+	}
+}  
+
 int main(int argc, char* argv[])
 {
 	CommandlineParser parpars("Converter", "interconvert molecular file-formats", VERSION, String(__DATE__), "Convert, combine and store");
-	parpars.registerParameter("i", "input file", INFILE, true);
-	parpars.registerParameter("o", "output file", OUTFILE, true);
-	parpars.registerParameter("f", "output format", STRING);
+	parpars.registerParameter("i", "input filename", INFILE, true);
+	parpars.registerParameter("if", "input format", STRING, true);
+	parpars.registerParameter("o", "output filename", OUTFILE, true);
+	parpars.registerParameter("of", "output format", STRING, true);
 	parpars.registerFlag("rm", "remove input file when finished");
-	String man = String("This tool can be used to convert between different molecular file-formats.\nSupported formats are ") + MolFileFactory::getSupportedFormats() + String(".");
+	
+	// the available formats
+	String formats = MolFileFactory::getSupportedFormats();
+	// we support: mol2, sdf, drf, pdb, ac, ent, brk, hin, mol, xyz, 
+	// mol2.gz, sdf.gz, drf.gz, pdb.gz, ac.gz, ent.gz, brk.gz, hin.gz, mol.gz, xyz.gz.
+	
+	String man = String("This tool can be used to convert between different molecular file-formats.\nSupported formats are ") + formats + String(". File extensions of input and output filenames are ignored.");
 	parpars.setToolManual(man);
 	parpars.setSupportedFormats("i",MolFileFactory::getSupportedFormats());
 	parpars.setSupportedFormats("o",MolFileFactory::getSupportedFormats());
-
-	String formats = MolFileFactory::getSupportedFormats();
+	
 	vector<String> v;
 	formats.split(v,",");
 	list<String> format_list;
@@ -31,14 +72,17 @@ int main(int argc, char* argv[])
 	{
 		format_list.push_back(v[i]);
 	}
-	parpars.setParameterRestrictions("f",format_list);
-
+	parpars.setParameterRestrictions("if",format_list);
+	parpars.setParameterRestrictions("of",format_list);
 	parpars.parse(argc, argv);
-
-	String default_format = "mol2";
-	if (parpars.has("f")) default_format = parpars.get("f");
-	GenericMolFile* input = MolFileFactory::open(parpars.get("i"), ios::in);
-	GenericMolFile* output = MolFileFactory::open(parpars.get("o"), ios::out, default_format);
+	
+	validateParameters(parpars);
+	
+	//String default_format = "mol2";
+	String input_format = parpars.get("if");
+	String output_format = parpars.get("of");
+	GenericMolFile* input  = MolFileFactory::open(parpars.get("i"), ios::in, input_format, true);
+	GenericMolFile* output = MolFileFactory::open(parpars.get("o"), ios::out, output_format, true);
 	DockResultFile* drf_output = dynamic_cast<DockResultFile*>(output);
 	if (drf_output)
 	{
@@ -50,10 +94,45 @@ int main(int argc, char* argv[])
 	int no_ignored = 0;
 	while ((mol = input->read()))
 	{
-		bool b = output->write(*mol);
+		bool b;
+		if (output_format == "pdb")
+		{
+			PDBInfo *pdbi = new PDBInfo();
+			System* mol_sys = new System();
+			pdbi->setName(mol->getName());
+			String compnd_line = String(80, PDB::FORMAT_COMPND, 1, mol->getName().c_str());
+			pdbi->getSkippedRecords().push_back(String("COMPND") + compnd_line);
+			mol_sys->insert(*mol);
+			b = (dynamic_cast<PDBFile*>(output))->write(*mol_sys, *pdbi);
+		}
+		else
+		{
+			b = output->write(*mol);
+		}
+		
 		if (b) no_written++;
 		else no_ignored++;
 		delete mol;
+		
+		String smf[] = {"pdb", "pdb.gz", "ac", "ac.gz", "brk", "brk.gz", "mol", "mol.gz"};
+		set<String> single_molecule_formats (smf,smf+8);
+		
+		if (single_molecule_formats.count(output_format) > 0)
+		{
+			
+			if (no_written > 0)
+			{
+				Log.error() << "Output format " << output_format << " only writes one molecule per file. Only first molecule written.\nYou can use LigandFileSplitter to split input file first." << endl;
+				input->close();
+				output->close();
+
+				delete input;
+				delete output;
+
+				exit(1);
+			}
+		}
+		
 		if (no_written%50 == 0)
 		{
 			Log.level(5) << "\r" << no_written << "molecules";
@@ -74,5 +153,6 @@ int main(int argc, char* argv[])
 	if (parpars.has("rm"))
 	{
 		File::remove(parpars.get("i"));
+		Log.level(20) << parpars.get("i") << " removed." << endl;
 	}
 }
diff --git a/source/APPLICATIONS/TOOLS/CrystalGenerator.C b/source/APPLICATIONS/TOOLS/CrystalGenerator.C
index 8560daf..8a0e973 100644
--- a/source/APPLICATIONS/TOOLS/CrystalGenerator.C
+++ b/source/APPLICATIONS/TOOLS/CrystalGenerator.C
@@ -16,6 +16,11 @@
 #include <BALL/FORMAT/PDBFile.h>
 #include <BALL/KERNEL/system.h>
 #include <BALL/FORMAT/commandlineParser.h>
+#include <BALL/FORMAT/parameters.h>
+#include <BALL/FORMAT/parameterSection.h>
+#include <BALL/SYSTEM/path.h>
+
+#include "version.h"
 
 using namespace std;
 using namespace BALL;
@@ -28,7 +33,7 @@ int main(int argc, char* argv[])
 	// - version string
 	// - build date
 	// - category
-	CommandlineParser parpars("X-Ray CrystalGenerator", "creates crystals", "bla", String(__DATE__), "Structure Creation");
+	CommandlineParser parpars("CrystalGenerator", "creates crystals", "VERSION", String(__DATE__), "Structure Creation");
 	
   parpars.registerParameter("i",  "input pdb file",    INFILE,  true);
 	parpars.registerParameter("o",  "output pdb file",   OUTFILE, true);
@@ -36,6 +41,37 @@ int main(int argc, char* argv[])
   // the space group
 	parpars.registerParameter("sg", "space group symbol in Herman-Mauguin notation", STRING, true);
   
+	CrystalGenerator generator;
+	
+	// Fill the space group symbol list
+	generator.getSpaceGroupFilename();
+	Path path;
+	String filename = generator.getSpaceGroupFilename();
+	String filepath = path.find(filename);
+	if (filepath == "")
+	{
+			throw Exception::FileNotFound(__FILE__, __LINE__, filename);
+	}
+
+	Parameters* param = new Parameters(filepath);
+	if (!param->isValid()) return false;
+
+	ParameterSection* pms = new ParameterSection();
+	pms->extractSection(*param, "SpacegroupList");	
+	if (!pms->isValid()) return false;
+	
+	delete param;
+			
+	list<String> space_groups;
+	for (Position i = 0; i < pms->getNumberOfKeys(); i++)
+	{
+		space_groups.push_back(pms->getValue(i,0).c_str());
+	}
+	
+	delete pms;
+					
+	parpars.setParameterRestrictions("sg", space_groups);
+	
   // the cell axes
   parpars.registerParameter("axis_a", "cell axis a", DOUBLE, false);
 	//parpars.setParameterRestrictions("axis_a", 0, 100);
@@ -79,7 +115,6 @@ int main(int argc, char* argv[])
   System system;
   file >> system;
 
-  CrystalGenerator generator;
   generator.setSystem(&system);
 
   boost::shared_ptr<CrystalInfo> ci_ptr(new CrystalInfo());
diff --git a/source/APPLICATIONS/TOOLS/DBExporter.C b/source/APPLICATIONS/TOOLS/DBExporter.C
index 35a733a..1e80fd5 100755
--- a/source/APPLICATIONS/TOOLS/DBExporter.C
+++ b/source/APPLICATIONS/TOOLS/DBExporter.C
@@ -48,7 +48,7 @@ int main(int argc, char* argv[])
 	parpars.registerFlag("s", "show summary of datasets in database");
 	parpars.registerParameter("d", "database name", STRING, true);
 	parpars.registerParameter("u", "database username", STRING, true);
-	parpars.registerParameter("h", "database host", STRING, true);
+	parpars.registerParameter("host", "database host", STRING, true);
 	parpars.registerParameter("port", "database port", BALL::INT, false, "3306");
 //	parpars.registerParameter("id", "molecule ID property-tag name", STRING);
 	parpars.registerParameter("p", "database password", STRING, true);
@@ -110,7 +110,7 @@ int main(int argc, char* argv[])
 
 	String user = parpars.get("u");
 	String db_name = parpars.get("d");
-	String host = parpars.get("h");
+	String host = parpars.get("host");
 	String password = parpars.get("p");
 	int port = 3306;
 	if (parpars.get("port") != CommandlineParser::NOT_FOUND)
diff --git a/source/APPLICATIONS/TOOLS/DBImporter.C b/source/APPLICATIONS/TOOLS/DBImporter.C
index ed1f90e..8121a6f 100755
--- a/source/APPLICATIONS/TOOLS/DBImporter.C
+++ b/source/APPLICATIONS/TOOLS/DBImporter.C
@@ -54,7 +54,7 @@ int main(int argc, char* argv[])
 	parpars.registerParameter("target", "target/dataset name whose molecules should be exported", STRING);
 	parpars.registerParameter("d", "database name", STRING, true);
 	parpars.registerParameter("u", "database username", STRING, true);
-	parpars.registerParameter("h", "database host", STRING, true);
+	parpars.registerParameter("host", "database host", STRING, true);
 	parpars.registerParameter("port", "database port", BALL::INT, false, "3306");
 	//parpars.registerParameter("id", "molecule ID property-tag name", STRING);
 	parpars.registerParameter("p", "database password", STRING, true);
@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
 
 	String user = parpars.get("u");
 	String db_name = parpars.get("d");
-	String host = parpars.get("h");
+	String host = parpars.get("host");
 	String password = parpars.get("p");
 	int port = 3306;
 	String id_tag = "";
diff --git a/source/APPLICATIONS/TOOLS/DockPoseClustering.C b/source/APPLICATIONS/TOOLS/DockPoseClustering.C
index 28ba877..45ff7ce 100644
--- a/source/APPLICATIONS/TOOLS/DockPoseClustering.C
+++ b/source/APPLICATIONS/TOOLS/DockPoseClustering.C
@@ -2,6 +2,10 @@
 // vi: set ts=2:
 //
 
+// A tool for clustering docking poses
+//
+// 
+
 #include <BALL/DOCKING/COMMON/poseClustering.h>
 #include <BALL/FORMAT/DCDFile.h>
 #include <BALL/FORMAT/PDBFile.h>
@@ -30,50 +34,60 @@ int main (int argc, char **argv)
 	// - description
 	// - Inputfile
 	parpars.registerParameter("i_pdb", "input pdb-file", INFILE, true);
-	parpars.registerParameter("i_dcd", "input dcd-file or", INFILE, false);
+	parpars.registerParameter("i_dcd", "input dcd-file", INFILE, false);
 	//TODO offer the alternatives in a more elegant way!
-	parpars.registerParameter("i_transformations", "input transformation file for rigid rmsd clustering ", INFILE, false);
+	parpars.registerParameter("i_trans", "or input transformation file for rigid rmsd clustering ", INFILE, false);
 
 	// we register an output file parameter 
-	// - description
-	// - Outputfile
+	// - CLI switch
+	// - description	
+	// - parameter type	
 	// - required
-	parpars.registerParameter("o", "output dcd-file name for first solution ", STRING, true, "", true);
-
-	parpars.registerParameter("o_type", "output type (dcd, index_list, or rmsd_matrix) ", STRING, false, "dcd");
+	// - default value
+	// - hidden in galaxy
+	parpars.registerParameter("o_index_list", "output file name for the index list ", OUTFILE, true, "", true);
+	parpars.registerParameter("o_score_matrix", "output file name for scoring matrix ", OUTFILE, false, "", true);
+	parpars.registerParameter("o_dcd", "output file name for the first cluster dcd file ", OUTFILE, false, "", true);
+
+	parpars.registerParameter("o_dcd_id", "output id ", GALAXY_OPT_OUTID, false, "$o_dcd.id", true);
+	// need to be hidden in command line mode
+  parpars.setParameterAsAdvanced("o_dcd_id");
+
+	parpars.registerParameter("o_dcd_dir", "output directory for 2nd to last cluster dcd file (if needed) ", GALAXY_OPT_OUTDIR, false, "$__new_file_path__", true);
+	// need to be hidden in command line mode
+  parpars.setParameterAsAdvanced("o_dcd_dir");
+
+	/*
+	parpars.registerParameter("o_type", "output type (dcd, index_list, or score_matrix) ", STRING, false, "dcd");
 	list<String> output_types;
-	output_types.push_back("dcd");
-	output_types.push_back("index_list");
-	output_types.push_back("rmsd_matrix");
+	output_types.push_back("dcd");          // each cluster a dcd file         --> o_id and o_dir
+	output_types.push_back("index_list");   // indices of clusters single file --> -o 
+	output_types.push_back("score_matrix"); // single file --> -o
 	parpars.setParameterRestrictions("o_type", output_types);
-
-	parpars.registerParameter("o_id", "output id ", STRING, false, "", true);
-
-	parpars.registerParameter("o_dir", "output directory for 2nd to last solution ", STRING, false, "", true);
-
-	parpars.registerParameter("o_dcd", "output directory for the reduced cluster set (one structure per final cluster) ", STRING, false, "", true);
+	*/
 
 	// register String parameter for supplying minimal rmsd between clusters
 	parpars.registerParameter("rmsd_cutoff", "minimal rmsd between the final clusters (default 5.0) ", DOUBLE, false, 5.0);
 	parpars.setParameterRestrictions("rmsd_cutoff", 0, 100);
 
 	// choice of cluster algorithm  
-	parpars.registerParameter("alg", "algorithm used for clustering (CLINK_DEFAYS, NEAREST_NEIGHBOR_CHAIN_WARD, SLINK_SIBSON, TRIVIAL_COMPLETE_LINKAGE) ", STRING, false, "CLINK_DEFAYS");
+	parpars.registerParameter("alg", "algorithm used for clustering (CLINK_DEFAYS, CLINK_ALTHAUS, NEAREST_NEIGHBOR_CHAIN_WARD, SLINK_SIBSON, TRIVIAL_COMPLETE_LINKAGE) ", STRING, false, "CLINK_DEFAYS");
 	list<String> cluster_algs;
 	cluster_algs.push_back("CLINK_DEFAYS");
+	cluster_algs.push_back("CLINK_ALTHAUS");
 	cluster_algs.push_back("TRIVIAL_COMPLETE_LINKAGE");
 	cluster_algs.push_back("NEAREST_NEIGHBOR_CHAIN_WARD");
 	cluster_algs.push_back("SLINK_SIBSON");
 	parpars.setParameterRestrictions("alg", cluster_algs);
 
 	// choice of atom rmsd scope 
-	parpars.registerParameter("rmsd_scope", "atoms to be considered for rmsd score (C_ALPHA, BACKBONE, ALL_ATOMS) ", STRING, false, "C_ALPHA");
+	parpars.registerParameter("scope", "atoms to be considered for scoreing a pose (C_ALPHA, BACKBONE, ALL_ATOMS) ", STRING, false, "C_ALPHA");
 	list<String> rmsd_levels;
 	rmsd_levels.push_back("C_ALPHA");
 	//rmsd_levels.push_back("HEAVY_ATOMS"); //TODO
 	rmsd_levels.push_back("BACKBONE");
 	rmsd_levels.push_back("ALL_ATOMS");
-	parpars.setParameterRestrictions("rmsd_scope", rmsd_levels);
+	parpars.setParameterRestrictions("scope", rmsd_levels);
 
 	// choice of rmsd type
 	parpars.registerParameter("rmsd_type", "rmsd type used for clustering (SNAPSHOT_RMSD, RIGID_RMSD, CENTER_OF_MASS_DISTANCE) ", STRING, false, "SNAPSHOT_RMSD");
@@ -83,48 +97,65 @@ int main (int argc, char **argv)
 	rmsd_types.push_back("CENTER_OF_MASS_DISTANCE");
 	parpars.setParameterRestrictions("rmsd_type", rmsd_types);
 
+	// further optional output parameters
+	parpars.registerParameter("o_red_dcd", "output file for the reduced cluster set (dcd with one structure per final cluster) ", OUTFILE, false, "");
+
+	// write the final cluster tree in boost::serialize format, if it was computed
+	parpars.registerParameter("o_cluster_tree", "output file containing the cluster tree in boost::serialize format (if the tree was computed) ", OUTFILE, false, "");
+
 	// register bool parameter for using pre-clustering
-	parpars.registerFlag("use_refinement", "Apply a second clustering run with different options (-refine_alg <string>, -refine_rmsd_type <string>, and -refine_rmsd_scope <string>)");
+	parpars.registerFlag("use_refinement", "Apply a second clustering run with different options (-refine_alg <string>, -refine_rmsd_type <string>, and -refine_rmsd_scope <string>)", false, true);
 
 	// refinement algorithm
-	parpars.registerParameter("refine_alg", "algorithm used for second clustering run (CLINK_DEFAYS, NEAREST_NEIGHBOR_CHAIN_WARD, SLINK_SIBSON, TRIVIAL_COMPLETE_LINKAGE) ", STRING, false, "CLINK_DEFAYS");
+	parpars.registerParameter("refine_alg", "algorithm used for second clustering run (CLINK_DEFAYS, NEAREST_NEIGHBOR_CHAIN_WARD, SLINK_SIBSON, TRIVIAL_COMPLETE_LINKAGE) ", STRING, false, "CLINK_DEFAYS", true);
 	parpars.setParameterRestrictions("refine_alg", cluster_algs);
 
-	// refinment rmsd type
-	parpars.registerParameter("refine_rmsd_type", "rmsd type used for second clustering run (SNAPSHOT_RMSD, RIGID_RMSD, CENTER_OF_MASS_DISTANCE) ", STRING, false, "SNAPSHOT_RMSD");
+	// refinement rmsd type
+	parpars.registerParameter("refine_rmsd_type", "rmsd type used for second clustering run (SNAPSHOT_RMSD, RIGID_RMSD, CENTER_OF_MASS_DISTANCE) ", STRING, false, "SNAPSHOT_RMSD", true);
 	parpars.setParameterRestrictions("refine_rmsd_type", rmsd_types);
 
 	// refinement rmsd scope
-	parpars.registerParameter("refine_rmsd_scope", "atoms to be considered for rmsd score in second clustering run (C_ALPHA, BACKBONE, ALL_ATOMS) ", STRING, false, "C_ALPHA");
+	parpars.registerParameter("refine_rmsd_scope", "atoms to be considered for rmsd score in second clustering run (C_ALPHA, BACKBONE, ALL_ATOMS) ", STRING, false, "C_ALPHA", true);
 	parpars.setParameterRestrictions("refine_rmsd_scope", rmsd_levels);
 
+	// force serial execution, even if the algorithm supports parallel runs
+	parpars.registerFlag("run_serial", "force serial excecution, even if parallel execution would be supported by the algorithm", false, true);
 
-  // the manual
-	String man = "This tool computes clusters of docking poses given as conformation set or a list of rigid transformations.\n\nParameters are either the input ConformationSet (-i_dcd) and one corresponding pdb file (-i_pdb), or a transformation file (-i_transformations), and a naming schema for the results (-o). Optional parameters are the algorithm (-alg), the minimal rmsd between the final clusters (-rmsd_cutoff), the rmsd type (-rmsd_type), and the scope/level of detail of the rmsd comp [...]
+	// the manual
+	String man = "This tool computes clusters of docking poses given as conformation set or a list of rigid transformations.\n\nParameters are either the input ConformationSet (-i_dcd) and one corresponding pdb file (-i_pdb), or a transformation file (-i_trans). Output can be a cluster index list (-o_index_list), a cluster scoring matrix (-o_score_matrix), or dcd files per cluster (-o_dcd). Optional parameters are the algorithm (-alg), the minimal rmsd between the final clusters (-rmsd_cuto [...]
 
 	parpars.setToolManual(man);
 
 	// here we set the types of I/O files
 	parpars.setSupportedFormats("i_dcd","dcd");
 	parpars.setSupportedFormats("i_pdb","pdb");
-	parpars.setSupportedFormats("i_transformations","txt");
-	parpars.setSupportedFormats("o","dcd");
+	parpars.setSupportedFormats("i_trans","txt");
+	parpars.setSupportedFormats("o_index_list","txt");
+	parpars.setSupportedFormats("o_score_matrix","txt");
 	parpars.setSupportedFormats("o_dcd","dcd");
+	parpars.setSupportedFormats("o_red_dcd","dcd");
+	parpars.setSupportedFormats("o_cluster_tree","dat");
 
 	parpars.parse(argc, argv);
 
 	//////////////////////////////////////////////////
 
-	// first, a little sanity check
-	if (parpars.get("o_type") == "dcd")
+	if (parpars.has("o_dcd"))
 	{
-		if (!parpars.has("o_dir") || !parpars.has("o_id"))
+		if (!parpars.has("o_dcd_dir") || !parpars.has("o_dcd_id"))
 		{
 			Log << "Output type \"dcd\" requires setting the options \"o_dir\" \"o_id\"! Abort!" << endl;
 			return 1;
 		}
 	}
 
+	if (     parpars.has("o_cluster_tree")
+			&& (!parpars.has("alg") || parpars.get("alg") != "NEAREST_NEIGHBOR_CHAIN_WARD"))
+	{
+		Log << "Output of cluster tree requires Ward algorithm! Abort!" << endl;
+		return 1;
+	}
+
 	// read the input	
 	PDBFile pdb;
 	pdb.open(parpars.get("i_pdb"));
@@ -143,21 +174,9 @@ int main (int argc, char **argv)
 
 	PoseClustering pc;
 
-	if (parpars.has("i_transformations"))
+	if (parpars.has("i_trans"))
 	{
-		if (parpars.has("rmsd_type"))
-		{
-			if (parpars.get("rmsd_type") != "RIGID_RMSD")
-			{
-				Log << "Transformation input file can only be used with rmsd_type 'RIGID_RMSD'. Abort!" << endl;
-				return 0;
-			}
-		}
-		else
-		{
-			pc.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::RIGID_RMSD);
-		}
-		pc.setBaseSystemAndTransformations(sys, parpars.get("i_transformations"));
+		pc.setBaseSystemAndTransformations(sys, parpars.get("i_trans"));
 	}
 
 	if (parpars.has("rmsd_cutoff"))
@@ -166,9 +185,9 @@ int main (int argc, char **argv)
 		pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, rmsd);
 	}
 
-	if (parpars.has("rmsd_scope"))
+	if (parpars.has("scope"))
 	{
-		String scope = parpars.get("rmsd_scope");
+		String scope = parpars.get("scope");
 		if (scope == "C_ALPHA")
 			pc.options.set(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL, PoseClustering::C_ALPHA);
 		else if (scope == "BACKBONE")
@@ -176,7 +195,7 @@ int main (int argc, char **argv)
 		else if (scope == "ALL_ATOMS")
 			pc.options.set(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL, PoseClustering::ALL_ATOMS);
 		else
-			Log.info() << "Unknown value " << scope  << " for option rmsd_scope." << endl;
+			Log.info() << "Unknown value " << scope  << " for option scope." << endl;
 	}
 
 	if (parpars.has("alg"))
@@ -184,6 +203,8 @@ int main (int argc, char **argv)
 		String alg = parpars.get("alg");
 		if (alg == "CLINK_DEFAYS")
 			pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::CLINK_DEFAYS);
+		else if (alg == "CLINK_ALTHAUS")
+			pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::CLINK_ALTHAUS);
 		else if (alg == "SLINK_SIBSON")
 			pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::SLINK_SIBSON);
 		else if (alg == "TRIVIAL_COMPLETE_LINKAGE")
@@ -204,14 +225,23 @@ int main (int argc, char **argv)
 		else if (type == "CENTER_OF_MASS_DISTANCE")
 		{
 			pc.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::CENTER_OF_MASS_DISTANCE);
-			Log << "Parameter rmsd_scope will be ignored!" << endl;
+			Log << "Parameter scope will be ignored!" << endl;
 		}
 		else
 			Log.info() << "Unknown value " << type  << " for option rmsd_type." << endl;
 
 	}
 
-	if (parpars.has("-i_dcd"))
+	if (parpars.has("run_serial"))
+	{
+		pc.options.set(PoseClustering::Option::RUN_PARALLEL, false);
+	}
+	else
+	{
+		pc.options.set(PoseClustering::Option::RUN_PARALLEL, true);
+	}
+
+	if (parpars.has("i_dcd"))
 	{
 		pc.setConformationSet(&cs);
 	}
@@ -241,6 +271,8 @@ int main (int argc, char **argv)
 			String alg = parpars.get("refine_alg");
 			if (alg == "CLINK_DEFAYS")
 				refine_options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::CLINK_DEFAYS);
+			else if (alg == "CLINK_ALTHAUS")
+				refine_options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::CLINK_ALTHAUS);
 			else if (alg == "SLINK_SIBSON")
 				refine_options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::SLINK_SIBSON);
 			else if (alg == "TRIVIAL_COMPLETE_LINKAGE")
@@ -261,7 +293,7 @@ int main (int argc, char **argv)
 			else if (type == "CENTER_OF_MASS_DISTANCE")
 			{
 				refine_options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::CENTER_OF_MASS_DISTANCE);
-				Log << "Parameter rmsd_scope will be ignored!" << endl;
+				Log << "Parameter scope will be ignored!" << endl;
 			}
 			else
 				Log.info() << "Unknown value " << type  << " for option refine_rmsd_type." << endl;
@@ -270,13 +302,11 @@ int main (int argc, char **argv)
 		pc.refineClustering(refine_options);
 	}
 
-
-
 	Size num_clusters = pc.getNumberOfClusters();
 
 	Log << "Computed " <<  num_clusters << " clusters, start writing..." << endl;
 
-	if (parpars.get("o_type") == "dcd")
+	if (parpars.has("o_dcd"))
 	{
 		for (Size i = 0; i < num_clusters; i++)
 		{
@@ -284,38 +314,46 @@ int main (int argc, char **argv)
 
 			boost::shared_ptr<ConformationSet> new_cs = pc.getClusterConformationSet(i);
 
-			String outfile_name = (i == 0) ? String(parpars.get("o"))
-				: String(parpars.get("o_dir")) + "/primary_"
-				+ String(parpars.get("o_id"))  + "_cluster" + String(i)
-				+ "_visible.dcd";
+			String outfile_name = (i == 0) ? String(parpars.get("o_dcd"))
+				: String(parpars.get("o_dcd_dir")) + "/primary_"
+				+ String(parpars.get("o_dcd_id"))  + "_cluster" + String(i)
+				+ "_visible_dcd";
 			//Log << "   Writing solution " << String(i) << " as " << outfile_name << endl;
 
 			new_cs->writeDCDFile(outfile_name);
 		}
 	}
-	else
+	if (parpars.has("o_index_list"))
 	{
-		String outfile_name = String(parpars.get("o"));
+		String outfile_name = String(parpars.get("o_index_list"));
 
 		File cluster_outfile(outfile_name, std::ios::out);
 
-		if (parpars.get("o_type") == "index_list")
-		{
-			pc.printClusters(cluster_outfile);
-		}
-		else
-		{
-			pc.printClusterRMSDs(cluster_outfile);
-		}
+		pc.printClusters(cluster_outfile);
+	}
+	if (parpars.has("o_score_matrix"))
+	{
+		String outfile_name = String(parpars.get("o_score_matrix"));
+
+		File cluster_outfile(outfile_name, std::ios::out);
+
+		pc.printClusterScores(cluster_outfile);
 	}
 
 	// print
 	pc.printClusters();
-	pc.printClusterRMSDs();
+	pc.printClusterScores();
 
-	if (parpars.has("o_dcd"))
+	if (parpars.has("o_cluster_tree"))
+	{
+		File cluster_out(parpars.get("o_cluster_tree"), std::ios::out);
+		pc.serializeWardClusterTree(cluster_out, true);
+		cluster_out.close();
+	}
+
+	if (parpars.has("o_red_dcd"))
 	{
-		String outfile_name = String(parpars.get("o_dcd"));
+		String outfile_name = String(parpars.get("o_red_dcd"));
 		boost::shared_ptr<ConformationSet> cs = pc.getReducedConformationSet();
 		cs->writeDCDFile(outfile_name);
 	}
diff --git a/source/APPLICATIONS/TOOLS/ExtractClustersFromWardTree.C b/source/APPLICATIONS/TOOLS/ExtractClustersFromWardTree.C
new file mode 100644
index 0000000..743078d
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/ExtractClustersFromWardTree.C
@@ -0,0 +1,170 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALL/DOCKING/COMMON/poseClustering.h>
+#include <BALL/FORMAT/DCDFile.h>
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/FORMAT/lineBasedFile.h>
+#include <BALL/DOCKING/COMMON/conformationSet.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+#include <iostream>
+#include "version.h"
+
+using namespace std;
+using namespace BALL;
+
+int main (int argc, char **argv)
+{
+	// instantiate CommandlineParser object supplying
+	// - tool name
+	// - short description
+	// - version string
+	// - build date
+	// - category
+	CommandlineParser parpars("ExtractClustersFromWardTree", "extracts docking clusters ", VERSION, String(__DATE__), "Docking");
+
+	// we register an input file parameter 
+	// - CLI switch
+	// - description
+	// - parameter type
+	// - required
+	parpars.registerParameter("i", "input serialized cluster file", INFILE, true);
+
+	// we register an output file parameter 
+	// - CLI switch
+	// - description
+	// - parameter type
+	// - required
+	// - default value
+	// - hidden in galaxy
+	parpars.registerParameter("o_out", "output file name ", OUTFILE, true, "", true);
+
+	// we register the output type
+	parpars.registerParameter("o_type", "output type (gv, index_list) ", STRING, true, "index_list");
+	list<String> output_types;
+	output_types.push_back("gv");
+	output_types.push_back("index_list");
+	parpars.setParameterRestrictions("o_type", output_types);
+
+	// we register the cutoff type
+	parpars.registerParameter("cutoff_type", "cutoff type (ward_distance, num_clusters) ", STRING, false, "ward_distance");
+	list<String> cutoff_types;
+	cutoff_types.push_back("ward_distance");
+	cutoff_types.push_back("num_clusters");
+	parpars.setParameterRestrictions("cutoff_type", cutoff_types);
+
+	// we register the cutoff value, either the minimal ward distance between the clusters
+	//                               or the number of clusters to split into
+	parpars.registerParameter("cut_value", "cut value for splitting the given WART tree using the cutoff-type (default 5.0) ", DOUBLE, false, 5.0);
+	parpars.setParameterRestrictions("cut_value", 0.0, 10000);
+
+	// we register a parameter defining the minimal size of clusters - e.g. for filtering out single outlieers
+	parpars.registerParameter("min_size", "minimal size of clusters (default 1) ", INT, false, 1);
+	parpars.setParameterRestrictions("min_size", 1, 10000);
+
+  // the manual
+	String man = "This tool extracts clusters of docking poses given a dat file.\n\nParameters are the filename (-i) of the serialized cluster tree, the output filename (-o_out), the output type (-o_type). The optional parameter -min_size allows to filter for cluster of a minimal size, parameter -cutoff_type defines the way to cut the cluster tree (either by ward distance or by a target number of clusters) using paramter -cut_value.\n\nOutput of this tool is the extracted cluster tree, eith [...]
+
+	parpars.setToolManual(man);
+
+	// here we set the types of I/O files
+	parpars.setSupportedFormats("i", "dat");
+	parpars.setSupportedFormats("o_out", "txt,gv");
+
+	parpars.parse(argc, argv);
+
+	//////////////////////////////////////////////////
+
+
+	// read the input	
+	File tree;
+	tree.open(parpars.get("i"));
+
+	PoseClustering pc;
+	// this only works for Nearest neighbor chain ward trees...
+	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
+
+	// import a binary file
+	pc.deserializeWardClusterTree(tree, true);
+
+	int min_cluster_size = 0;
+	if (parpars.has("min_size"))
+	{
+		min_cluster_size = parpars.get("min_size").toInt();
+	}
+	Log << "  Use min_size = " << min_cluster_size << endl;
+
+
+	float cut_value = 5;
+	if (parpars.has("cut_value"))
+	{
+		cut_value = parpars.get("cut_value").toFloat();
+	}
+	Log << "  Use cut_value = " << cut_value << endl;
+
+
+	float num_clusters_to_extract = 5.;
+	int   max_ward_dist = 5;
+
+	//std::vector<std::set<Index> > clusters;
+
+	if (parpars.has("cutoff_type"))
+	{
+		String type = parpars.get("cutoff_type");
+		Log << "  Use cutoff_type = " << type << endl;
+
+		if (type == "ward_distance")
+		{
+			max_ward_dist = cut_value;
+
+			//clusters = 
+			pc.extractClustersForThreshold(max_ward_dist, min_cluster_size);
+		}
+		else if (type == "num_clusters")
+		{
+			num_clusters_to_extract = cut_value;
+
+			//clusters = 
+			pc.extractNBestClusters(num_clusters_to_extract);
+			pc.filterClusters(min_cluster_size);
+		}
+		else
+		{
+			Log.info() << "Unknown value " << type  << " for option cutoff_type." << endl;
+			return 1;
+		}
+	}
+
+	Log << endl << "Extracted " << pc.getNumberOfClusters()  << " clusters, start writing... ";
+
+	String outfile_name = String(parpars.get("o_out"));
+
+	if (parpars.get("o_type") == "index_list")
+	{
+		File cluster_outfile(outfile_name, std::ios::out);
+		pc.printClusters(cluster_outfile);
+
+		Log << outfile_name << endl;
+	}
+	else if (parpars.get("o_type") == "gv")
+	{
+		File gv_outfile(outfile_name, std::ios::out);
+
+		pc.exportWardClusterTreeToGraphViz(gv_outfile);
+		gv_outfile.close();
+
+		Log << outfile_name << endl;
+		Log << "For drawing the graph use, e.g. \n\tdot -Tps -o tree.ps " << outfile_name << endl;
+	}
+	else
+	{
+		Log << "Unspecified output!!" << endl;
+	}
+
+	Log << "done." << endl;
+
+return 0;
+}
+
diff --git a/source/APPLICATIONS/TOOLS/ExtractProteinChains.C b/source/APPLICATIONS/TOOLS/ExtractProteinChains.C
new file mode 100644
index 0000000..8f71ce2
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/ExtractProteinChains.C
@@ -0,0 +1,122 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+#include <BALL/FORMAT/PDBFile.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+
+#include "version.h"
+
+using namespace std;
+using namespace BALL;
+
+int main(int argc, char* argv[])
+{
+	// instantiate CommandlineParser object
+	CommandlineParser parpars("ExtractProteinChains", "separate all chains of a pdb file into separate pdb files", VERSION, String(__DATE__), "Preparation");
+
+	parpars.registerParameter("pdb",  "input pdb file ", INFILE,  true);
+	parpars.registerParameter("chain_id",  "chain to extract ", STRING,  false);
+	//TODO
+	//parpars.registerFlag("skip_nonaa", "skip all non aminoacids", false);
+
+	parpars.registerParameter("o", "output file name ", OUTFILE, true, "", true);
+
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_id", "output id", GALAXY_OPT_OUTID, false, "$o.id", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_id");
+
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_dir", "output directory for 2nd to last solution", GALAXY_OPT_OUTDIR, false, "$__new_file_path__", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_dir");
+
+	// the manual
+	String man = String("This tool splits a pdb file into its chains.");
+
+	parpars.setToolManual(man);
+
+	parpars.setSupportedFormats("pdb", "pdb");
+	parpars.setSupportedFormats("o", "pdb");
+
+	// parse the command line
+	parpars.parse(argc, argv);
+
+
+	PDBFile pdb;
+	pdb.open(parpars.get("pdb"), std::ios::in);
+
+	if (!pdb)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("pdb") << " for input." << std::endl;
+		exit(2);
+	}
+
+	System sys;
+	pdb >> sys;
+	pdb.close();
+
+	// called as command line or e.g. via galaxy?
+	bool is_cmd =    !parpars.has("env")
+		            || ((parpars.has("env") && parpars.get("env")=="cmdline"));
+
+	// get the optional chain_id
+	String chain_id = "";
+	if (parpars.has("chain_id"))
+	{
+		chain_id = parpars.get("chain_id");
+	}
+/*	else if ( is_cmd && (parpars.get("o_dir") == "$__new_file_path__"))
+	{
+		Log.error() << endl << "unspecified parameter o_dir. Abort." << endl;
+		return 2;
+	}
+*/
+
+	int export_counter = 0;
+	ChainConstIterator c_it = sys.beginChain();
+	for (; +c_it ; ++c_it)
+	{
+		if ((chain_id == "") || (chain_id == c_it->getName()))
+		{
+			// create the output name
+			String outfile_name = String(parpars.get("o")) + "chain_" + String(export_counter) + ".pdb";
+
+			//TODO this is a temporary hack :-(
+			// are we given a parameter o_dir
+			if (parpars.has("o_dir") && is_cmd && (parpars.get("o_dir") != "$__new_file_path__"))
+			{
+				outfile_name = String(parpars.get("o_dir")) + "/" + c_it->getName() + "_" + outfile_name;
+			}
+
+			// NOTE: Galaxy requires this strange naming convention 
+			//       including the fact, that zero-th element has a different name
+			if (!is_cmd)
+			{
+				outfile_name = (export_counter == 0) ? String(parpars.get("o"))
+			                               :   String(parpars.get("o_dir")) + "/primary_"
+			                                 + String(parpars.get("o_id"))  + "_chain" + String(export_counter)
+			                                 + "_visible_pdb";
+			}
+			// now write the chain
+			PDBFile outfile(outfile_name, ios::out);
+
+			if (outfile.bad())
+			{
+				Log.error() << endl << "cannot write file " << outfile_name << endl;
+				return 2;
+			}
+
+			outfile << *c_it;
+			outfile.close();
+
+			Log << "wrote file " << outfile_name << endl;
+
+			export_counter++;
+		}
+	}
+
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/ExtractProteinSequence.C b/source/APPLICATIONS/TOOLS/ExtractProteinSequence.C
new file mode 100644
index 0000000..71f48b5
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/ExtractProteinSequence.C
@@ -0,0 +1,75 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/FORMAT/lineBasedFile.h>
+#include <BALL/FORMAT/commandlineParser.h>
+#include <BALL/KERNEL/system.h>
+#include <BALL/STRUCTURE/peptides.h>
+
+#include "version.h"
+
+using namespace BALL;
+
+int main(int argc, char* argv[])
+{
+	// instantiate CommandlineParser object
+	CommandlineParser parpars("ExtractProteinSequence", "extracts fasta sequence", VERSION, String(__DATE__), "Get Data");
+	parpars.registerParameter("i",  "input pdb file from which to extract ", INFILE,  true);
+	parpars.registerParameter("c",  "chain specifier", STRING,  false);
+	parpars.registerParameter("o",  "output fasta file", OUTFILE, true);
+
+	// the manual
+	String man = String("This tool extracts the fasta sequence from a given pdb file.");
+
+	parpars.setToolManual(man);
+
+	parpars.setSupportedFormats("i", "pdb");
+	parpars.setSupportedFormats("o", "fasta");
+
+	// parse the command line
+	parpars.parse(argc, argv);
+
+	PDBFile in_file;
+	in_file.open(parpars.get("i"), std::ios::in);
+
+	if (!in_file)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("i") << " for input." << std::endl;
+		exit(2);
+	}
+
+	//TODO switch to the BALL FastaFile format if available
+	LineBasedFile out_file;
+	out_file.open(parpars.get("o"), std::ios::out);
+
+	if (!out_file)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("o") << " for output." << std::endl;
+		exit(2);
+	}
+
+	System system;
+	in_file >> system;
+	in_file.close();
+
+	for (ProteinIterator it = system.beginProtein(); +it; ++it)
+	{
+		ChainConstIterator c_it = it->beginChain();
+		for (; +c_it ; ++c_it)
+		{
+			// get the chain's sequence
+			String seq = Peptides::GetSequence(*c_it);
+			out_file << "> " << it->getName() + ":" + c_it->getName() << std::endl << seq << std::endl;
+		}
+	}
+
+	out_file.close();
+	Log << "wrote file " << parpars.get("o") << std::endl;
+
+	return 0;
+
+}
diff --git a/source/APPLICATIONS/TOOLS/FingerprintSimilarityClustering.C b/source/APPLICATIONS/TOOLS/FingerprintSimilarityClustering.C
index fbe116c..05bcd01 100644
--- a/source/APPLICATIONS/TOOLS/FingerprintSimilarityClustering.C
+++ b/source/APPLICATIONS/TOOLS/FingerprintSimilarityClustering.C
@@ -31,28 +31,36 @@ using namespace boost;
 using namespace std;
 
 
-// Format of fingerprint: 1 = Comma separated list of integer features, 2 = Fixed sized binay string
+typedef map<unsigned int, map<unsigned int, vector<unsigned int> > > ClusterMap;
+typedef map<unsigned int, map<unsigned int, vector<unsigned int> > >::iterator ClusterMapIterator;
+typedef map<unsigned int, map<unsigned int, vector<unsigned int> > >::reverse_iterator ClusterMapReverseIterator;
+typedef map<unsigned int, vector<pair<unsigned int, float> > > NNData;
+
+
+// Fingerprint format
+// 1: Comma separated list of integer features
+// 2: Fixed-length binay string
 unsigned int fprint_format;
 
-// Format of fingerprint: 1 = Comma separated list of integer features, 2 = Fixed sized binay string
+// Fingerprint length
 unsigned int fixed_size_len;
 
-// Limit of molecules to be read
+// Limit number of molecules to read
 unsigned int limit;
 
-// Column number which contains the fingerprint
+// Column number of the fingerprint
 int fp_col;
 
-// Column number which contains a identifier of the compounds
+// Column number of a ompound identifier
 int id_col;
 
-// True if input library file is in SD format
+// True iff input library file is in SD format
 bool is_lib_sdf;
 
-// SDF tag which contains the fingerprint
+// SDF tag of the fingerprint
 String fp_tag;
 
-// SDF tag which contains a identifier of the compounds
+// SDF tag of a ompound identifier
 String id_tag;
 
 
@@ -249,6 +257,7 @@ void readMoleculeIdentifiers(unordered_map<unsigned int, set<String> >& mol_iden
 }
 
 
+
 void writeConnectedComponents(const vector<unsigned int>& m_indices, 
 			      const vector<vector<unsigned int> >& ccs,
 			      const multimap<unsigned int, unsigned int>& cc_sizes,
@@ -268,7 +277,7 @@ void writeConnectedComponents(const vector<unsigned int>& m_indices,
 	
 	unordered_map<unsigned int, set<String> > mol_identifiers;
 	readMoleculeIdentifiers(mol_identifiers);
-	
+
 	String cids;
 	set<String>::iterator it;
 	multimap<unsigned int, unsigned int>::const_reverse_iterator iter;
@@ -280,22 +289,73 @@ void writeConnectedComponents(const vector<unsigned int>& m_indices,
 		for (unsigned int i=0; i!=cc.size(); ++i)
 		{
 			it=mol_identifiers[m_indices[cc[i]]].begin();
-			
+
 			cids = *it;
 			for (++it; it!=mol_identifiers[m_indices[cc[i]]].end(); ++it)
 			{
 				cids += "," + *it;
 			}
-			
+
 			out << m_indices[cc[i]] << " " << m_indices[nnd[i].first] << " " << nnd[i].second << " " << cids << endl;
 		}
 		
-		out << "//" << endl; 
+		out << "//" << endl;
 	}
 	
 	out.close();
 }
 
+void writeConnectedComponents(const vector<unsigned int>& m_indices,
+							  const ClusterMap& clmap,
+							  const NNData& nn,
+							  const float sim_cutoff)
+{
+	File out("FFC_2_connected_components.txt", File::MODE_OUT);
+
+	out << "# FFC CONNECTED COMPONENTS" << endl;
+	out << "# at similarity cutoff: " << sim_cutoff << endl;
+	out << "# Connected components are separated by a '//' prefixed line." << endl;
+	out << "# SRC_NODE_ID:    global internal (fingerprint unique) id of source node." << endl;
+	out << "# DST_NODE_INDEX: index of nearest neighbour within connected component vector." << endl;
+	out << "# TANIMOTO_SIM:   tanimoto similarity. If TANIMOTO_SIM == -1.0, no nearest neighbour information hass been calculated." << endl;
+	out << "# CMPD_IDS:   Comma separated list of original compound id(s) which map onto this SRC_NODE_ID." << endl;
+	out << "SRC_NODE_INDEX DST_NODE_INDEX TANIMOTO_SIM CMPD_IDS" << endl;
+
+	unordered_map<unsigned int, set<String> > mol_identifiers;
+	readMoleculeIdentifiers(mol_identifiers);
+
+	set<String>::iterator it;
+	ClusterMap::const_reverse_iterator clmap_iter = clmap.rbegin();
+	for (; clmap_iter!=clmap.rend(); ++clmap_iter)
+	{
+		map<unsigned int, vector<unsigned int> >::const_iterator iter;
+		for (iter=clmap_iter->second.begin(); iter!=clmap_iter->second.end(); ++iter)
+		{
+			vector<unsigned int> cc = iter->second;
+			vector<pair<unsigned int, float> > nn_tmp = (nn.find(iter->first))->second;
+
+			for (unsigned int i=0; i!=cc.size(); ++i)
+			{
+				it = mol_identifiers[m_indices[cc[i]]].begin();
+
+				String cids = *it;
+				for (++it; it!=mol_identifiers[m_indices[cc[i]]].end(); ++it)
+				{
+					cids += "," + *it;
+				}
+
+				out << m_indices[cc[i]] << " " << m_indices[nn_tmp[i].first] << " " << nn_tmp[i].second << " " << cids << endl;
+			}
+
+			out << "//" << endl;
+		}
+	}
+
+	out.close();
+
+	return;
+}
+
 
 bool readFingerprints(const String& input_file, vector<vector<unsigned short> >& mol_features, vector<String>& mol_identifiers)
 {
@@ -401,6 +461,87 @@ bool readFingerprints(const String& input_file, vector<vector<unsigned short> >&
 }
 
 
+bool connectedComponentsMemoryEstimation(const unsigned int n_items, const unsigned int n_threads, const unsigned int b_size)
+{
+	LongIndex threaded_nn_data_size = (n_threads + 1) * n_items * ( sizeof(unsigned int) + sizeof(float) );
+	LongIndex cc_matrices_size = n_threads * sizeof(unsigned short) * b_size * (b_size + 1);
+	LongIndex mem_Bytes = threaded_nn_data_size + cc_matrices_size;
+	LongIndex total_mem = SysInfo::getTotalMemory();
+	
+	bool proceed = true;
+	if (total_mem == -1 || mem_Bytes / (double)total_mem > 0.5)
+	{
+		Log << "\n++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++" << endl;
+		Log << "++ WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING" << endl;
+		Log << "++" << endl;
+		Log << "++ The application will use at least >> " << (mem_Bytes / 1.074e+9) << " GB << of memory" << endl;
+		Log << "++ DO YOU WANT TO PROCEED AT YOUR OWN RISK? [yes | no]" << endl;
+		Log << "++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++\n" << endl;
+		
+		String proceed = "no";
+		getline(cin, proceed);
+		
+		String decision = "no";
+		getline(cin, decision);
+		
+		if (decision != "yes")
+		{
+			proceed = false;
+		}
+	}
+	
+	return proceed;
+}
+
+
+bool clusteringMemoryEstimation(const LongSize cc_max, const unsigned int n_threads, const unsigned int b_size)
+{
+	LongIndex cluster_data_size = (2 * cc_max - 1)  * 100;
+	LongIndex thread_data_size = (n_threads + 1) * cc_max * ( sizeof(unsigned int) + sizeof(float) );
+	thread_data_size += n_threads * sizeof(unsigned short) * b_size * (b_size + 1);
+	thread_data_size += (n_threads) * 100 * cc_max * sizeof(double);
+	LongIndex mem_Bytes = cluster_data_size + thread_data_size;
+	LongIndex total_mem = SysInfo::getTotalMemory();
+	
+	bool proceed = true;
+	if (total_mem == -1 || mem_Bytes / (double)total_mem > 0.5)
+	{
+		Log << "\n++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++" << endl;
+		Log << "++ WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING" << endl;
+		Log << "++" << endl;
+		Log << "++ The largest connected component has >> " << cc_max << " members <<" << endl;
+		Log << "++ Clustering of this component using current settings will use at least >> " << (mem_Bytes / 1.074e+9) << " GB << of memory" << endl;
+		Log << "++ DO YOU WANT TO PROCEED AT YOUR OWN RISK? [yes | no]" << endl;
+		Log << "++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++\n" << endl;
+		
+		String decision = "no";
+		getline(cin, decision);
+		
+		if (decision != "yes")
+		{
+			proceed = false;
+		}
+	}
+	
+	return proceed;
+}
+
+
+unsigned int getIDMin(vector<unsigned int>& ids)
+{
+	unsigned int min = UINT_MAX;
+	for (unsigned int i=0; i!=ids.size(); ++i)
+	{
+		if (ids[i] < min)
+		{
+			min = ids[i];
+		}
+	}
+
+	return min;
+}
+
+
 int main(int argc, char* argv[])
 {
 	CommandlineParser parpars("FingerprintSimilarityClustering", "fast clustering of compounds using 2D binary fingerprints", VERSION, String(__DATE__), "Chemoinformatics");
@@ -452,7 +593,7 @@ $ FingerprintSimilarityClustering -t target.sdf -fp_tag FPRINT -f 1 -id_tag NAME
 	limit = parpars.get("l").toInt();
 	if (limit == 0)
 	{
-		limit = Limits<unsigned int>::max();
+		limit = std::numeric_limits<unsigned int>::max();
 	}
 	
 	unsigned int n_threads = 1;
@@ -521,7 +662,7 @@ $ FingerprintSimilarityClustering -t target.sdf -fp_tag FPRINT -f 1 -id_tag NAME
 	
 	
 	Options options;
-	options.setDefaultInteger(BinaryFingerprintMethods::Option::BLOCKSIZE, 820);
+	options.setDefaultInteger(BinaryFingerprintMethods::Option::BLOCKSIZE, 500);
 	options.setDefaultReal(BinaryFingerprintMethods::Option::SIM_CUTOFF, sim_cutoff);
 	options.setDefaultInteger(BinaryFingerprintMethods::Option::N_THREADS, n_threads);
 	options.setDefaultInteger(BinaryFingerprintMethods::Option::MAX_CLUSTERS, 1000);
@@ -547,164 +688,262 @@ $ FingerprintSimilarityClustering -t target.sdf -fp_tag FPRINT -f 1 -id_tag NAME
 	
 	Log.level(10) << "++ --------------------------------------------------------" << endl;
 	Log.level(10) << "++ STEP 2: Connected components decomposition" << endl;
-	
+
 	vector<unsigned int> m_indices;
 	vector<vector<unsigned int> > ccs;
-	multimap<unsigned int, unsigned int> cc_sizes;
-	vector<vector<pair<unsigned int, float> > > nn_data;
-	
+	vector<vector<pair<unsigned int, float> > > nn_tmp;
+
 	// Add all input molecules for connected component calculation
 	for (unsigned int i=0; i!=mol_features.size(); ++i)
 	{
 		m_indices.push_back(i);
 	}
-	
+
+	// MAKE ESTIMATION FOR SYSTEM RESOURCE DEMANDS
+	bool proceed = connectedComponentsMemoryEstimation(m_indices.size(), n_threads, options.getInteger(BinaryFingerprintMethods::Option::BLOCKSIZE));
+	if (!proceed)
+	{
+		Log << "++" << endl;
+		Log << "++ DONE" << endl;
+		Log << "++" << endl;
+
+		return 0;
+	}
+
+
 	BinaryFingerprintMethods bfm(options, mol_features);
-	bool success = bfm.connectedComponents(m_indices, ccs, nn_data, sim_cutoff, true);
-	
+
+	bool success = bfm.connectedComponents(m_indices, ccs, nn_tmp, sim_cutoff, true);
+
 	if (!success)
 	{
 		Log.error() << "-- FAILED: fast compound clustering was not successful." << endl;
 		Log.error() << endl;
-		
+
 		return 1;
 	}
-	
-	// Determine sizes of connected components
+
+
+	// Store connected components in final cluster data structure
+	// Additionally map the nearest neighbour data appropriately.
+
+	ClusterMap clmap;
+	NNData nn;
+
 	for (unsigned int i=0; i!=ccs.size(); ++i)
 	{
-		cc_sizes.insert(make_pair(ccs[i].size(), i));
+		unsigned int size = ccs[i].size();
+		unsigned int idmin = getIDMin(ccs[i]);
+
+		// Insert connected components into ClusterMap
+		map<unsigned int, vector<unsigned int> >& sizemap = clmap[size];
+		sizemap[idmin] = ccs[i];
+
+		// Insert nearest neighbour data
+		nn.insert(make_pair(idmin, nn_tmp[i]));
 	}
-	
-	writeConnectedComponents(m_indices, ccs, cc_sizes, nn_data, sim_cutoff);
-	
+
+	// Write connected components to file
+	writeConnectedComponents(m_indices, clmap, nn, sim_cutoff);
+
+	ccs.clear();
+	nn_tmp.clear();
+
+
 	// ------------------------------------------------------------------------------------------
 	// Clustering of connected components
-	
+
 	Log.level(10) << "++ --------------------------------------------------------" << endl;
 	Log.level(10) << "++ STEP 3: Average linkage clustering of connected components" << endl;
-	
+
+	// MAKE ESTIMATION FOR SYSTEM RESOURCE DEMANDS
+	LongSize cc_max = clmap.rbegin()->first;
+	proceed = clusteringMemoryEstimation(cc_max, n_threads, options.getInteger(BinaryFingerprintMethods::Option::BLOCKSIZE));
+	if (!proceed)
+	{
+		Log << "++" << endl;
+		Log << "++ DONE" << endl;
+		Log << "++" << endl;
+
+		return 0;
+	}
+
+	ClusterMap tmp_clmap;
 	vector<unsigned int> cl_indices;
-	vector<vector<unsigned int> > clusters;
 	map<unsigned int, vector<unsigned int> > cluster_selection;
-	map<unsigned int, vector<unsigned int> >::iterator cl_iter;
-	
-	multimap<unsigned int, unsigned int>::iterator iter;
-	for (iter=cc_sizes.begin(); iter!=cc_sizes.end(); ++iter)
+
+	// Connected components that will be clustered must subsequently be removed from the main ClusterMap (clmap).
+	// The corresponding keys are stored here:
+	map<unsigned int, vector<unsigned int> > remove;
+
+	for (ClusterMapIterator size_iter=clmap.begin(); size_iter!=clmap.end(); ++size_iter)
 	{
-		if (iter->first > size_cutoff)
+		for (map<unsigned int, vector<unsigned int> >::iterator cl_iter=size_iter->second.begin(); cl_iter!=size_iter->second.end(); ++cl_iter)
 		{
-			for (unsigned int i=0; i!=ccs[iter->second].size(); ++i)
-			{
-				cl_indices.push_back(m_indices[ccs[iter->second][i]]);
-			}
-			
-			Log.level(10) << "++ CONNECTED COMPONENT SIZE: " << iter->first << endl;
-			bfm.averageLinkageClustering(cl_indices, nn_data[iter->second], cluster_selection);
-			Log.level(10) << "++"  << endl;
-			
-			for (cl_iter=cluster_selection.begin(); cl_iter!=cluster_selection.end(); ++cl_iter)
+			if (size_iter->first > size_cutoff)
 			{
-				clusters.push_back(vector<unsigned int>());
-				for (unsigned int i=0; i!=cl_iter->second.size(); ++i)
+				vector<unsigned int>& tmp_cl = cl_iter->second;
+
+				cl_indices.clear();
+				for (unsigned int i=0; i!=tmp_cl.size(); ++i)
+				{
+					cl_indices.push_back(m_indices[tmp_cl[i]]);
+				}
+
+				Log.level(10) << "++ CONNECTED COMPONENT SIZE: " << size_iter->first << endl;
+				bfm.averageLinkageClustering(cl_indices, nn[cl_iter->first], cluster_selection);
+				Log.level(10) << "++"  << endl;
+
+				// Retrieve every cluster
+				for (map<unsigned int, vector<unsigned int> >::iterator sel_iter=cluster_selection.begin(); sel_iter!=cluster_selection.end(); ++sel_iter)
 				{
-					clusters[clusters.size() - 1].push_back(cl_indices[cl_iter->second[i]]);
+					unsigned int idmin = UINT_MAX;
+
+					tmp_cl.clear();
+					for (unsigned int i=0; i!=sel_iter->second.size(); ++i)
+					{
+						tmp_cl.push_back(cl_indices[sel_iter->second[i]]);
+
+						if (tmp_cl[tmp_cl.size() - 1] < idmin)
+						{
+							idmin = tmp_cl[tmp_cl.size() - 1];
+						}
+					}
+
+					// Insert clusters into tmp_map
+					map<unsigned int, vector<unsigned int> >& sizemap = tmp_clmap[tmp_cl.size()];
+					sizemap[idmin] = tmp_cl;
 				}
+
+				// Store just processed connected component as remove candidate from main clmap
+				vector<unsigned int>& tmp = remove[size_iter->first];
+				tmp.push_back(cl_iter->first);
 			}
-			
-			cl_indices.clear();
-			cluster_selection.clear();
-			nn_data[iter->second].clear();
+
+			nn.erase(cl_iter->first);
 		}
-		else
+	}
+
+
+	// Update main ClusterMap clmap in two steps:
+	// Step 1: remove connected components that were clustered
+	for (map<unsigned int, vector<unsigned int> >::iterator it=remove.begin(); it!=remove.end(); ++it)
+	{
+		map<unsigned int, vector<unsigned int> >& tmp = clmap[it->first];
+		for (unsigned int i=0; i!=it->second.size(); ++i)
 		{
-			nn_data[iter->second].clear();
-			clusters.push_back(vector<unsigned int>());
-			
-			for (unsigned int i=0; i!=ccs[iter->second].size(); ++i)
-			{
-				clusters[clusters.size() -1 ].push_back(m_indices[ccs[iter->second][i]]);
-			}
+			tmp.erase(it->second[i]);
+		}
+
+		if (tmp.empty())
+		{
+			clmap.erase(it->first);
 		}
 	}
-	
+
+	// Step 2: insert new clusters
+	for (ClusterMap::iterator it=tmp_clmap.begin(); it!=tmp_clmap.end(); ++it)
+	{
+		map<unsigned int, vector<unsigned int> >& tmp = clmap[it->first];
+		tmp.insert(it->second.begin(), it->second.end());
+	}
+
+	// Clean up
+	tmp_clmap.clear();
+
+
 	// ------------------------------------------------------------------------------------------
 	// Calculate Medoid of every cluster
-	
+
 	Log.level(10) << "++ --------------------------------------------------------" << endl;
 	Log.level(10) << "++ STEP 4: Calculate medoids for every cluster" << endl;
-	
+
 	bfm.setVerbosityLevel(0);
-	
+
 	unsigned int medoid_index;
-	vector<float> tmp;
-	vector<unsigned int> medoids;
-	vector<vector<float> > avg_sims;
-	
-	for (unsigned int i=0; i!=clusters.size(); ++i)
+	vector<float> tmp_avg_sims;
+	map<unsigned int, pair<unsigned int, vector<float> > > medoids_avg_sims;
+
+	for (ClusterMap::iterator size_iter=clmap.begin(); size_iter!=clmap.end(); ++size_iter)
 	{
-		if (bfm.calculateSelectionMedoid(clusters[i], medoid_index, tmp))
-		{
-			medoids.push_back(clusters[i][medoid_index]);
-			avg_sims.push_back(tmp);
-		}
-		else
+		for (map<unsigned int, vector<unsigned int> >::iterator cl_iter=size_iter->second.begin(); cl_iter!=size_iter->second.end(); ++cl_iter)
 		{
-			Log.error() << "-- WARNING: medoid calculation failed for unkown reason" << endl;
+			if (bfm.calculateSelectionMedoid(cl_iter->second, medoid_index, tmp_avg_sims))
+			{
+				medoids_avg_sims[cl_iter->first] = make_pair(medoid_index, tmp_avg_sims);
+				tmp_avg_sims.clear();
+			}
+			else
+			{
+				Log.error() << "-- WARNING: medoid calculation failed for unkown reason" << endl;
+			}
 		}
 	}
-	
-	
+
+
 	// ------------------------------------------------------------------------------------------
 	// Remap fingerprint duplicates
-	
+
 	Log.level(10) << "++ --------------------------------------------------------" << endl;
 	Log.level(10) << "++ STEP 5: Remap fingerprint duplicates" << endl;
-	
-	
-	String identifier;
+
+
 	unordered_map<unsigned int, set<String> > identifiers;
-	map<String, pair<unsigned int, pair<unsigned int, float> > > cluster_annotation;
-	
 	readMoleculeIdentifiers(identifiers);
-	
-	float avg_sim;
+
+	// Store final cluster information
+	map<String, pair<unsigned int, pair<unsigned int, float> > > final_clusters;
+
 	unsigned int is_medoid;
-	for (unsigned int i=0; i!=clusters.size(); ++i)
+	unsigned int cluster_id = 1;
+	for (ClusterMap::iterator size_iter=clmap.begin(); size_iter!=clmap.end(); ++size_iter)
 	{
-		if (clusters[i].size() == 1)
+		for (map<unsigned int, vector<unsigned int> >::iterator cl_iter=size_iter->second.begin(); cl_iter!=size_iter->second.end(); ++cl_iter)
 		{
-			is_medoid = 1;
-			avg_sim = 1.0;
-			
-			for (set<String>::iterator id_iter=identifiers[clusters[i][0]].begin();id_iter!=identifiers[clusters[i][0]].end(); ++id_iter)
-			{
-				cluster_annotation[*id_iter] = make_pair(i+1, make_pair(is_medoid, avg_sim));
-			}
-		}
-		else
-		{
-			for (unsigned int j=0; j!=clusters[i].size(); ++j)
+
+			if (cl_iter->second.size() == 1)
 			{
-				if (clusters[i][j] == medoids[i])
-				{
-					is_medoid = 1;
-				}
-				else
+				// Singleton cluster
+
+				is_medoid = 1;
+				float avg_sim = 1.0;
+
+				for (set<String>::iterator id_iter=identifiers[cl_iter->second[0]].begin(); id_iter!=identifiers[cl_iter->second[0]].end(); ++id_iter)
 				{
-					is_medoid = 0;
+					final_clusters[*id_iter] = make_pair(cluster_id, make_pair(is_medoid, avg_sim));
 				}
-				
-				avg_sim = avg_sims[i][j];
-				
-				for (set<String>::iterator id_iter=identifiers[clusters[i][j]].begin();id_iter!=identifiers[clusters[i][j]].end(); ++id_iter)
+			}
+			else
+			{
+				medoid_index = medoids_avg_sims[cl_iter->first].first;
+				tmp_avg_sims = medoids_avg_sims[cl_iter->first].second;
+
+				for (unsigned int i=0; i!=cl_iter->second.size(); ++i)
 				{
-					cluster_annotation[*id_iter] = make_pair(i+1, make_pair(is_medoid, avg_sim));
+					if (i == medoid_index)
+					{
+						is_medoid = 1;
+					}
+					else
+					{
+						is_medoid = 0;
+					}
+
+					for (set<String>::iterator id_iter=identifiers[cl_iter->second[i]].begin(); id_iter!=identifiers[cl_iter->second[i]].end(); ++id_iter)
+					{
+						final_clusters[*id_iter] = make_pair(cluster_id, make_pair(is_medoid, tmp_avg_sims[i]));
+					}
 				}
 			}
+
+			++cluster_id;
+			cl_iter->second.clear();
 		}
+
+		size_iter->second.clear();
 	}
-	
+
+
 	// ------------------------------------------------------------------------------------------
 	// Write final clustering
 	
@@ -719,7 +958,7 @@ $ FingerprintSimilarityClustering -t target.sdf -fp_tag FPRINT -f 1 -id_tag NAME
 		GenericMolFile* tmp_out = MolFileFactory::open("FFC_3_final_clustering.sdf", File::MODE_OUT);
 		SDFile* out_sdf = dynamic_cast<SDFile*>(tmp_out);
 		
-		String tmp_nn, identifier;
+		String identifier;
 		String cluster_tag = fp_tag + "_ClusterID";
 		String medoid_tag = fp_tag + "_ClusterMedoid";
 		String avg_sim_tag = fp_tag + "_AverageSim";
@@ -728,11 +967,11 @@ $ FingerprintSimilarityClustering -t target.sdf -fp_tag FPRINT -f 1 -id_tag NAME
 		{
 			identifier = mol->getProperty(id_tag).getString();
 			
-			if (cluster_annotation.find(identifier)!=cluster_annotation.end())
+			if (final_clusters.find(identifier)!=final_clusters.end())
 			{
-				mol->setProperty(cluster_tag, cluster_annotation[identifier].first);
-				mol->setProperty(medoid_tag, cluster_annotation[identifier].second.first);
-				mol->setProperty(avg_sim_tag, cluster_annotation[identifier].second.second);
+				mol->setProperty(cluster_tag, final_clusters[identifier].first);
+				mol->setProperty(medoid_tag, final_clusters[identifier].second.first);
+				mol->setProperty(avg_sim_tag, final_clusters[identifier].second.second);
 			}
 			else
 			{
@@ -767,19 +1006,19 @@ $ FingerprintSimilarityClustering -t target.sdf -fp_tag FPRINT -f 1 -id_tag NAME
 		out << "# AverageSim:    Average similarity of fingerprint to all others in cluster." << endl;
 		out << "MolID ClusterID ClusterMedoid AverageSim" << endl;
 		
-		map<String, pair<unsigned int, pair<unsigned int, float> > >::iterator final_it = cluster_annotation.begin();
-		for (; final_it!=cluster_annotation.end(); ++final_it)
+		map<String, pair<unsigned int, pair<unsigned int, float> > >::iterator final_it = final_clusters.begin();
+		for (; final_it!=final_clusters.end(); ++final_it)
 		{
 			out << final_it->first << " " << final_it->second.first << " " << final_it->second.second.first << " " << final_it->second.second.second << endl;
 		}
 		
 		out.close();
 	}
-	
-	
-	Log.level(10) << "++" << endl;
-	Log.level(10) << "++ DONE" << endl;
-	Log.level(10) << "++" << endl;
+
+
+	Log << "++" << endl;
+	Log << "++ DONE" << endl;
+	Log << "++" << endl;
 	
 	return 0;
 }
diff --git a/source/APPLICATIONS/TOOLS/FingerprintSimilaritySearch.C b/source/APPLICATIONS/TOOLS/FingerprintSimilaritySearch.C
index 1273ed2..93227c6 100644
--- a/source/APPLICATIONS/TOOLS/FingerprintSimilaritySearch.C
+++ b/source/APPLICATIONS/TOOLS/FingerprintSimilaritySearch.C
@@ -270,6 +270,7 @@ int main(int argc, char* argv[])
 	parpars.registerParameter("id_tag", "Tag name for SDF input which contains the molecule identifier", STRING, false, " ");
 	parpars.registerParameter("tc", "Tanimoto cutoff [default: 0.7]", DOUBLE, false, "0.7");
 	parpars.registerParameter("nt", "Number of parallel threads to use. To use all possible threads enter <max> [default: 1]", STRING, false, "1");
+	parpars.registerParameter("bs", "Block size [default: 500]", BALL::INT, false, "500");
 	parpars.registerFlag("sdf_out", "If query file has SD format, this flag activates writing of nearest neighbours as a new CSV tag in a copy of the query SD file.");
 	
 	parpars.setParameterRestrictions("f", 1, 2);
@@ -301,7 +302,8 @@ $ FingerprintSimilaritySearch -t target.sdf -q query.smi -o results -fp_tag FPRI
 	// Set read and parameters
 	fprint_format = parpars.get("f").toInt();
 	float sim_cutoff = parpars.get("tc").toFloat();
-	
+	unsigned int bs = parpars.get("bs").toInt();
+
 	unsigned int n_threads = 1;
 	if (parpars.get("nt") != "1")
 	{
@@ -388,9 +390,8 @@ $ FingerprintSimilaritySearch -t target.sdf -q query.smi -o results -fp_tag FPRI
 	}
 	Log.level(10) << "++" << endl;
 	
-	
 	Options options;
-	options.setDefaultInteger(BinaryFingerprintMethods::Option::BLOCKSIZE, 820);
+	options.setDefaultInteger(BinaryFingerprintMethods::Option::BLOCKSIZE, bs);
 	options.setDefaultReal(BinaryFingerprintMethods::Option::SIM_CUTOFF, sim_cutoff);
 	options.setDefaultInteger(BinaryFingerprintMethods::Option::N_THREADS, n_threads);
 	options.setDefaultInteger(BinaryFingerprintMethods::Option::VERBOSITY, 6);
diff --git a/source/APPLICATIONS/TOOLS/GalaxyConfigGenerator.C b/source/APPLICATIONS/TOOLS/GalaxyConfigGenerator.C
index 7d725c4..2b3e3cc 100644
--- a/source/APPLICATIONS/TOOLS/GalaxyConfigGenerator.C
+++ b/source/APPLICATIONS/TOOLS/GalaxyConfigGenerator.C
@@ -53,10 +53,16 @@ int main(int argc, char* argv[])
 
 	paramfile.readSection(tool_name, tool_description, tool_version, manual, category, parameter_descriptions, parameter_values);
 
+	bool allows_multiple_outputs = false;
+
 	for (list<pair<String,ParameterDescription> >::iterator it=parameter_descriptions.begin();
 		it!=parameter_descriptions.end(); it++)
 	{
 		parameter_map.insert(make_pair(it->first, it));
+		if (it->second.type == GALAXY_OPT_OUTDIR || it->second.type == GALAXY_OPT_OUTID)
+		{
+			allows_multiple_outputs = true;
+		}
 	}
 
 	// write tool-name, id, short description to tool_suite.xml file (if specified)
@@ -84,6 +90,10 @@ int main(int argc, char* argv[])
 		}
 		xml.writeAttribute("name", tool_name.c_str());
 		xml.writeAttribute("version", tool_version.c_str());
+		if (allows_multiple_outputs)
+		{
+			xml.writeAttribute("force_history_refresh", "true");
+		}
 		xml.writeStartElement("description");
 		xml.writeCharacters(tool_description.trim().c_str());
 		xml.writeEndElement();
@@ -103,17 +113,23 @@ int main(int argc, char* argv[])
 	list<String> input_files;
 	list<String> input_parameters;
 	String command = tool_name;
-	command += " \n";
+	command += " \n\t-env galaxy\n";
 	for (list<pair<String,ParameterDescription> >::iterator it=parameter_descriptions.begin();
 		it!=parameter_descriptions.end(); it++)
 	{
-		if (it->first == "par" || it->first == "write_par" || it->first == "help" || it->first == "write_ini" || (tool_name=="PocketDetector" && it->first=="mol_out") || parameters_to_ignore.find(it->first) != parameters_to_ignore.end() || it->second.advanced)
+		if (    it->first == "par"  || it->first == "write_par" 
+		     || it->first == "help" || it->first == "write_ini"
+		     || (tool_name=="PocketDetector" && it->first=="mol_out")
+		     || parameters_to_ignore.find(it->first) != parameters_to_ignore.end()
+		     || (it->second.advanced &&
+			  !(  it->second.type == GALAXY_OPT_OUTDIR
+			    ||it->second.type == GALAXY_OPT_OUTID)))
 		{
 			continue;
 		}
 
 		// Galaxy does not support a dynamic number of output files, yet.
-		// Anne: Au contraire: see BondOrderAssigner
+		// Anne: Au contraire: see  e.g.BondOrderAssigner
 		if (tool_name == "LigandFileSplitter" && it->first == "o")
 		{
 			// use a pre-set number of output-files, i.e. 15
@@ -161,7 +177,23 @@ int main(int argc, char* argv[])
 
 		if (it->second.name != "quiet")
 		{
-			if (it->second.type != INFILELIST)
+			if (it->second.type == GALAXY_OPT_OUTDIR)
+			{
+				command += "#if str( $__new_file_path__ ) != '' and str( $__new_file_path__ ) != 'None' :\n";
+				command += "   -" + it->first + " \"$__new_file_path__\"\n";
+				command += "#end if\n";
+			}
+			else if (it->second.type == GALAXY_OPT_OUTID)
+			{
+				String id_name = it->first.before("_id") + String(".id");
+
+				command += "#if str( $";
+				command += id_name + String(" ) != '' ");
+				command += String(" and str( $") + id_name + String(" ) != 'None' :\n");
+				command += "   -" + it->first + " \"$" + id_name + "\"\n";
+				command += "#end if\n";
+			}
+			else if (it->second.type != INFILELIST)
 			{
 				command += "#if str( $";
 				command += it->first + String(" ) != '' ");
@@ -173,7 +205,7 @@ int main(int argc, char* argv[])
 					{
 						par_name = "o";
 					}
-					command += "   -" + par_name + " \"$" + it->first + "\"\n";
+						command += "   -" + par_name + " \"$" + it->first + "\"\n";
 				}
 				else
 				{
@@ -203,7 +235,7 @@ int main(int argc, char* argv[])
 	}
 
 	// If the job does not fail, Galaxy will only display a few lines of the tool's output, so make sure to show the relevant (i.e. the last) lines.
-	command += " | tail -n 5\n";
+//	command += " | tail -n 5\n";
 
 	// Sort inputs in such a way that input-files come first, and other input-parameters later.
 	// It just looks nicer in the webinterface ...
@@ -227,6 +259,10 @@ int main(int argc, char* argv[])
 	else xml.writeAttribute("id",search_it->second.c_str());
 	xml.writeAttribute("name",tool_name.c_str());
 	xml.writeAttribute("version",tool_version.c_str());
+	if (allows_multiple_outputs)
+	{
+		xml.writeAttribute("force_history_refresh", "True");
+	}
 	xml.writeStartElement("requirements");
 	xml.writeStartElement("requirement");
 	xml.writeAttribute("type", "package");
@@ -241,6 +277,14 @@ int main(int argc, char* argv[])
 	xml.writeCDATA(command.c_str()); // Do not use writeCharacters() here, because it would excape the "-" signs within the repeat-sections, which chetah needs!
 	xml.writeEndElement();
 
+	/// Tell galaxy to use exit codes instead of stderr to recognize failures...
+	xml.writeStartElement("stdio");
+	xml.writeStartElement("exit_code");
+	xml.writeAttribute("range", "1:");
+	xml.writeAttribute("level", "fatal");
+	xml.writeEndElement();
+	xml.writeEndElement();
+
 	/// Write input section
 	xml.writeStartElement("inputs");
 	for (list<String>::iterator it = inputs.begin(); it != inputs.end(); it++)
diff --git a/source/APPLICATIONS/TOOLS/LigandFileSplitter.C b/source/APPLICATIONS/TOOLS/LigandFileSplitter.C
index 99e5b92..f1fb297 100755
--- a/source/APPLICATIONS/TOOLS/LigandFileSplitter.C
+++ b/source/APPLICATIONS/TOOLS/LigandFileSplitter.C
@@ -9,277 +9,372 @@
 #include <BALL/KERNEL/molecule.h>
 #include "version.h"
 
+#include<math.h>
+
+
 using namespace BALL;
 using namespace std;
 
-void validateParameters(CommandlineParser& params)
+
+void validateParameters(CommandlineParser& parpars)
 {
-    // we need at least one of the following: no, ligands_per_file
-    // TODO: move this "one of the following parameters" logic to CommandlineParser!
-    if (!params.has("no") && !params.has("ligands_per_file"))
+  if (parpars.has("o"))
+	{
+    if (parpars.has("output_name_pattern"))
     {
-        Log.error() << "One of the parameters 'no' and 'ligands_per_file' is required." << endl;
-        exit(1);
+      Log.level(10) << "\rNOTE: Parameter 'output_name_pattern' is ignored because filenames are specified explicitly." << endl;
     }
-    if (params.has("no") && params.has("ligands_per_file"))
+    if (parpars.has("no"))
     {
-        Log.error() << "At most one of the parameters 'no' and 'ligands_per_file' is required. You have provided both." << endl;
-        exit(1);
+      Log.level(10) << "\rNOTE: Parameter 'no' is ignored because filenames are specified explicitly." << endl;
     }
-    // TODO: move this to CommandlineParser... using 'registerParameterRestrictions' does not seem to be working
-    if (params.has("no"))
+    if (parpars.has("ligands_per_file"))
     {
-        if (params.get("no").toInt() < 1)
-        {
-            Log.error() << "The provided value for parameter 'no', " << params.get("no").toInt() << ", is invalid. Values must be greater or equal to 1." << endl;
-            exit(1);
-        }
+      Log.level(10) << "\rNOTE: Parameter 'mpf' is ignored because filenames are specified explicitly." << endl;
     }
-	String ligandsPerFile = params.get("ligands_per_file");
-	if (ligandsPerFile != CommandlineParser::NOT_FOUND)
+	}
+  else
+  {
+    if (parpars.has("no"))
     {
-        if (params.get("ligands_per_file").toInt() < 1)
+
+      if (parpars.has("o"))
+      {
+        Log.level(10) << "\rNOTE: Parameter 'o' is ignored because the number of output files is specified explicitly." << endl;
+      }
+      if (parpars.has("ligands_per_file"))
+      {
+        Log.level(10) << "\rNOTE: Parameter 'mpf' is ignored because the number of output files is specified explicitly." << endl;
+      }
+    }
+    else
+    {
+      if (parpars.has("mpf"))
+      {      
+        if (parpars.has("no"))
         {
-            Log.error() << "The provided value for parameter 'ligands_per_file', " << params.get("ligands_per_file").toInt() << ", is invalid. Values must be greater or equal to 1." << endl;
-            exit(1);
+          Log.level(10) << "\rNOTE: Parameter 'no' is ignored because the number of ligands per output file is specified explicitly." << endl;
         }
-	}
-	String outputNamePattern = params.get("output_name_pattern");
-	if (outputNamePattern != CommandlineParser::NOT_FOUND)
+        if (parpars.has("o"))
+        {
+          Log.level(10) << "\rNOTE: Parameter 'o' is ignored because the number of ligands per output file is specified explicitly." << endl;
+        }
+      }
+      else
+      {
+        // No parameter passed that can be used to determine how to split.
+        // EXIT
+        
+        Log.error() << "\rERROR: No parameter passed to specify how to split." << endl;
+        Log.error() << "\r       Please set either 'no', 'o' or 'mpf'." << endl;
+        Log.error() << "\r       Exit without producing output files." << endl;
+
+        exit(1);
+      }
+    }
+  }
+  
+
+	if (parpars.has("outname_pattern"))
 	{
-		// count the number of '%d' and exit if the name is different to one
-		string::size_type firstPlaceholder = outputNamePattern.find("%d");
-		string::size_type lastPlaceholder = outputNamePattern.rfind("%d");
-		// if there is more than one %d, it means that the index of the first and last occurrences are different
+    String outname_pattern = parpars.get("outname_pattern");  
+		
+    // count the number of '%d' and exit if the name is different to one
+		string::size_type placeholder_1 = outname_pattern.find("%d");
+		string::size_type placeholder_2 = outname_pattern.rfind("%d");
+		
+    // if there is more than one %d, it means that the index of the first and last occurrences are different
 		// if there is not a single %d, then the index of both first and last occurrences must be npos
-		if (firstPlaceholder != lastPlaceholder || firstPlaceholder == String::npos)
+		if (placeholder_1 != placeholder_2 || placeholder_1 == String::npos)
 		{
-			Log.error() << "The provided value for output_name_pattern '" << outputNamePattern << "' is invalid." << endl;
+			Log.error() << "Error: The provided value for outname_pattern '" << outname_pattern << "' is invalid." << endl;
+      Log.error() << "       Exit without producing output files." << endl;
 			exit(1);
 		}
 	}
 }
 
-String getFileFormat(String& fileName)
-{
-    // locate the first dot, from right to left
-    int dotIndex = fileName.find_last_of('.');
-    if (dotIndex < 0)
-    {
-        return "";
-    }
-    return fileName.substr(dotIndex + 1, fileName.length() - dotIndex - 1);
-}
 
-String getOutputFileFormat(CommandlineParser& parameters)
+String getOutputFileName(String& outname_base, bool is_pattern, String& outfile_type, unsigned int index)
 {
-	// give preference to the 'output_format' parameter,
-	// if not found, then use the format of the input file
-	String format = parameters.get("output_format");
-	if (format != CommandlineParser::NOT_FOUND)
+	String outfile_name = outname_base;
+  
+	if (is_pattern)
 	{
-		return format;
+		outfile_name.substituteAll("%d", String(index));
 	}
-	String inputFile = parameters.get("i");
-	return getFileFormat(inputFile);
+	else
+	{
+		outfile_name = outfile_name + String("_") + String(index)  + "." + outfile_type;
+	}
+	
+	return outfile_name;
 }
 
-String getOutputFileName(CommandlineParser& parameters, int index)
-{
-	String outputNamePattern = parameters.get("output_name_pattern");
-	String outputFileName;
-	if (outputNamePattern != CommandlineParser::NOT_FOUND)
-    {
-		outputNamePattern.substituteAll("%d", String(index));
-		outputFileName = outputNamePattern;
-    }
-    else
-    {
-		String inputFileName = parameters.get("i");
-		String extension = '.' + getFileFormat(inputFileName);
-
-		// if invoked with -i ligands.sdf, output name will be ligands_<index>.sdf
-		outputFileName = inputFileName.before(extension) + String("_") + String(index) + extension;
-    }
-	return outputFileName;
-}
 
 int main(int argc, char* argv[])
 {
-    CommandlineParser parpars("LigandFileSplitter", "split molecule files", VERSION, String(__DATE__), "Preparation");
+  CommandlineParser parpars("LigandFileSplitter", "split molecule files", VERSION, String(__DATE__), "Preparation");
 	parpars.registerParameter("i", "input molecule file", INFILE, true);
-    parpars.registerParameter("no", "no. of splits to be created", BALL::INT, false);
-    parpars.registerParameter("ligands_per_file", "max. number of ligands to output to a file", BALL::INT, false);
-	parpars.registerParameter("output_name_pattern", "pattern that will be used to generate the names of the output files, see notes and examples below.", BALL::STRING, false);
-	parpars.registerParameter("o", "output filenames; if none are specified, input filename postfixed with IDs will be used", OUTFILELIST, false);
-	parpars.registerParameter("output_format", "format of the output filenames, see notes and examples below.", BALL::STRING, false);
+  parpars.registerParameter("no", "Number of output files to be created", BALL::INT, false);
+  parpars.registerParameter("mpf", "Number of molecules per output file", BALL::INT, false);
+	parpars.registerParameter("outname_pattern", "Pattern that will be used to generate the names of the output files, see notes and examples below.", BALL::STRING, false);
+	parpars.registerParameter("o", "Output filenames. If none are specified, input filename postfixed with IDs will be used", OUTFILELIST, false);
+  
 	String man =
-			"LigandFileSplitter splits a molecule file into a given number of subsets.\n"
-			"Note that the molecules are not sorted in any way for this.\n\n"
-			"Examples:\n\n"
-			"$ LigandFileSplitter -i Trypsin_actives.sdf -no 3\n"
-			"    will split the input file Trypsin_actives.sdf in three files named Trypsin_actives_0.sdf, Trypsin_actives_1.sdf and Trypsin_actives_2.sdf\n\n"
-			"$ LigandFileSplitter -i ligands.sdf -ligands_per_file 4\n"
-			"    will split the input file ligands.sdf in as many files needed to fit at most 4 ligands per file.\n"
-			"    The files will be named ligands_0.sdf, ligands_1.sdf ... ligands_N.sdf\n\n"
-			"$ LigandFileSplitter -i ligands.sdf -ligands_per_file 5 -output_name_pattern split_ligands-%d.sdf\n"
-			"    will split the input file ligands.sdf in as many files needed to fit at most 5 ligands per file.\n"
-			"    The files will be named split_ligands-0.sdf, split_ligands-1.sdf, ... , split_ligands-N.sdf\n"
-			"    and they will have sdf format.\n\n"
-			"$ LigandFileSplitter -i ligands.sdf -output_name_pattern split_ligands.mol2_%d -output_format mol2 -no 100\n"
-			"    will split the input file ligands.sdf in 100 files using the following names:\n"
-			"    split_ligands.mol2_0, split_ligands.mol2_1, ... , split_ligands.mol2_99\n"
-			"    The output files will have mol2 format. If the 'output_format' parameter is not given, then the ouput files\n"
-			"    will have the same format as the input file (sdf).\n\n"
-			"NOTE:\n"
-			"    output_name_pattern accepts a printf-like pattern, expecting exactly one decimal integer placeholder, %d.\n"
-			"    The following are valid patterns: output_ligand.sdf_%d, split_%d.mol, %d_lig.drf\n"
-			"    The following are invalid patterns: output_%f.sdf, ligands.drf_%u, %d_lig_%d.mol, molecules.sdf\n"
-			"    If you want the output files to have a different format than the given input file, use the 'output_format' parameter.";
+	"LigandFileSplitter splits a molecule file into a given number of subsets.\n\n"
+
+	"Examples:\n\n"
+
+  "$ LigandFileSplitter -i Trypsin_actives.sdf -o batch_1 batch_2\n"
+	"  will split the input file Trypsin_actives.sdf in the two output files batch_1.sdf and batch_2.sdf.\n\n"
+	
+  "$ LigandFileSplitter -i Trypsin_actives.sdf -no 3\n"
+	"  will split the input file Trypsin_actives.sdf in three files named Trypsin_actives_0.sdf, Trypsin_actives_1.sdf and Trypsin_actives_2.sdf\n\n"
+	
+  "$ LigandFileSplitter -i ligands.sdf -ligands_per_file 4\n"
+	"  will split the input file ligands.sdf in as many files needed to fit at most 4 ligands per file.\n"
+	"  The files will be named ligands_0.sdf, ligands_1.sdf ... ligands_N.sdf\n\n"
+	
+  "$ LigandFileSplitter -i ligands.sdf -ligands_per_file 5 -outname_pattern split_ligands-%d.sdf\n"
+	"  will split the input file ligands.sdf in as many files needed to fit at most 5 ligands per file.\n"
+  "  The files will be named split_ligands-0.sdf, split_ligands-1.sdf, ... , split_ligands-N.sdf.\n\n"
+			  
+  "$ LigandFileSplitter -i ligands.sdf -outname_pattern split_ligands_%d.sdf -no 100\n"
+	"  will split the input file ligands.sdf in 100 files using the following names:\n"
+	"  split_ligands_0.sdf, split_ligands_1.sdf, ... , split_ligands_99.sdf.\n\n"
+			
+  "NOTES:\n"
+	"- Molecules are not sorted in any way.\n"
+	"- The tool is no format converter and the format of the output files will be the same as of the input file.\n"
+	"- Output_name_pattern accepts a printf-like pattern, expecting exactly one decimal integer placeholder, %d.\n"
+	"- The following are valid patterns: output_ligand.sdf_%d, split_%d.mol, %d_lig.drf\n"
+	"- The following are invalid patterns: output_%f.sdf, ligands.drf_%u, %d_lig_%d.mol, molecules.sdf\n\n"
+  
+  "WARNING:\n"
+	"- If the parameter outname_pattern is specified, the user is responsible for the occurrence of a valid file extension\n"
+	"  in the outname_pattern, which has to be of the same file format as the input file.\n\n";
+  
 	parpars.setToolManual(man);
 	parpars.setSupportedFormats("i","mol2,sdf,drf");
 	parpars.setSupportedFormats("o","mol2,sdf,drf");
 	parpars.setOutputFormatSource("o","i");
-    parpars.parse(argc, argv);
+ 	parpars.parse(argc, argv);
+  
+  
+  // Check if parameter setting is valid and/or useful  
+ 	validateParameters(parpars);
 
-    validateParameters(parpars);
+  
+  unsigned int n_molecules = 0;
+  unsigned int n_outfiles = 0;
+  unsigned int mpf = 0;
+  
+  String infile = parpars.get("i");
+  String infile_name = infile.substr(0, infile.find_last_of('.'));
+  String infile_type = infile.substr(infile.find_last_of('.') + 1, infile.length() - infile.find_last_of('.') - 1);
+  
+  vector<String> outfile_names;
+  HashSet <String> conformation_ids;
+  
+  Molecule* mol;
+ 	GenericMolFile* input;
+  GenericMolFile* output;
 
-    GenericMolFile* input = MolFileFactory::open(parpars.get("i"));
+  DockResultFile* drf_input;
+  DockResultFile* drf_output;  
+  
 
 	// Determine number of molecules in input files.
-	// In case of DockResultFiles, we do not need to process all contained molecules in order to achieve this; we can simply count the result-section entries.
-    int no_compounds = 0;
-	DockResultFile* drf_input = dynamic_cast<DockResultFile*>(input);
+	// In case of DockResultFiles, we do not need to process all contained molecules 
+	// in order to achieve this; we can simply count the result-section entries.
+  
+  input = MolFileFactory::open(infile);
+	
+  drf_input = NULL;
+  drf_input = dynamic_cast<DockResultFile*>(input);
 	if (drf_input)
 	{
-		no_compounds = drf_input->countConformations();
-		Log.level(10)<<"\rinput-file contains "<<no_compounds<<" conformations."<<endl;
+		n_molecules = drf_input->countConformations();
 	}
 	else
 	{
-		for (Molecule* mol = input->read(); mol; mol = input->read())
+ 		Log.level(10) << "\rCount number of molecules in input file ..." << endl;
+		for (mol = input->read(); mol; mol = input->read())
 		{
-			no_compounds++;
+			++n_molecules;
 			delete mol;
-			if (no_compounds%50 == 0)
-			{
-				Log.level(10)<<"\r"<<no_compounds<<" molecules";
-				Log.flush();
-			}
 		}
-		Log.level(10)<<"\rinput-file contains "<<no_compounds<<" molecules."<<endl;
-	}
+	}	
+	
+	Log.level(10) << "\r" << n_molecules << " molecules found." << endl << endl;
 
 	input->close();
 	delete input;
 
-    // if ligands_per_file was provided, simply insert the parameter 'no' with a proper value
-    int numberOfFiles = -1;
-    if (parpars.has("ligands_per_file"))
-    {
-        int ligandsPerFile = parpars.get("ligands_per_file").toInt();
-        // we know the number of ligands per file and the number of input ligands, so:
-        numberOfFiles = no_compounds / ligandsPerFile;
-        if ((numberOfFiles * ligandsPerFile) < no_compounds)
-        {
-            numberOfFiles++;
-        }
-    }
-
-	input = MolFileFactory::open(parpars.get("i"));
-	drf_input = dynamic_cast<DockResultFile*>(input);
-	if (drf_input) drf_input->selectAllResultsForInput();
-
-    // if numberOfFiles != -1, it means that ligands_per_file was set
-    int no_splits = numberOfFiles == -1 ? parpars.get("no").toInt() : numberOfFiles;
-	vector<String> output_files;
+	
+	// Check which split method should be applied
+	
 	if (parpars.has("o"))
 	{
-		list<String> l = parpars.getList("o");
-		for (list<String>::iterator it = l.begin(); it!=l.end(); it++)
-		{
-			output_files.push_back(*it);
-		}
+		// Option 1:
+		// Number of output files specified by explicit name passing.
+		// Parameter 'o' is specified
+    
+		list<String> tmp = parpars.getList("o");
+    for (list<String>::iterator iter = tmp.begin(); iter != tmp.end(); ++iter)
+    {
+      outfile_names.push_back(*iter + "." + infile_type);
+    }
+    
+		n_outfiles = outfile_names.size();
+  
+    if (n_molecules >= n_outfiles)
+    {
+      mpf = floor((double)n_molecules / n_outfiles);
+    }
+    else
+    {
+      Log.level(10) << "\rNOTE: Number of molecules in input file is smaller than number of specified output files." << endl;
+      n_outfiles = n_molecules;
+      mpf = 1;
+    }
 	}
+  else
+  {
+    if (parpars.has("no"))
+    {
+      // Option 2:
+		  // Number of output files is specified directly.
+		  // Parameter 'no' is specified
+      
+      n_outfiles = parpars.get("no").toInt();
+      
+      if (n_molecules >= n_outfiles)
+      {
+        mpf = floor((double)n_molecules / n_outfiles);
+      }
+      else
+      {
+        Log.level(10) << "\rNOTE: Number of molecules in input file is smaller than specified number of output files." << endl;
+        n_outfiles = n_molecules;
+        mpf = 1;
+      }
+    }
+    else
+    {
+      if (parpars.has("mpf"))
+      {
+        // Option 3:
+        // Number of molecules per output file is specified directly.
+        // Parameter 'mpf' is specified
+      
+        mpf = parpars.get("mpf").toInt();
+        n_outfiles = ceil((double)n_molecules / (double)mpf);
+      }
+    }
+    
+    
+    // Generate output file names
+    
+    if (parpars.has("outname_pattern"))
+    {
+      // Option 1: Generate output file names from specified pattern
 
-	int comp_per_split = no_compounds/no_splits;
-	int remainer = no_compounds-(comp_per_split*no_splits);
-	int written_compounds = 0;
-
-	Log.level(10)<<endl<<"will now write split-files :"<<endl;
-
-	for (int i = 0; i < no_splits; i++)
-	{
-		String filename;
-		GenericMolFile* output;
-		if ((int)output_files.size() > i)
-		{
-			filename = output_files[i];
-			// honor the use of "output_format"
-			String format = parpars.get("output_format");
-			if (format != CommandlineParser::NOT_FOUND)
-			{
-				output = MolFileFactory::open(filename, ios::out, format);
-			}
-			else
-			{
-				output = MolFileFactory::open(filename, ios::out, input);
-			}
-
-		}
-		else
-		{
-            filename = getOutputFileName(parpars, i);
-			output = MolFileFactory::open(filename, ios::out, getOutputFileFormat(parpars));
-		}
-
-		DockResultFile* drf_output = dynamic_cast<DockResultFile*>(output);
-		if (drf_input && drf_output) drf_output->disableAutomaticResultCreation();
-
-		HashSet < String > conformation_IDs;
+      String pattern = parpars.get("outname_pattern");
+      
+      for (unsigned int i=0; i!= n_outfiles; ++i)
+      {
+        outfile_names.push_back(getOutputFileName(pattern, true, infile_type, i));
+      }
+    }
+    else
+    {
+      // Option 2: Simple indexing of input file name
+      
+      for (unsigned int i=0; i!= n_outfiles; ++i)
+      {
+        outfile_names.push_back(getOutputFileName(infile_name, false, infile_type, i));
+      }
+    }
+      
+  }
+  
+  
+  // Now do the splitting
+  
+  input = MolFileFactory::open(infile);
 
-		int written_compounds_current_split = 0;
-		for (int j = 0; j < comp_per_split ||
-			(i == no_splits-1&&written_compounds<no_compounds); j++)
-		{
-			Molecule* mol = input->read();
-			if (!mol) break;
-			if (drf_input && drf_output && mol->hasProperty("Conformation_input_UID"))
-			{
-				conformation_IDs.insert(mol->getProperty("Conformation_input_UID").toString());
-			}
+  drf_input = NULL;
+	drf_input = dynamic_cast<DockResultFile*>(input);
+	if (drf_input) 
+  {
+    drf_input->selectAllResultsForInput();
+  }
+  
+  for (unsigned int i=0; i!=outfile_names.size(); ++i)
+  {
+    conformation_ids.clear();
+    
+    output = MolFileFactory::open(outfile_names[i], ios::out, infile_type);
+    drf_output = dynamic_cast<DockResultFile*>(output);
+    if (drf_input && drf_output)
+    {
+      drf_output->disableAutomaticResultCreation();
+    }
 
-			*output << *mol;
-			delete mol;
-			written_compounds++;
-			written_compounds_current_split++;
-			if (written_compounds_current_split%50 == 0)
-			{
-				Log.level(20)<<"\r"<<filename<<": "<<written_compounds_current_split;
-				Log.flush();
-			}
-		}
+    
+    if (i < outfile_names.size()-1)
+    {
+      // Not the last file - so number of molecules is standard
+      
+      for (unsigned int j=0; j!=mpf; ++j)
+      {
+        mol = input->read();
+        if (drf_input && drf_output && mol->hasProperty("Conformation_input_UID"))
+        {
+          conformation_ids.insert(mol->getProperty("Conformation_input_UID").toString());
+        }
 
-		if (drf_input && drf_output)
-		{
-			const vector<Result*>* results = drf_input->getResults();
-			for (Size i = 0; i < results->size(); i++)
-			{
-				Result* new_res = new Result(*(*results)[i], conformation_IDs);
-				drf_output->addResult(new_res);
-			}
-		}
+        output->write(*mol);
+        delete mol;
+      }
+    }
+    else
+    {
+      // Last output file - so write remaining molecules into it
+      
+      mol = input->read();
+      while (mol)
+      {
+        if (drf_input && drf_output && mol->hasProperty("Conformation_input_UID"))
+        {
+          conformation_ids.insert(mol->getProperty("Conformation_input_UID").toString());
+        }
 
-		// evenly distribute remaining compounds
-		if (remainer > 1 && i == no_splits-1-remainer)
-		{
-			comp_per_split++;
-		}
+        output->write(*mol);
+        delete mol;
+        mol = input->read();
+      }
+    }
 
-		Log.level(20)<<"\r"<<filename<<": "<<written_compounds_current_split<<endl;
-		delete output;
-	}
+    if (drf_input && drf_output)
+    {
+      const vector<Result*>* results = drf_input->getResults();
+      for (unsigned int i = 0; i < results->size(); ++i)
+      {
+        Result* new_res = new Result(*(*results)[i], conformation_ids);
+        drf_output->addResult(new_res);
+      }
+    }
+    
+    output->close();
+    delete output;
+  }  
 
-	delete input;
-	return 0;
+  input->close();
+  delete input;
+  
+  
+  return 0;
 }
diff --git a/source/APPLICATIONS/TOOLS/MolecularFileConverter.C b/source/APPLICATIONS/TOOLS/MolecularFileConverter.C
index 2533242..4f4c622 100644
--- a/source/APPLICATIONS/TOOLS/MolecularFileConverter.C
+++ b/source/APPLICATIONS/TOOLS/MolecularFileConverter.C
@@ -8,27 +8,26 @@
 #include <BALL/KERNEL/system.h>
 #include <BALL/FORMAT/commandlineParser.h>
 
+#include "version.h"
+
 using namespace BALL;
 
 int main(int argc, char* argv[])
 {
 	// instantiate CommandlineParser object
-	CommandlineParser parpars("MolecularFileConverter", "converts molecular file-formats", "bla", String(__DATE__), "File conversion");
+	CommandlineParser parpars("MolecularFileConverter", "converts molecular file-formats", VERSION, String(__DATE__), "File conversion");
 	parpars.registerParameter("i",  "input file",    INFILE,  true);
 	parpars.registerParameter("of", "output format", STRING,  false);
 	parpars.registerParameter("o",  "output file",   OUTFILE, true);
 
-
-	// TODO: was machen wir mit der of option?
-
 	// the available formats
 	String supp_formats = MolFileFactory::getSupportedFormats();
+	// we support: mol2, sdf, drf, pdb, ac, ent, brk, hin, mol, xyz, 
+	// mol2.gz, sdf.gz, drf.gz, pdb.gz, ac.gz, ent.gz, brk.gz, hin.gz, mol.gz, xyz.gz.
 
 	// the manual
 	String man = String("This tool converts different molecular file formats.\nSupported formats are ") + supp_formats + String(".");
-	// TODO welcher wollen wir anbieten in BOA?
-	// Marcels allgemeiner Converter kann: mol2, sdf, drf, pdb, ac, ent, brk, hin, mol, xyz, 
-	// mol2.gz, sdf.gz, drf.gz, pdb.gz, ac.gz, ent.gz, brk.gz, hin.gz, mol.gz, xyz.gz.
+
 	parpars.setToolManual(man);
 
 	parpars.setSupportedFormats("i", supp_formats);
@@ -61,13 +60,13 @@ int main(int argc, char* argv[])
 	{
 		// if file does not exist: complain and abort
 		Log.error() << "error opening " << parpars.get("i") << " for input." << std::endl;
-		return 2;
+		exit(2);
 	}
 	if (!out_file)
 	{
 		// if file does not exist: complain and abort
 		Log.error() << "error opening " << parpars.get("o") << " for output." << std::endl;
-		return 2;
+		exit(2);
 	}
 
 	// create a system and read the contents of the molecular file
@@ -80,6 +79,7 @@ int main(int argc, char* argv[])
 	{
 		out_file->write(S);
 		out_file->close();
+		Log.info() << "Wrote converted file " << parpars.get("o") << std::endl;
 	}
 
 	delete in_file;
diff --git a/source/APPLICATIONS/TOOLS/PDBRMSDCalculator.C b/source/APPLICATIONS/TOOLS/PDBRMSDCalculator.C
new file mode 100644
index 0000000..0acc169
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/PDBRMSDCalculator.C
@@ -0,0 +1,308 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+// A tool for computing rmsd between proteins
+//
+//
+
+#include <BALL/DOCKING/COMMON/poseClustering.h>
+#include <BALL/FORMAT/DCDFile.h>
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/FORMAT/lineBasedFile.h>
+#include <BALL/FORMAT/commandlineParser.h>
+#include <BALL/STRUCTURE/structureMapper.h>
+#include <BALL/SYSTEM/timer.h>
+#include <iostream>
+#include "version.h"
+
+using namespace std;
+using namespace BALL;
+
+int main (int argc, char **argv)
+{
+	Timer t;
+
+	// instantiate CommandlineParser object supplying
+	// - tool name
+	// - short description
+	// - version string
+	// - build date
+	// - category
+	CommandlineParser parpars("PDBRMSDCalculator", "computes RMSD between protein poses ", VERSION, String(__DATE__), "Docking");
+
+	// we register an input file parameter 
+	// - CLI switch
+	// - description
+	// - Inputfile
+	parpars.registerParameter("i_pdb", "input pdb-file", INFILE, true);
+	parpars.registerParameter("i_query", "molecule(s) to compare input file", INFILE, false);
+
+	parpars.registerParameter("i_type", "query type (pdb, dcd, or transformation file (rigid_transformations) ", STRING, false, "pdb");
+	list<String> input_types;
+	input_types.push_back("pdb");
+	input_types.push_back("dcd");
+	input_types.push_back("rigid_transformations");
+	parpars.setParameterRestrictions("i_type", input_types);
+
+	parpars.registerParameter("o", "output file name", OUTFILE, false, "", true);
+
+	// choice of atom rmsd scope 
+	parpars.registerParameter("scope", "atoms to be considered for scoreing a pose (C_ALPHA, BACKBONE, ALL_ATOMS) ", STRING, false, "C_ALPHA");
+	list<String> rmsd_levels;
+	rmsd_levels.push_back("C_ALPHA");
+	//rmsd_levels.push_back("HEAVY_ATOMS"); //TODO
+	rmsd_levels.push_back("BACKBONE");
+	rmsd_levels.push_back("ALL_ATOMS");
+	parpars.setParameterRestrictions("scope", rmsd_levels);
+
+	// choice of rmsd type
+	parpars.registerParameter("rmsd_type", "rmsd type used for clustering (SNAPSHOT_RMSD, RIGID_RMSD, CENTER_OF_MASS_DISTANCE) ", STRING, false, "SNAPSHOT_RMSD");
+	list<String> rmsd_types;
+	rmsd_types.push_back("SNAPSHOT_RMSD");
+	rmsd_types.push_back("RIGID_RMSD");
+	rmsd_types.push_back("CENTER_OF_MASS_DISTANCE");
+	parpars.setParameterRestrictions("rmsd_type", rmsd_types);
+
+	// TODO: parameter for preceding determination of RMSD minimizing transformation?
+	//parpars.registerFlag("find_transformation", "");
+
+
+	// the manual
+	String man = "This tool computes the RMSD between proteins.\n\nParameters are either a second input file (i_query) who's type has to be specified (i_type) and can be either a single pdb, a dcd or a transformation file. Optional parameters are the rmsd type (-rmsd_type), and the type of atoms used for scoring a pose (-scope).\n\nOutput of this tool is a either the rmsd (in the pdb-pdb case) or a file (-o) containing the RMSD between the first pose and all other poses.";
+
+	parpars.setToolManual(man);
+
+	// here we set the types of I/O files
+	parpars.setSupportedFormats("i_pdb","pdb");
+	parpars.setSupportedFormats("i_query","pdb,dcd,txt");
+	parpars.setSupportedFormats("o","txt");
+
+	parpars.parse(argc, argv);
+
+	//////////////////////////////////////////////////
+
+	// read the input	
+	PDBFile pdb;
+	pdb.open(parpars.get("i_pdb"));
+	System sys;
+	pdb.read(sys);
+
+	// read the second file	
+	if (parpars.has("i_type") && parpars.has("i_query"))
+	{
+		String query_type = parpars.get("i_type");
+		String second_file = parpars.get("i_query");
+
+		ConformationSet cs;
+		cs.setup(sys);
+
+		PoseClustering pc;
+		String type = "";
+		if (parpars.has("rmsd_type"))
+		{
+			type = parpars.get("rmsd_type");
+		}
+		else
+		{
+			Log.info() << "Missing parameter rmsd_type! Abort!" << endl;
+			return 1;
+		}
+
+		if (type == "SNAPSHOT_RMSD")
+		{
+			pc.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::SNAPSHOT_RMSD);
+		}
+		else if (type == "RIGID_RMSD")
+		{
+			pc.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::RIGID_RMSD);
+		}
+		else if (type == "CENTER_OF_MASS_DISTANCE")
+		{
+				pc.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::CENTER_OF_MASS_DISTANCE);
+				Log << "Parameter scope will be ignored!" << endl;
+		}
+
+		if (parpars.has("scope"))
+		{
+			String scope = parpars.get("scope");
+			if (scope == "C_ALPHA")
+				pc.options.set(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL, PoseClustering::C_ALPHA);
+			else if (scope == "BACKBONE")
+				pc.options.set(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL, PoseClustering::BACKBONE);
+			else if (scope == "ALL_ATOMS")
+				pc.options.set(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL, PoseClustering::ALL_ATOMS);
+			else
+				Log.info() << "Unknown value " << scope  << " for option scope." << endl;
+		}
+
+		// we have basically two scenarios: pdb vs pdb or pdb vs list of poses (DCD or transformation).
+		//   PDB
+		if (query_type == "pdb")
+		{
+			PDBFile pdb2;
+			pdb2.open(parpars.get("i_query"));
+			System sys_query;
+			pdb2.read(sys_query);
+
+			Log << "RMSD: " << pc.getScore(sys, sys_query, pc.options) << std::endl;
+			Log << "done." << endl;
+
+			return 0;
+		} // DCD
+		else if (query_type == "dcd")
+		{
+			cs.readDCDFile(parpars.get("i_query"));
+			cs.resetScoring();
+			pc.setConformationSet(&cs, true);
+
+			if (type == "RIGID_RMSD")
+			{
+				pc.convertSnaphots2Transformations();
+			}
+
+		} // rigid transformations
+		else if (query_type == "rigid_transformations")
+		{
+			// reads the poses given as transformations from a file and update the covariance matrix !
+			pc.setBaseSystemAndTransformations(sys, parpars.get("i_query"));
+
+			if (type == "SNAPSHOT_RMSD")
+			{
+				pc.convertTransformations2Snaphots();
+			}
+		}
+		else
+		{
+			Log << "Invalid query option! Abort!" << endl;
+		}
+
+		bool file_output = false;
+		File rmsd_outfile;
+		if (parpars.has("o"))
+		{
+			String outfile_name = String(parpars.get("o"));
+			rmsd_outfile.open(outfile_name, std::ios::out);
+			file_output = true;
+		}
+
+		// do the computations	
+		if (type == "RIGID_RMSD")
+		{
+			// TODO need the Atommapping etc??
+			Size num_poses = pc.getNumberOfPoses();
+
+			Eigen::Matrix3f covariance_matrix = pc.computeCovarianceMatrix(sys, pc.options.getInteger(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL));
+			std::vector<PoseClustering::RigidTransformation> const & rigid_transformations = pc.getRigidTransformations();
+
+			PoseClustering::RigidTransformation const & transform_i = rigid_transformations[0];
+
+			for (Size i=0; i<num_poses; i++)
+			{
+				float result=0;
+	// just for testing...
+	//for (Size j=0; j<500; j++)
+	//{
+				PoseClustering::RigidTransformation const & transform_j = rigid_transformations[i];
+
+				t.start();
+				result = pc.getRigidRMSD(transform_i.translation - transform_j.translation,
+					                             transform_i.rotation - transform_j.rotation,
+												               covariance_matrix);
+				t.stop();
+	//} 
+			if (file_output)
+				rmsd_outfile << "RMSD for " << i << " : " << result << endl;
+			else
+				Log << "RMSD for " << i << " : " << result << endl;
+			}
+		}
+		else if (type ==  "SNAPSHOT_RMSD")
+		{
+			System system_i = sys;
+			System system_j = sys;
+
+			std::vector<SnapShot> const& snaps = pc.getConformationSet()->getUnscoredConformations();
+
+			StructureMapper mapper(system_i, system_j);
+			AtomBijection atom_bijection;
+
+			Index rmsd_level_of_detail = pc.options.getInteger(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL);
+			switch (rmsd_level_of_detail)
+			{
+				case PoseClustering::C_ALPHA:
+					atom_bijection.assignCAlphaAtoms(system_i, system_j);
+					break;
+				case PoseClustering::BACKBONE:
+					atom_bijection.assignBackboneAtoms(system_i, system_j);
+					break;
+				case PoseClustering::ALL_ATOMS:
+					mapper.calculateDefaultBijection();
+					atom_bijection = mapper.getBijection();
+					break;
+				case PoseClustering::PROPERTY_BASED_ATOM_BIJECTION:
+					atom_bijection.assignAtomsByProperty(system_i, system_j);
+					break;
+				case PoseClustering::HEAVY_ATOMS:
+				default:
+					Log.info() << "Option RMSDLevelOfDetaill::HEAVY_ATOMS not yet implemented" << endl;
+			}
+
+			snaps[0].applySnapShot(system_i);
+
+			Size num_poses = pc.getNumberOfPoses();
+
+			for (Size i=0; i<num_poses; ++i)
+			{
+				float rmsd=0;
+	// just for testing...
+	//for (Size j=0; j<500; j++)
+	//{
+				snaps[i].applySnapShot(system_j);
+
+				t.start();
+				rmsd = mapper.calculateRMSD(atom_bijection);
+				t.stop();
+	//}
+				if (file_output)
+					rmsd_outfile << "RMSD for " << " " << i << " : " << rmsd << endl;
+				else
+					Log << "RMSD for " << " " << i << " : " << rmsd << endl;
+			}
+		}
+		else if (type == "CENTER_OF_MASS_DISTANCE")
+		{
+			std::vector<Vector3> & com = pc.getCentersOfMass();
+
+			Size num_poses = pc.getNumberOfPoses();
+
+			// just query the center distance
+			for (Size i=1; i<num_poses; ++i)
+			{
+				t.start();
+				float rmsd = com[0].getDistance(com[i]);
+				t.stop();
+
+				if (file_output)
+					rmsd_outfile << "RMSD for " << " " << i << " : " << rmsd << endl;
+				else
+					Log << "RMSD for " << i << ": " << rmsd << endl;
+			}
+		}
+
+		if (file_output)
+		{
+
+			rmsd_outfile.close();
+		}
+	}
+	else
+	{
+		Log << "Incorrect input! Abort!" << endl;
+	}
+
+	Log << "Done." << endl;
+	//Log << "Done. (rmsd computation took " << t.getClockTime() << " seconds for " << sys.countAtoms() << " atoms)" << std::endl;
+
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/PeptideBuilder.C b/source/APPLICATIONS/TOOLS/PeptideBuilder.C
index 2ae8e0a..e2e80cc 100644
--- a/source/APPLICATIONS/TOOLS/PeptideBuilder.C
+++ b/source/APPLICATIONS/TOOLS/PeptideBuilder.C
@@ -27,7 +27,7 @@ int main (int argc, char **argv)
 	parpars.registerParameter("o", "peptide output pdb-file", OUTFILE, true);
 	//parpars.registerParameter("peptide_name", "name of the peptide", STRING, false);
 
-	String man = "This tool creates a peptide by a given torsion file. The amino acids shall be given in three letter code, the phi, psi, and omega angles shall be given in degree.\nExample:\n# aa   phi    psi   omega\nA    -180    140\nC    -180    180\nG    -90    -140\nP    -65    -40       0   # cis\nT    -120    -90\nP    -78     146     180  # trans";
+	String man = "This tool creates a peptide by a given torsion file. The amino acids shall be given in three letter code, the phi, psi, and omega angles shall be given in degree.\n\nExample:\n\n# aa   phi    psi   omega\n\nA    -180    140\n\nC    -180    180\n\nG    -90    -140\n\nP    -65    -40       0   # cis\n\nT    -120    -90\n\nP    -78     146     180  # trans";
 
 	parpars.setToolManual(man);
 	parpars.setSupportedFormats("i", "txt");
@@ -56,17 +56,31 @@ int main (int argc, char **argv)
 			aa_torsion.split(fields);
 
 			// split and check
-			if (   (fields.size()<3)
-					|| ((fields.size()>3) && (fields[3] != "#") && (fields[4] != "#") ))
+			// either expect a line
+			//    G
+			//    A    -180    140
+			// or
+			//    A    -180    140   180 # some comment
+			if (   (fields.size() != 1)
+					&& (   (fields.size()<3)
+					    || ((fields.size()>3) && (fields[3] != "#") && (fields[4] != "#")) ))
 			{
 				Log.error() << "Error in while reading file " << parpars.get("i") << " in line " << aa_torsion << endl;
 			}
 
 			String aa = fields[0];
-			float phi = fields[1].toFloat();
-			float psi = fields[2].toFloat();
+
+			// assume a helix if no angles given
+			float phi = 300;
+			float psi = 310;
 			float omega = 0.;
 
+			if (fields.size()>1)
+			{
+				phi = fields[1].toFloat();
+				psi = fields[2].toFloat();
+			}
+
 			if ((fields.size()>4) && (fields[3] != "#"))
 				omega = fields[3].toFloat();
 
diff --git a/source/APPLICATIONS/TOOLS/PoseIndices2PDB.C b/source/APPLICATIONS/TOOLS/PoseIndices2PDB.C
new file mode 100644
index 0000000..9704839
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/PoseIndices2PDB.C
@@ -0,0 +1,149 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+// A utility for converting Pose indices of a clustering run 
+// into pdb files 
+//
+
+#include <BALL/KERNEL/system.h>
+#include <BALL/DATATYPE/string.h>
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/FORMAT/lineBasedFile.h>
+
+#include <BALL/DOCKING/COMMON/poseClustering.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+#include <iostream>
+#include "version.h"
+
+using namespace BALL;
+using namespace std;
+
+int main(int argc, char** argv)
+{
+	CommandlineParser parpars("PoseIndices2PDB", "converts pose indices into PDB files ", VERSION, String(__DATE__), "Convert, combine and store");
+
+	parpars.registerParameter("i_clust", "input cluster index file", INFILE, true);
+	parpars.registerParameter("i_trans", "input tranformation file", INFILE, true);
+	parpars.registerParameter("i_pdb",   "input reference pdb file", INFILE, true);
+
+	parpars.registerParameter("o", "output file name prefix for resulting pdb files", OUTFILE, true, "", true);
+
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_id", "output file name prefix for 2nd to last pdb file", GALAXY_OPT_OUTID, false, "$o.id", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_id");
+
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_dir", "output directory for 2nd to last pdb file", GALAXY_OPT_OUTDIR, false, "$__new_file_path__", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_dir");
+
+	// the manual
+	String man = "This tool converts all pose indices from a given transformation file and the corresponding reference PDBFile into separate PDBFiles.\n\nParameters are the input pose index file (-i_clust), the original transformation file (-i_trans), the corresponding reference pdb file (-i_pdb) and a naming schema for the resulting pdb files (-o). \n\nOutput of this tool is a set of PDBFiles representing the docking poses belonging to the given input cluster.";
+
+	parpars.setToolManual(man);
+
+	// here we set the types of I/O files
+	parpars.setSupportedFormats("i_clust","txt");
+	parpars.setSupportedFormats("i_trans","dcd");
+	parpars.setSupportedFormats("i_pdb","pdb");
+	parpars.setSupportedFormats("o","pdb");
+
+	parpars.parse(argc, argv);
+
+	//////////////////////////////////////////////////
+
+	// read the input		
+	PDBFile pdb;
+	pdb.open(parpars.get("i_pdb"));
+	System sys;
+	pdb.read(sys);
+
+	PoseClustering pc;
+
+	if (parpars.has("i_trans"))
+	{
+		pc.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::RIGID_RMSD);
+		pc.setBaseSystemAndTransformations(sys, parpars.get("i_trans"));
+	}
+
+	//std::vector< std::set<Index> > clusters;
+
+	LineBasedFile file(parpars.get("i_clust"), std::ios::in);
+	vector<String> fields;
+
+	String cluster_id = -1;
+	String pose_id    = -1;
+
+	// called as command line or e.g. via galaxy?
+	bool is_cmd =    !parpars.has("env")
+			          || ((parpars.has("env") && parpars.get("env")=="cmdline"));
+	bool first_sol = true;
+
+	while (file.LineBasedFile::readLine())
+	{
+		// get the line
+		String current_cluster = file.getLine();
+		if (current_cluster.getField(1) == "cluster")
+		{
+			cluster_id = current_cluster.getField(2);
+			pose_id = -1;
+
+			if (file.LineBasedFile::readLine())
+			{
+				current_cluster = file.getLine();
+				fields.clear();
+				current_cluster.split(fields);
+				for (Size i=0; i < fields.size(); i++)
+				{
+					System new_pose_sys(sys);
+
+					pose_id = fields[i];
+					pc.applyTransformation2System(pose_id.toInt(), new_pose_sys);
+
+					// create the output name
+					String outfile_name = String(parpars.get("o"))
+																+ "_clust_" + cluster_id
+																+ "_pose_" + String(pose_id) + ".pdb";
+
+					if (parpars.has("o_dir") && is_cmd && (parpars.get("o_dir") != "$__new_file_path__"))
+					{
+						outfile_name =  String(parpars.get("o_dir")) + "/" + outfile_name;
+					}
+
+					// NOTE: Galaxy requires this strange naming convention 
+					//       including the fact, that zero-th element has a different name
+					if (!is_cmd)
+					{
+						outfile_name = (first_sol) ? String(parpars.get("o"))
+				                               :   String(parpars.get("o_dir")) + "/primary_"
+				                                 + String(parpars.get("o_id"))  + "_clust_" + cluster_id
+																				 + "_pose_" + String(pose_id)
+				                                 + "_visible_pdb";
+					}
+					PDBFile file(outfile_name, ios::out);
+
+					if (file.bad())
+					{
+						Log.error() << "cannot write file " << outfile_name << endl;
+						return 2;
+					}
+					file << new_pose_sys;
+					file.close();
+
+					// needed for galaxy output
+					if (first_sol)
+						first_sol = false;
+
+					Log << "wrote file " << outfile_name << endl;
+				}
+			}
+		}
+	}
+
+	Log << "done." << endl;
+
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/ProteinProtonator.C b/source/APPLICATIONS/TOOLS/ProteinProtonator.C
index 6d27ed5..b8f1b9f 100755
--- a/source/APPLICATIONS/TOOLS/ProteinProtonator.C
+++ b/source/APPLICATIONS/TOOLS/ProteinProtonator.C
@@ -1,20 +1,6 @@
-/* ProteinProtonator.C
-*
-* Copyright (C) 2011 Marcel Schumann
-*
-* This program free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or (at
-* your option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, see <http://www.gnu.org/licenses/>.
-*/
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
 
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
@@ -71,7 +57,10 @@ int main(int argc, char* argv[])
 	
 	Protein protein;
 	pdb_input->read(protein);
-	
+
+/*	
+ 	//  !!!! this functionality in now covered by the tool AddMissingAtoms!
+  
 	FragmentDB fragdb;
 	fragdb.setFilename("fragments/Fragments.db");
 	fragdb.init();
@@ -82,7 +71,8 @@ int main(int argc, char* argv[])
 	Log.enableOutput();
 	
 	fragdb.destroy();
-	
+*/
+
 	// If the input protein already has hydrogens, then delete them first.
 	for (AtomIterator it=protein.beginAtom(); it!=protein.endAtom(); it++)
 	{
@@ -134,100 +124,6 @@ int main(int argc, char* argv[])
 	{
 		Log.level(20)<<"protein protonation failed."<<endl;
 	}
-	
-	
-	/*
-	GenericMolFile* input = MolFileFactory::open(parpars.get("i"), ios::in);
-	GenericMolFile* output = MolFileFactory::open(parpars.get("o"), ios::out, input);
-	DockResultFile* drf_output = dynamic_cast<DockResultFile*>(output);
-	if (drf_output)
-	{
-		drf_output->setToolInfo(parpars.getStartCommand(), parpars.getStartTime());
-	}
-
-	Molecule* mol;
-	int no_written = 0;
-	int no_ignored = 0;
-	double pH = 7.4;
-	if (parpars.get("ph") != CommandlineParser::NOT_FOUND)
-	{
-		pH = parpars.get("ph").toDouble();
-	}
-	PDBFile* pdb_input = dynamic_cast<PDBFile*>(input);
-	FragmentDB* fragdb = 0;
-	if (pdb_input)
-	{
-		fragdb = new FragmentDB;
-		fragdb->setFilename("fragments/Fragments.db");
-		fragdb->init();
-	}
-
-
-	for (Size i=1; (mol = input->read()); i++)
-	{
-		Protein* protein = dynamic_cast<Protein*>(mol);
-		if (protein && pdb_input)
-		{
-			Log.disableOutput();
-			protein->apply(fragdb->normalize_names);
-			protein->apply(fragdb->build_bonds);
-			Log.enableOutput();
-		}
-
-		// If the input protein already has hydrogens, then delete them first.
-		for (AtomIterator it = mol->beginAtom(); +it; it++)
-		{
-			if (it->getElement().getSymbol() == "H") it->select();
-			else it->deselect();
-		}
-		mol->removeSelected();
-
-		OpenBabel::OBMol* obmol = MolecularSimilarity::createOBMol(*mol,0,1);
-
-		obmol->DeleteHydrogens();
-		obmol->SetDimension(3);
-		obmol->AddConformer(obmol->GetCoordinates());
-
-		// Add hydrogens for the specified ph-value
-		obmol->AddHydrogens(false, true, pH);
-
-		// Fetch final 3D coordinates
-		if (!protein)
-		{
-			delete mol;
-			mol = MolecularSimilarity::createMolecule(*obmol);
-		}
-		else
-		{
-			// Steal only the newly created hydrogens and put them into the correct residues.
-			// Set Hydrogen-names according to NMRSTAR-convention.
-			// (Openbabel by default created new chains+residues for new hydrogens in a protein and names all hydrogens 'H')
-			copyHydrogens(obmol,protein);
-		}
-
-		bool b = output->write(*mol);
-		if (b) no_written++;
-		else no_ignored++;
-		delete mol;
-		delete obmol;
-		if (no_written%5 == 0)
-		{
-			Log.level(20)<<"\r"<<no_written<<" molecules";
-			Log.flush();
-		}
-	}
-
-	Log.level(20)<<"\r";
-	if (no_ignored > 0) Log.level(20)<<"ignored "<<no_ignored<<" identical molecules!"<<endl;
-	Log.level(20)<<"wrote "<<no_written<<" molecules."<<endl;
-
-	input->close();
-	output->close();
-
-	if (fragdb) delete fragdb;
-	delete input;
-	delete output;
-	*/
 }
 
 
diff --git a/source/APPLICATIONS/TOOLS/RMSDCalculator.C b/source/APPLICATIONS/TOOLS/RMSDCalculator.C
index 310c0c7..33e1411 100755
--- a/source/APPLICATIONS/TOOLS/RMSDCalculator.C
+++ b/source/APPLICATIONS/TOOLS/RMSDCalculator.C
@@ -2,12 +2,16 @@
 // vi: set ts=2:
 //
 
+// A tool for computing rmsd between ligands
+//
+//
 #include <BALL/FORMAT/PDBFile.h>
+#include <BALL/KERNEL/molecule.h>
 #include <BALL/FORMAT/molFileFactory.h>
-#include <BALL/FORMAT/commandlineParser.h>
-#include <BALL/DATATYPE/options.h>
 #include <BALL/KERNEL/PTE.h>
 #include <BALL/DOCKING/COMMON/flexibleMolecule.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
 #include "version.h"
 
 using namespace BALL;
@@ -15,12 +19,12 @@ using namespace std;
 
 int main(int argc, char* argv[])
 {
-	CommandlineParser parpars("RMSDCalculator", "calculate RMSD between poses", VERSION, String(__DATE__), "Analysis");
+	CommandlineParser parpars("RMSDCalculator", "calculate RMSD between ligand poses", VERSION, String(__DATE__), "Analysis");
 	parpars.registerParameter("i", "input molecule file", INFILE, true);
 	parpars.registerParameter("org", "molecule file containing the original ('true') poses", INFILE, true);
 	parpars.registerParameter("o", "output molecule file", OUTFILE);
 	parpars.registerFlag("quiet", "by quiet, i.e. do not print progress information");
-	String man = "This tool calculates the RMSD between different conformations of the same molecule.\n\nTherefore this tool can for example be used to evaluate the different between ligands taken from co-crystal structures and their poses generated by a docking.\nMolecules may be sorted differently in the two input files; a topology hashkey will be used to match molecules to each other.\n\nOutput of this tool is a molecule file which will for each molecule contain a property-tag 'RMSD' hol [...]
+	String man = "This tool calculates the RMSD between different conformations of the same molecule.\n\nThis tool can be used to evaluate the differences between ligand poses taken from co-crystal structures, e.g. generated by a docking run.\nNote:Molecules may be sorted differently in the two input files; a topology hashkey will be used to match molecules to each other.\n\nOutput of this tool is a molecule file which will for each molecule contain a property-tag 'RMSD' holding the calcula [...]
 	parpars.setToolManual(man);
 	parpars.setSupportedFormats("i",MolFileFactory::getSupportedFormats());
 	parpars.setSupportedFormats("org",MolFileFactory::getSupportedFormats());
diff --git a/source/APPLICATIONS/TOOLS/RemoveWater.C b/source/APPLICATIONS/TOOLS/RemoveWater.C
new file mode 100644
index 0000000..f7c8864
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/RemoveWater.C
@@ -0,0 +1,75 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/KERNEL/system.h>
+#include <BALL/KERNEL/selector.h>
+#include <BALL/STRUCTURE/peptides.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+
+#include "version.h"
+
+using namespace BALL;
+
+int main(int argc, char* argv[])
+{
+	// instantiate CommandlineParser object
+	CommandlineParser parpars("RemoveWater", "removes water from PDB file ", VERSION, String(__DATE__), "Preparation");
+	parpars.registerParameter("i",  "input pdb file ", INFILE,  true);
+	parpars.registerParameter("o",  "output fasta file", OUTFILE, true);
+
+	// the manual
+	String man = String("This tool removes water from a given pdb file.");
+
+	parpars.setToolManual(man);
+
+	parpars.setSupportedFormats("i", "pdb");
+	parpars.setSupportedFormats("o", "pdb");
+
+	// parse the command line
+	parpars.parse(argc, argv);
+
+	PDBFile in_file;
+	in_file.open(parpars.get("i"), std::ios::in);
+
+	if (!in_file)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("i") << " for input." << std::endl;
+		exit(2);
+	}
+
+	PDBFile out_file;
+	out_file.open(parpars.get("o"), std::ios::out);
+
+	if (!out_file)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("o") << " for output." << std::endl;
+		exit(2);
+	}
+
+	System system;
+	in_file >> system;
+	in_file.close();
+
+	// define the selector by Expression
+	Selector wat("residue(HOH) OR residue(WAT)");
+	// apply
+	system.apply(wat);
+
+	// remove
+	system.removeSelected();
+	system.deselect();
+
+	Log << wat.getNumberOfSelectedAtoms() << std::endl;
+
+	out_file << system;
+	out_file.close();
+
+	Log << "wrote file " << parpars.get("o") << std::endl;
+
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/ResidueChecker.C b/source/APPLICATIONS/TOOLS/ResidueChecker.C
new file mode 100644
index 0000000..58c7731
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/ResidueChecker.C
@@ -0,0 +1,199 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/STRUCTURE/fragmentDB.h>
+#include <BALL/STRUCTURE/residueChecker.h>
+#include <BALL/STRUCTURE/reconstructFragmentProcessor.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+
+#include "version.h"
+
+using namespace std;
+using namespace BALL;
+
+int main(int argc, char* argv[])
+{
+	// instantiate CommandlineParser object
+	CommandlineParser parpars("ResidueChecker", "check residues to debug a protein structure wrt to PDB conventions", VERSION, String(__DATE__), "ForceFields");
+	parpars.registerParameter("pdb",  "input pdb file ", INFILE,  true);
+
+	// TODO: offer upload of a distinguished fragDB file? 
+	// shall we normalize names according to force field conventions??
+	parpars.registerFlag("norm_names", "ensures a consistent naming scheme for all atoms, e.g. PDB conventions", false);
+
+	// shall we add bonds 
+	parpars.registerFlag("build_bonds", "add missing bonds", false);
+
+	// shall we apply the fragment reconstruction
+	parpars.registerFlag("frag_reconstruct", "reconstruct incomplete fragments", false);
+
+	// an now the tests:
+	parpars.registerFlag("extra_atoms", "check for extra atoms, i.e. unknown in the reference fragment", false);
+	parpars.registerFlag("bond_length", "check for invalid bond length", false);
+	// charges
+	parpars.registerFlag("int_net_charge", "check if integer charges", false);
+	parpars.registerFlag("large_charges", "check for too large charges", false);
+	parpars.registerFlag("large_net_charge", "check for too large net charge", false);
+
+	parpars.registerFlag("overlapping_atoms", "check for overlapptin atom positions", false);
+	parpars.registerFlag("nan_positions", "check for ill-valued atomic positions", false);
+	parpars.registerFlag("elements", "check if atom names reflect the atomic element", false);
+	parpars.registerFlag("dublicate_atom_names", "check for dublicated atom names", false);
+	parpars.registerFlag("unknown_residues", "check for unknown residues", false);
+
+	//TODO: offer write Logs to a pdf
+
+	// the manual
+	String man = String("This tool checks the residues of a pdb file wrt. common inconsistencies such as missing atoms or suspicious distances.");
+
+	parpars.setToolManual(man);
+
+	parpars.setSupportedFormats("pdb", "pdb");
+
+	// parse the command line
+	parpars.parse(argc, argv);
+
+	bool norm_names = false;
+	if (parpars.has("norm_names"))
+	{
+		norm_names  = parpars.get("norm_names").toBool();
+	}
+
+	bool build_bonds = false;
+	if (parpars.has("build_bonds"))
+	{
+		build_bonds = parpars.get("build_bonds").toBool();
+	}
+
+	bool frag_reconstruct = false;
+	if (parpars.has("frag_reconstruct"))
+	{
+		frag_reconstruct = parpars.get("frag_reconstruct").toBool();
+	}
+
+	PDBFile pdb;
+	pdb.open(parpars.get("pdb"), std::ios::in);
+	if (!pdb)
+	{
+		// if file does not exist: complain and abort
+		Log.error() << "error opening " << parpars.get("pdb") << " for input." << std::endl;
+		exit(2);
+	}
+
+	System sys;
+	pdb >> sys;
+	pdb.close();
+
+	bool changes = false;
+
+	// normalize the names and build all bonds
+	FragmentDB db("");
+
+	if (norm_names)
+	{
+		sys.apply(db.normalize_names);
+		changes = true;
+	}
+
+	if (build_bonds)
+	{
+		sys.apply(db.build_bonds);
+		changes = true;
+	}
+
+	if (frag_reconstruct)
+	{
+		ReconstructFragmentProcessor proc(db);
+		sys.apply(proc);
+		sys.apply(db.build_bonds);
+		changes = true;
+	}
+
+	// now specify the ResidueChecker
+	ResidueChecker check(db);
+
+	//MISSING_ATOMS
+	if (parpars.has("missing_atoms"))
+	{
+		check.enable(ResidueChecker::MISSING_ATOMS, parpars.get("missing_atoms").toBool());
+	}
+
+	//EXTRA_ATOMS
+	if (parpars.has("extra_atoms"))
+	{
+		check.enable(ResidueChecker::EXTRA_ATOMS, parpars.get("extra_atoms").toBool());
+	}
+
+	// ELEMENTS, 	
+	if (parpars.has("elements"))
+	{
+		check.enable(ResidueChecker::ELEMENTS, parpars.get("elements").toBool());
+	}
+
+	// SUSPECT_BOND_LENGTHS, 
+	if (parpars.has("bond_length"))
+	{
+		check.enable(ResidueChecker::SUSPECT_BOND_LENGTHS, parpars.get("bond_length").toBool());
+	}
+
+  // NON_INTEGRAL_NET_CHARGE, //TODO: meaning reasonable or integer ??
+	if (parpars.has("net_charge"))
+	{
+		check.enable(ResidueChecker::NON_INTEGRAL_NET_CHARGE, parpars.get("net_charge").toBool());
+	}
+
+	// LARGE_CHARGES, 	
+	if (parpars.has("large_charges"))
+	{
+		check.enable(ResidueChecker::LARGE_CHARGES, parpars.get("large_charges").toBool());
+	}
+
+	// LARGE_NET_CHARGE, 
+	if (parpars.has("large_net_charge"))
+	{
+		check.enable(ResidueChecker::LARGE_NET_CHARGE, parpars.get("large_net_charge").toBool());
+	}
+
+	// NAN_POSITIONS, 
+	if (parpars.has("nan_positions"))
+	{
+		check.enable(ResidueChecker::NAN_POSITIONS, parpars.get("nan_positions").toBool());
+	}
+
+  // OVERLAPPING_ATOMS,
+	if (parpars.has("overlapping_atoms"))
+	{
+		check.enable(ResidueChecker::OVERLAPPING_ATOMS, parpars.get("overlapping_atoms").toBool());
+		check.enable(ResidueChecker::STRONGLY_OVERLAPPING_ATOMS, parpars.get("overlapping_atoms").toBool());
+	}
+
+	// DUPLICATE_ATOM_NAMES, 
+	if (parpars.has("dublicate_atom_names"))
+	{
+		check.enable(ResidueChecker::DUPLICATE_ATOM_NAMES, parpars.get("dublicate_atom_names").toBool());
+	}
+
+	// UNKNOWN_RESIDUES, 
+	if (parpars.has("unknown_residues"))
+	{
+		check.enable(ResidueChecker::UNKNOWN_RESIDUES, parpars.get("unknown_residues").toBool());
+	}
+
+
+	// set specified tests
+	sys.apply(check);
+
+	// overwrite
+	if (changes)
+	{
+		pdb.open(parpars.get("pdb"), ios::out);
+		pdb << sys;
+		pdb.close();
+		Log << "changes are written " <<  std::endl;
+	}
+
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/SideChainGridBuilder.C b/source/APPLICATIONS/TOOLS/SideChainGridBuilder.C
index 6ce4f69..3fa3ffe 100755
--- a/source/APPLICATIONS/TOOLS/SideChainGridBuilder.C
+++ b/source/APPLICATIONS/TOOLS/SideChainGridBuilder.C
@@ -44,9 +44,9 @@ GridBasedScoring* createScoringFunction(AtomContainer* receptor, AtomContainer*
 int main(int argc, char* argv[])
 {
 	CommandlineParser parpars("SideChainGridBuilder", "build side chain grid", VERSION, String(__DATE__), "Docking");
-	parpars.registerParameter("ini", "parameter file", INFILE, true);
+	parpars.registerParameter("param", "parameter file", INFILE, true);
 	parpars.registerParameter("d", "output directory", STRING, true);
-	parpars.setSupportedFormats("ini", "ini");
+	parpars.setSupportedFormats("param", "ini");
 	parpars.setToolManual("This tool precalculates a side chain grid.");
 
 	parpars.parse(argc, argv);
@@ -56,13 +56,13 @@ int main(int argc, char* argv[])
 	Options option;
 	list<Constraint*> constraints;
 
-	if (parpars.get("ini") == CommandlineParser::NOT_FOUND)
+	if (parpars.get("param") == CommandlineParser::NOT_FOUND)
 	{
 		cout<<"[Error:] ini file must be given" << std::endl;
 		exit (1);
 	}
 
-	String inifile = parpars.get("ini");
+	String inifile = parpars.get("param");
 	DockingAlgorithm::readOptionFile(inifile, option, constraints);
 	String scoring_type = option.get("scoring_type");
 	String grid_file = option.get("grid_file");
diff --git a/source/APPLICATIONS/TOOLS/Split2ConnectedComponents.C b/source/APPLICATIONS/TOOLS/Split2ConnectedComponents.C
index 06e74f2..d3ed774 100644
--- a/source/APPLICATIONS/TOOLS/Split2ConnectedComponents.C
+++ b/source/APPLICATIONS/TOOLS/Split2ConnectedComponents.C
@@ -2,17 +2,9 @@
 // vi: set ts=2:
 //
 
-/* SplitConnectedComponents.C
-*  2011 Anna Dehof
-*/
-
-// ----------------------------------------------------
-// $Maintainer: Anna Dehof $
-// $Authors:    Anna Dehof $
-// ----------------------------------------------------
-
-// TODO: maintainer notwendig?
-// TODO: ifdefs notwendig?
+//  SplitConnectedComponents.C
+//  A tool for splitting into connected components 
+//
 
 #include <BALL/FORMAT/MOL2File.h>
 #include <BALL/STRUCTURE/connectedComponentsProcessor.h>
@@ -21,37 +13,28 @@
 #include <BALL/FORMAT/commandlineParser.h>
 #include <iostream>
 
+#include "version.h"
+
 using namespace std;
 using namespace BALL;
 
-// TODO notwendig?
-void usage (const char *progname);
-
 int main (int argc, char **argv)
 {
-	// instantiate CommandlineParser object supplying
-	// - tool name
-	// - short description
-	// - version string
-	// - build date
-	// - category
-	CommandlineParser parpars("Split2ConnectedComponents", "splits a molecular file into its connected components", "bla", String(__DATE__), "Preparation");
-
-	// we register an input file parameter 
-	// - CLI switch
-	// - description
-	// - Inputfile
-	// - required
+	CommandlineParser parpars("Split2ConnectedComponents", "splits a molecular file into its connected components", VERSION, String(__DATE__), "Preparation");
+
 	parpars.registerParameter("i", "input mol2-file", INFILE, true);
 
-	// we register an output file parameter 
-	// - CLI switch
-	// - description
-	// - Outputfile
-	// - required
-	parpars.registerParameter("o", "output mol2-file name for first solution", STRING, true);
-	parpars.registerParameter("o_id", "output id", STRING, true);
-	parpars.registerParameter("o_dir", "output directory for 2nd to last solution", STRING, true);
+	parpars.registerParameter("o", "output mol2-file name for first solution", OUTFILE, true);
+
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_id", "output id", GALAXY_OPT_OUTID, false, "$o.id", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_id");
+
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_dir", "output directory for 2nd to last solution", GALAXY_OPT_OUTDIR, false, "$__new_file_path__", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_dir");
 
 	// register String parameter for supplying max number of solutions
 	parpars.registerParameter("min_atoms", "ignore connected components with less than minimal number of atoms", INT, false, 4);
@@ -61,7 +44,7 @@ int main (int argc, char **argv)
 
 	// here we set the types of I/O files
 	parpars.setSupportedFormats("i","mol2");
-	//parpars.setSupportedFormats("o","mol2"); //TODO
+	parpars.setSupportedFormats("o","mol2");
 
 	parpars.parse(argc, argv);
 
@@ -71,11 +54,15 @@ int main (int argc, char **argv)
 	System system;
 	f0 >> system;
 
+	// called as command line or e.g. via galaxy?
+	bool is_cmd =    !parpars.has("env")
+			          || ((parpars.has("env") && parpars.get("env")=="cmdline"));
+
 	// create the processor
 	ConnectedComponentsProcessor ccp;
 	ccp.splitIntoMolecules(system);
 
-	int min_atoms = 0;
+	Size min_atoms = 0;
 
 	// do we have to consider a minimal number of atoms?
 	if (parpars.has("min_atoms"))
@@ -88,21 +75,37 @@ int main (int argc, char **argv)
 	int i = 0;
 
 	// write all connected components into individual files
-	for (MoleculeIterator m_it = system.beginMolecule(); +m_it; ++m_it)
+	for (MoleculeIterator m_it = system.beginMolecule(); +m_it; ++m_it, ++i)
 	{
 		if (m_it->countAtoms() > min_atoms)
 		{
-			String outfile_name = (i == 0) ? String(parpars.get("o"))
-				:   String(parpars.get("o_dir")) + "/primary_"
-					+ String(parpars.get("o_id"))  + "_solution" + String(i)
-					+ "_visible_mol2";
-
+			// create the output name
+			String outfile_name = String(parpars.get("o")) + "_solution_" + String(i) + ".mol2";
+
+			if (parpars.has("o_dir") && is_cmd && (parpars.get("o_dir") != "$__new_file_path__"))
+			{
+				outfile_name =  String(parpars.get("o_dir")) + "/" + outfile_name;
+			}
+
+			// NOTE: Galaxy requires this strange naming convention 
+			//       including the fact, that zero-th element has a different name
+			if (!is_cmd)
+			{
+				outfile_name = (i == 0) ? String(parpars.get("o"))
+				                        :   String(parpars.get("o_dir")) + "/primary_"
+				                        + String(parpars.get("o_id"))  + "_solution" + String(i)
+				                        + "_visible_mol2";
+			}
 			Log << "   Writing connected component " << String(i) << " as " << outfile_name << endl;
 
 			//	GenericMolFile* outfile = MolFileFactory::open(outfile_name, ios::out);
 			MOL2File outfile(outfile_name, ios::out);
-			//TODO 
-			//if (!outfile)	
+			if (outfile.bad())
+			{
+				Log.error() << "cannot write file " << outfile_name << endl;
+				return 2;
+			}
+
 			outfile << *m_it;
 			outfile.close();
 		}
@@ -110,7 +113,6 @@ int main (int argc, char **argv)
 
 	Log << "done." << endl;
 
-
 	return 0;
 }
 
diff --git a/source/APPLICATIONS/TOOLS/Trajectory2RigidTransformation.C b/source/APPLICATIONS/TOOLS/Trajectory2RigidTransformation.C
new file mode 100644
index 0000000..159b102
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/Trajectory2RigidTransformation.C
@@ -0,0 +1,91 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+// A very simple utility for converting trajectory files like DCD
+// into rigid transformations 
+//
+
+#include <BALL/KERNEL/system.h>
+#include <BALL/DATATYPE/string.h>
+#include <BALL/DOCKING/COMMON/poseClustering.h>
+#include <BALL/FORMAT/DCDFile.h>
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/FORMAT/lineBasedFile.h>
+
+#include <BALL/FORMAT/commandlineParser.h>
+#include <iostream>
+#include "version.h"
+
+using namespace BALL;
+using namespace std;
+
+int main(int argc, char** argv)
+{
+	CommandlineParser parpars("Trajectory2RigidTransformation", "converts a trajectory file into a rigid transformation file ", VERSION, String(__DATE__), "Convert, combine and store");
+
+	parpars.registerParameter("i_dcd", "input trajectory file", INFILE, true);
+	parpars.registerParameter("i_pdb",  "input pdb-file", INFILE, true);
+
+	parpars.registerParameter("o", "output file for the rigid transformations", OUTFILE, true, "", true);
+
+	// the manual
+	String man = "This tool converts SnapShots of a given TrajectoryFile and the reference PDBFile into a rigid transformation file.\n\nParameters are the input SnapShots as TrajectoryFile (-i_dcd), the corresponding reference pdb file that was originally used to create the TrajectoryFile (-i_pdb) and a naming schema for the resulting transformation file (-o).\n\nOutput of this tool is a file storing each given SnapShot as rigid transformation per line.";
+
+	parpars.setToolManual(man);
+
+	// here we set the types of I/O files, for example sdf is also allowed
+	parpars.setSupportedFormats("i_dcd", "dcd");
+	parpars.setSupportedFormats("i_pdb", "pdb");
+	parpars.setSupportedFormats("o",    "txt");
+
+	parpars.parse(argc, argv);
+
+	//////////////////////////////////////////////////
+
+	// read the input	
+	PDBFile pdb;
+	pdb.open(parpars.get("i_pdb"));
+	System sys;
+	pdb.read(sys);
+
+	ConformationSet cs;
+	cs.setup(sys);
+	cs.readDCDFile(parpars.get("i_dcd"));
+	cs.resetScoring();
+
+	PoseClustering pc;
+	pc.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::RIGID_RMSD);
+	pc.setConformationSet(&cs);
+
+	// now convert
+	pc.convertSnaphots2Transformations();
+	std::vector< PoseClustering::PosePointer > poses = pc.getPoses();
+
+	String outfile_name = String(parpars.get("o"));
+	LineBasedFile file(outfile_name, ios::out);
+	if (file.bad())
+	{
+		Log.error() << "cannot write file " << outfile_name << endl;
+		return 2;
+	}
+
+	Log << "write rigid poses into file " << outfile_name << endl;
+
+	for (Size i=0; i<poses.size(); i++)
+	{
+		Eigen::Matrix3f const & rot    = poses[i].trafo->rotation;
+		Eigen::Vector3f const & transl = poses[i].trafo->translation;
+		file << "A A " << " 0.0 "
+			   << rot(0) << " " << rot(1) << " " << rot(2) << " " << transl[0] << " "
+				 << rot(3) << " " << rot(4) << " " << rot(5) << " " << transl[1] << " "
+				 << rot(6) << " " << rot(7) << " " << rot(8) << " " << transl[2]
+				 << endl;
+	}
+
+	file.close();
+
+	Log << "done." << endl;
+
+	return 0;
+}
diff --git a/source/APPLICATIONS/TOOLS/TrajectoryFile2PDBSplitter.C b/source/APPLICATIONS/TOOLS/TrajectoryFile2PDBSplitter.C
index 7de7aa7..8db27d4 100644
--- a/source/APPLICATIONS/TOOLS/TrajectoryFile2PDBSplitter.C
+++ b/source/APPLICATIONS/TOOLS/TrajectoryFile2PDBSplitter.C
@@ -2,7 +2,7 @@
 // vi: set ts=2:
 //
 
-// A very simple utility for splitting a trajectory file file into 
+// A very simple utility for splitting a trajectory file into 
 // several pdb snapshots of a system
 // 
 
@@ -27,25 +27,27 @@ int main(int argc, char** argv)
 	parpars.registerParameter("i_traj", "input trajectory file", INFILE, true);
 	parpars.registerParameter("i_pdb", "input pdb-file", INFILE, true);
 
-	parpars.registerParameter("o", "output pdb-file name for first solution", STRING, true, "", true);
+	parpars.registerParameter("o", "output pdb-file for first solution", OUTFILE, true, "", true);
 
-	parpars.registerParameter("o_id", "output id", STRING, true, "", true);
-
-	parpars.registerParameter("o_dir", "output directory for 2nd to last pdb file", STRING, true, "", true);
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_id", "output id", GALAXY_OPT_OUTID, false, "$o.id", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_id");
 
+	// parameters for galaxy for handling multiple output files
+	parpars.registerParameter("o_dir", "output directory for 2nd to last pdb file", GALAXY_OPT_OUTDIR, false, "$__new_file_path__", true);
+	// need to be hidden in command line mode
+	parpars.setParameterAsAdvanced("o_dir");
 
 	// the manual
-	String man = "This tool splits SnapShots of a given TrajectoryFile and the reference PDBFile into separate PDBFiles.\n\nParameters are the input SnapShots as TrajectoryFile (-i_trja), the corresponding reference pdb file that was originally used to create the TrajectoryFile (-i_pdb) and a naming schema for the results (-o).\n\nOutput of this tool is a number of PDBFiles each containing one SnapShot.";
+	String man = "This tool splits SnapShots of a given TrajectoryFile and the reference PDBFile into separate PDBFiles.\n\nParameters are the input SnapShots as TrajectoryFile (-i_traj), the corresponding reference pdb file that was originally used to create the TrajectoryFile (-i_pdb) and a naming schema for the results (-o).\n\nOutput of this tool is a number of PDBFiles each containing one SnapShot.";
 
 	parpars.setToolManual(man);
 
-	// here we set the types of I/O files, for example sdf is also allowed
-	parpars.setSupportedFormats("i_traj","dcd, trr");
-	parpars.setSupportedFormats("i_pdb","pdb");
-	parpars.setSupportedFormats("o","pdb");
-
-	//TODO
-	//parpars.setSupportedFormats("o",MolFileFactory::getSupportedFormats());
+	// here we set the types of I/O files
+	parpars.setSupportedFormats("i_traj", "dcd");
+	parpars.setSupportedFormats("i_pdb",  "pdb");
+	parpars.setSupportedFormats("o",      "pdb");
 
 	parpars.parse(argc, argv);
 
@@ -61,13 +63,28 @@ int main(int argc, char** argv)
 	TrajectoryFile *traj_file = TrajectoryFileFactory::open(parpars.get("i_traj"));
 	Size num_ss = traj_file->getNumberOfSnapShots();
 
+	// called as command line or e.g. via galaxy?
+	bool is_cmd =    !parpars.has("env")
+			          || ((parpars.has("env") && parpars.get("env")=="cmdline"));
+
 	for (Size i=0; i< num_ss; i++)
 	{
-		String outfile_name = (i == 0) ? String(parpars.get("o"))
+		// create the output name
+		String outfile_name = String(parpars.get("o")) + "_snapshot_" + String(i) + ".pdb";
+		if (parpars.has("o_dir"))
+		{
+			outfile_name =  String(parpars.get("o_dir")) + "/" + outfile_name;
+		}
+
+		// NOTE: Galaxy requires this strange naming convention 
+		//       including the fact, that zero-th element has a different name
+		if (!is_cmd)
+		{
+			outfile_name = (i == 0) ? String(parpars.get("o"))
 				                               :   String(parpars.get("o_dir")) + "/primary_"
 				                                 + String(parpars.get("o_id"))  + "_snapshot" + String(i)
 				                                 + "_visible_pdb";
-
+		}
 		Log << "   write SnapShot " << i << " as " << outfile_name << endl;
 
 		if (traj_file->read(ss))
@@ -78,7 +95,7 @@ int main(int argc, char** argv)
 			PDBFile file(outfile_name, ios::out);
 			if (file.bad())
 			{
-				Log.error() << "cannot write PDB file " << outfile_name << endl;
+				Log.error() << "cannot write file " << outfile_name << endl;
 				return 2;
 			}
 			file << sys_temp;
diff --git a/source/APPLICATIONS/TOOLS/VendorFinder.C b/source/APPLICATIONS/TOOLS/VendorFinder.C
index b7a00df..16a5ff3 100755
--- a/source/APPLICATIONS/TOOLS/VendorFinder.C
+++ b/source/APPLICATIONS/TOOLS/VendorFinder.C
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
 	parpars.registerParameter("i", "input file containing compounds", INFILE, true);
 	parpars.registerParameter("d", "database name", STRING, true);
 	parpars.registerParameter("u", "database username", STRING, true);
-	parpars.registerParameter("h", "database host", STRING, true);
+	parpars.registerParameter("host", "database host", STRING, true);
 	parpars.registerParameter("port", "database port", BALL::INT, false, "3306");
 	parpars.registerParameter("p", "database password", STRING, true);
 	parpars.registerParameter("o", "output text file", OUTFILE);
@@ -34,7 +34,7 @@ int main(int argc, char* argv[])
 
 	String user = parpars.get("u");
 	String db_name = parpars.get("d");
-	String host = parpars.get("h");
+	String host = parpars.get("host");
 	String password = parpars.get("p");
 	int port = 3306;
 	if (parpars.get("port") != CommandlineParser::NOT_FOUND)
diff --git a/source/APPLICATIONS/TOOLS/sources.cmake b/source/APPLICATIONS/TOOLS/sources.cmake
index 8510e7f..e7d9bb7 100755
--- a/source/APPLICATIONS/TOOLS/sources.cmake
+++ b/source/APPLICATIONS/TOOLS/sources.cmake
@@ -2,10 +2,14 @@
 SET(DIRECTORY source/APPLICATIONS/TOOLS)
 
 SET(EXECUTABLES_LIST
+	AddMissingAtoms
 	AntitargetRescorer
 	AutoModel
 	BindingDBCleaner
 	BondOrderAssigner
+	CalculateBindingFreeEnergy
+	CalculateEnergy
+	CalculateSolvationFreeEnergy
 	CombiLibGenerator
 	ConstraintsFinder
 	Converter
@@ -15,6 +19,9 @@ SET(EXECUTABLES_LIST
 	DockPoseClustering
 	DockResultMerger
 	EvenSplit
+	ExtractClustersFromWardTree
+	ExtractProteinChains
+	ExtractProteinSequence
 	FeatureSelector
 	FingerprintSimilarityClustering
 	FingerprintSimilaritySearch
@@ -28,18 +35,22 @@ SET(EXECUTABLES_LIST
 	LigCheck
 	ModelCreator
 	MolCombine
-	MolecularFileConverter
+	#MolecularFileConverter
 	MolFilter
 	MolPredictor
 	PartialChargesCopy
 	PDBCutter
 	PDBDownload
+	PDBRMSDCalculator
 	PeptideBuilder
 	PocketDetector
+	PoseIndices2PDB
 	Predictor
 	PropertyModifier
 	PropertyPlotter
 	ProteinCheck
+	RemoveWater
+	ResidueChecker
 	RMSDCalculator
 	ScoreAnalyzer
 	SideChainGridBuilder
@@ -51,6 +62,7 @@ SET(EXECUTABLES_LIST
 	TaGRes
 	TaGRes-train
 	TrajectoryFile2PDBSplitter
+	Trajectory2RigidTransformation
 	Validator
 	VendorFinder
 	WaterFinder
diff --git a/source/APPLICATIONS/TOOLS/stringStub.C b/source/APPLICATIONS/TOOLS/stringStub.C
deleted file mode 100644
index e79eef0..0000000
--- a/source/APPLICATIONS/TOOLS/stringStub.C
+++ /dev/null
@@ -1,9 +0,0 @@
-// stringStub.h / stringStub.C are needed for VC2010!
-#include <string>
-#include <BALL/common.h>
-
-
-#ifdef BALL_COMPILER_MSVC
-template std::string::size_type std::string::npos;
-template std::wstring::size_type std::wstring::npos;
-#endif
diff --git a/source/APPLICATIONS/TOOLS/tool_conf.xml.section b/source/APPLICATIONS/TOOLS/tool_conf.xml.section
new file mode 100644
index 0000000..7e027c9
--- /dev/null
+++ b/source/APPLICATIONS/TOOLS/tool_conf.xml.section
@@ -0,0 +1,131 @@
+<?xml version="1.0"?>
+<toolbox>
+	<section name="Get/Edit Data" id="Get Data">
+		<tool file="data_source/upload.xml"/>	
+		<tool file="BALL/PDBDownload.xml"/>		
+		<tool file="BALL/MolecularFileConverter.xml"/>
+		<tool file="BALL/Split2ConnectedComponents.xml"/>
+		<tool file="BALL/PDBCutter.xml"/>
+		<tool file="BALL/LigandFileSplitter.xml"/>
+		<tool file="BALL/MolCombine.xml"/>
+		<tool file="BALL/EvenSplit.xml"/>
+		<tool file="BALL/MolFilter.xml"/>
+		<tool file="BALL/CombiLibGenerator.xml"/>	
+		<tool file="BALL/DBImporter.xml"/>	
+		<tool file="BALL/DBExporter.xml"/>
+		<tool file="BALL/VendorFinder.xml"/>
+	</section>
+ 	
+	<section name="Structure Creation" id="Structure Creation">
+		<tool file="BALL/PeptideBuilder.xml"/>
+		<tool file="BALL-NMR/CreateFromSmiles-galaxy.xml"/>
+		<tool file="BALL/CrystalGenerator.xml"/>
+	</section>	
+
+	<section name="Preparation" id="Preparation">	
+		<!--tool file="BALL/Converter.xml"/-->	
+		<tool file="BALL/AddMissingAtoms.xml"/>
+		<tool file="BALL/ProteinProtonator.xml"/>
+		<tool file="BALL/BondOrderAssigner.xml"/>
+		<tool file="BALL/Ligand3DGenerator.xml"/>
+		<tool file="BALL/WaterFinder.xml"/>
+		<tool file="BALL/PartialChargesCopy.xml"/>
+		<tool file="BALL/PropertyModifier.xml"/>
+		<tool file="BALL/BindingDBCleaner.xml"/>
+	</section>
+
+	<section name="BOA Constructor" id="BOA Constructor">
+		<tool file="BALL/MolecularFileConverter.xml"/>
+		<tool file="BALL/BondOrderAssigner.xml"/>
+		<tool file="BALL/Split2ConnectedComponents.xml"/>	
+	</section>  
+
+	<section name="Graph/Display Molecules" id="plots">
+		<tool file="BALL-NMR/VisualizeStructureDiagram-galaxy.xml"/>
+		<!-- tool file="BALL/MolDepict.xml"/-->	
+		<!-- tool file="BALL/GenerateXML3D.xml"/-->	
+	</section> 
+
+  	<section name="Checks and evaluations" id="Checks and evaluations">
+		<tool file="BALL/LigCheck.xml"/>
+		<tool file="BALL/ProteinCheck.xml"/>
+	</section>
+
+ 	<section name="Analysis" id="Analysis">
+		<tool file="BALL/PropertyPlotter.xml"/>	
+		<tool file="BALL/PDBRMSDCalculator.xml"/>	
+		<tool file="BALL/RMSDCalculator.xml"/>
+		<tool file="BALL/ScoreAnalyzer.xml"/>
+		<tool file="BALL/SimilarityAnalyzer.xml"/>
+	</section>
+
+ 	<section name="Docking" id="Docking">	
+		<tool file="BALL/DockResultMerger.xml"/>
+		<tool file="BALL/PocketDetector.xml"/>
+		<tool file="BALL/IMGDock.xml"/>
+		<tool file="BALL/GridBuilder.xml"/>
+		<tool file="BALL/ConstraintsFinder.xml"/>
+		<tool file="BALL/InteractionConstraintDefiner.xml"/>
+		<tool file="BALL/SpatialConstraintDefiner.xml"/>
+	</section>
+
+ 	<section name="Rescoring" id="Rescoring">
+		<tool file="BALL/TaGRes.xml"/>
+		<tool file="BALL/TaGRes-train.xml"/>
+		<tool file="BALL/AntitargetRescorer.xml"/>
+		<tool file="BALL/SimpleRescorer.xml"/>
+		<tool file="BALL/SLICK.xml"/>
+	</section>
+
+	<section name="NMR NightShift" id="NMR">
+		<tool file="BALL-NMR/FeatureGenerator-galaxy.xml"/>
+		<tool file="BALL-NMR/DownloadNMRPredictData-galaxy.xml"/>	
+		<tool file="BALL-NMR/RestrictPDB2BMRBMapping-galaxy.xml"/>	
+		<tool file="BALL-NMR/ComputeNMRDescriptorDB-galaxy.xml"/>	
+		<tool file="BALL-NMR/TrainNMRShiftModel-galaxy.xml"/>	
+		<tool file="BALL-NMR/PredictNMRShifts-galaxy.xml"/>		
+		<tool file="BALL-NMR/Spinster-galaxy.xml"/>	
+	</section>  
+
+	<section name="Clustering" id="Clustering">
+		<tool file="BALL/Trajectory2RigidTransformation.xml"/>	
+		<tool file="BALL/PDBRMSDCalculator.xml"/>	
+		<tool file="BALL/DockPoseClustering.xml"/>
+		<tool file="BALL/ExtractClustersFromWardTree.xml"/>
+		<tool file="BALL/TrajectoryFile2PDBSplitter.xml"/>
+		<tool file="BALL/PoseIndices2PDB.xml"/>
+	</section>	
+ 
+ 	<section name="QuEasy (QSAR)" id="QuEasy (QSAR)">
+		<tool file="BALL/FeatureSelector.xml"/>
+		<tool file="BALL/InputReader.xml"/>
+		<tool file="BALL/Predictor.xml"/>
+		<tool file="BALL/AutoModel.xml"/>
+		<tool file="BALL/InputPartitioner.xml"/>
+		<tool file="BALL/Validator.xml"/>
+		<tool file="BALL/MolPredictor.xml"/>
+		<tool file="BALL/ModelCreator.xml"/>
+	</section>
+
+	<section name="Chemoinformatics" id="Chemoinformatics">
+		<tool file="BALL/FingerprintSimilaritySearch.xml"/>
+		<tool file="BALL/FingerprintSimilarityClustering.xml"/>
+	</section>	
+	
+	<!--section name="DEFAULT" id="DEFAULT">
+		<tool file="BALL/GalaxyConfigGenerator.xml"/>
+    	-->
+<!--
+  </section>
+  <section name="FASTA manipulation" id="fasta_manipulation">
+    <tool file="fasta_tools/fasta_compute_length.xml" />
+    <tool file="fasta_tools/fasta_filter_by_length.xml" />
+    <tool file="fasta_tools/fasta_concatenate_by_species.xml" />
+    <tool file="fasta_tools/fasta_to_tabular.xml" />
+    <tool file="fasta_tools/tabular_to_fasta.xml" />
+    <tool file="fastx_toolkit/fasta_formatter.xml" />
+    <tool file="fastx_toolkit/fasta_nucleotide_changer.xml" />
+    <tool file="fastx_toolkit/fastx_collapser.xml" />
+  </section>
+-->
+</toolbox>
diff --git a/source/APPLICATIONS/UTILITIES/pdb2dcd.C b/source/APPLICATIONS/UTILITIES/pdb2dcd.C
index 6f5e3d1..cbb9cac 100644
--- a/source/APPLICATIONS/UTILITIES/pdb2dcd.C
+++ b/source/APPLICATIONS/UTILITIES/pdb2dcd.C
@@ -19,19 +19,42 @@ int main(int argc, char** argv)
 
 	if (argc == 1)
 	{
-		Log.info() << "Usage:" << argv[0] << " <PDB infile>* " << endl;
+		Log.info() << "Usage:" << argv[0] << " [-ipdblistfile=...] [<PDB infile>*] " << endl;
 		Log.info() << "Converts all given PDBFiles into snapshots of a DCDFile." << endl;
 		return 1;
 	}
 
-	String filename;
 	SnapShot snapshot;
 	DCDFile dcd_file("out.dcd", ios::out | ios::binary);
 
-	for (int i = 1; i < argc; ++i)
+	std::vector<String> filenames;
+	if ((argc == 2) && String(argv[1]).hasPrefix("-ipdblistfile"))
 	{
-		filename = argv[i];
-		Log.info() << "Reading file " << filename;
+		String first_arg(argv[1]);
+
+		if (first_arg.hasPrefix("-ipdblistfile="))
+		{
+			LineBasedFile listfile(first_arg.after("="), std::ios::in);
+
+			while (listfile.readLine())
+			{
+				filenames.push_back(listfile.getLine());
+			}
+		}
+	}
+	else
+	{
+		for (int i = 1; i < argc; ++i)
+		{
+			filenames.push_back(String(argv[i]));
+		}
+	}
+
+	for (Position i=0; i<filenames.size(); ++i)
+	{
+		String& filename = filenames[i];
+
+		Log.info() << "Reading file " << filename << " " << i;
 		PDBFile file(filename);
 		if (file.bad())
 		{
diff --git a/source/DATATYPE/string.C b/source/DATATYPE/string.C
index 4739cbd..934bcab 100644
--- a/source/DATATYPE/string.C
+++ b/source/DATATYPE/string.C
@@ -154,7 +154,7 @@ namespace BALL
 	}
 
 	String::String(const char* char_ptr, Index from, Size len)
- 	 : string()
+ 	 : str_()
 	{
  	 validateCharPtrRange_(from, len, char_ptr);
  	 if (len > 0)
@@ -180,7 +180,7 @@ namespace BALL
 	}
  
 	String::String(Size buffer_size, const char* format, ... )
-		: string() 
+		: str_() 
 	{
 		if (buffer_size <= 0)
 		{
@@ -213,7 +213,7 @@ namespace BALL
 #else
 	String::String(std::strstream& s)
 #endif
-		: string("")
+		: str_("")
 	{
 		s >> (*this);
 	}
@@ -243,13 +243,23 @@ namespace BALL
 
 	#undef BALL_STRING_DEFINE_CONSTRUCTOR_METHOD
 
+	String::operator string&()
+	{
+		return str_;
+	}
+
+	String::operator string const&() const
+	{
+		return str_;
+	}
+
 	String::~String()
 	{
 	}
 
 	void String::set(const String& s)
 	{
-		std::string::operator = (s);
+		str_ = s;
 	}
 
 	void String::set(const String& s, Index from, Size len)
@@ -1128,7 +1138,7 @@ namespace BALL
 		return result;
 	}
 
-	int String::compare(const String& s, Index from) const
+	int String::compare(const String& s, Index from) const 
 	{
 		validateIndex_(from);
 
@@ -1289,6 +1299,7 @@ namespace BALL
 		return result;
 	}
 
+	/*
 	istream& getline(istream& s, String& str, char delimiter)
 	{
 		char c;
@@ -1306,6 +1317,7 @@ namespace BALL
 
 		return s;
 	}
+	*/
 
 	void String::dump(ostream &s, Size depth) const
 	{
@@ -1803,8 +1815,9 @@ String String::decodeBase64()
   return out;
 }
 
+} // namespace BALL
+
 #	ifdef BALL_NO_INLINE_FUNCTIONS
 #		include <BALL/DATATYPE/string.iC>
 #	endif
 
-} // namespace BALL
diff --git a/source/DOCKING/COMMON/poseClustering.C b/source/DOCKING/COMMON/poseClustering.C
index db3da2a..bb2ae7d 100644
--- a/source/DOCKING/COMMON/poseClustering.C
+++ b/source/DOCKING/COMMON/poseClustering.C
@@ -15,8 +15,20 @@
 #include <stack>
 #include <queue>
 
+#include <boost/version.hpp>
+
 #include <boost/graph/iteration_macros.hpp>
 #include <boost/graph/graphviz.hpp>
+#include <boost/graph/adj_list_serialize.hpp>
+
+#include <boost/archive/binary_oarchive.hpp>
+#include <boost/archive/binary_iarchive.hpp>
+
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+#include <boost/serialization/set.hpp>
+#include <boost/serialization/variant.hpp>
 
 using namespace std;
 using namespace Eigen;
@@ -35,8 +47,9 @@ namespace BALL
 	const String PoseClustering::Option::RMSD_TYPE = "pose_clustering_rmsd_type";
 	const Index PoseClustering::Default::RMSD_TYPE = PoseClustering::SNAPSHOT_RMSD;
 
-	//const String PoseClustering::Option::FULL_CLUSTER_DENDOGRAM = "pose_clustering_full_cluster_dendogram";
-	//const bool   PoseClustering::Default::FULL_CLUSTER_DENDOGRAM = false;
+	const String PoseClustering::Option::RUN_PARALLEL  = "pose_clustering_run_parallel";
+	const bool   PoseClustering::Default::RUN_PARALLEL = true;
+
 
 	PoseClustering::PoseClustering()
 		: current_set_(0),
@@ -60,6 +73,7 @@ namespace BALL
 		base_system_ = poses->getSystem();
 	}
 
+
 	PoseClustering::PoseClustering(System const& base_system, String transformation_file_name)
 	{
 		has_rigid_transformations_ = false;
@@ -68,6 +82,7 @@ namespace BALL
 		setBaseSystemAndTransformations(base_system, transformation_file_name);
 	}
 
+
 	PoseClustering::~PoseClustering()
 	{
 		if (delete_conformation_set_)
@@ -116,10 +131,12 @@ namespace BALL
 	}
 
 
-	std::vector<std::set<Index> > PoseClustering::extractClustersForThreshold(float threshold)
+	std::vector<std::set<Index> > PoseClustering::extractClustersForThreshold(float threshold, Size min_size)
 	{
 //	cout << " extract clusters for dist = " << threshold << endl;
+
 		clusters_.clear();
+		cluster_representatives_.clear();
 		cluster_scores_.clear();
 
 		// for debug purposes, we might have to reset our cluster id
@@ -133,18 +150,20 @@ namespace BALL
 		std::stack<ClusterTreeNode> stack;
 		ClusterTreeNode current_node;
 
-		if (cluster_tree_[cluster_tree_root_].merged_at < threshold)
+		ClusterTreeNode cluster_tree_root = cluster_tree_[boost::graph_bundle];
+
+		if (cluster_tree_[cluster_tree_root].merged_at < threshold)
 		{
-			clusters_.push_back(collectClusterBelow_(cluster_tree_root_));
-			cluster_scores_.push_back(cluster_tree_[cluster_tree_root_].merged_at);
+			clusters_.push_back(collectClusterBelow_(cluster_tree_root));
+			cluster_scores_.push_back(cluster_tree_[cluster_tree_root].merged_at);
 
 #ifdef POSECLUSTERING_DEBUG 
-			cluster_tree_[cluster_tree_root_].current_cluster_id = clusters_.size()-1;
+			cluster_tree_[cluster_tree_root].current_cluster_id = clusters_.size()-1;
 #endif
 		}
 		else
 		{
-			stack.push(cluster_tree_root_);
+			stack.push(cluster_tree_root);
 
 			while (!stack.empty())
 			{
@@ -153,7 +172,9 @@ namespace BALL
 
 				BGL_FORALL_ADJ(current_node, child, cluster_tree_, ClusterTree)
 				{
-					if (cluster_tree_[child].merged_at < threshold)
+					// is child itself a leaf?
+					if (   (cluster_tree_[child].merged_at < threshold)
+						  || (out_degree(child, cluster_tree_) == 0) )
 					{
 						clusters_.push_back(collectClusterBelow_(child));
 						cluster_scores_.push_back(cluster_tree_[child].merged_at);
@@ -169,49 +190,144 @@ namespace BALL
 				}
 			}
 		}
+
+		if (min_size > 1)
+		{
+			std::vector< std::set<Index> >::iterator iter = clusters_.begin();
+			std::vector< float >::iterator score_iter = cluster_scores_.begin();
+
+			while (iter != clusters_.end())
+			{
+        if ((*iter).size() < min_size)
+				{
+					 iter = clusters_.erase(iter);
+					 score_iter = cluster_scores_.erase(score_iter);
+        }
+        else
+        {
+           ++iter;
+					 ++score_iter;
+        }
+			}
+		}
+
 		return clusters_;
 	}
 
 
+	// up to n best clusters
 	std::vector<std::set<Index> > PoseClustering::extractNBestClusters(Size n)
 	{
-//cout << "extractNClusters  n=" << n << "/" << getNumberOfPoses() << endl;
+//cout << "extractNBestClusters  n=" << n << "/" << getNumberOfPoses() << endl;
+
+		// we cannot rely on getNumberOfPoses() as we may have been given a tree...
+		/*
 		if (n > getNumberOfPoses())
 			throw(Exception::OutOfRange(__FILE__, __LINE__));
+		*/
 
 		clusters_.clear();
+		cluster_representatives_.clear();
 		cluster_scores_.clear();
 
 		ClusterTreeNodeComparator comp(cluster_tree_);
 		std::priority_queue< ClusterTreeNode, std::vector<ClusterTreeNode>, ClusterTreeNodeComparator >  prio(comp);
 		ClusterTreeNode current_node;
 
-		prio.push(cluster_tree_root_);
+		ClusterTreeNode cluster_tree_root = cluster_tree_[boost::graph_bundle];
+
+		prio.push(cluster_tree_root);
 
-		while (   ((prio.size() + clusters_.size()) < n )
-				   && (!prio.empty()))
+		// read ahead
+		current_node = prio.top();
+
+		// first we look out for the first n best clusters
+		// we traverse the tree from the root in descending order
+		// of merged_at values
+		while ( (prio.size() + clusters_.size() < n ) &&
+					 (!prio.empty()) //&& (out_degree(current_node, cluster_tree_) > 0)
+					)
 		{
-			current_node = prio.top();
 			prio.pop();
 
+			// check all children
 			BGL_FORALL_ADJ(current_node, child, cluster_tree_, ClusterTree)
 			{
-				prio.push(child);
+				// no leaf, traverse further
+				if (out_degree(child, cluster_tree_) > 0)
+				{
+					prio.push(child);
+				}
+				else // a leaf --> store as "cluster"
+				{
+					//std::set<Index> new_cluster = collectClusterBelow_(child);
+					std::set<Index> new_cluster;
+					new_cluster.insert(*(cluster_tree_[child].poses.begin()));
+					clusters_.push_back(new_cluster);
+					cluster_scores_.push_back(cluster_tree_[current_node].merged_at);
+				}
 			}
+			current_node = prio.top();
 		}
-		// get the clusters
+//cout << "found clusters: " << clusters_.size() << " size prio: " << prio.size() << " check min_size filter..." << endl;
+
+		// then we collect all clusters that pass the min_size filter
+		// --> we may end up with less than n clusters
 		while (!prio.empty())
 		{
-			clusters_.push_back(collectClusterBelow_(prio.top()));
-			cluster_scores_.push_back(cluster_tree_[prio.top()].merged_at);
+			// no leaves have been added to the priority queue
+			std::set<Index> new_cluster = collectClusterBelow_(prio.top());
+
+/*for (std::set<Index>::iterator s_it = new_cluster.begin(); s_it !=  new_cluster.end(); ++s_it)
+	cout << *s_it << " ";
+cout << endl;
+*/
+			if (new_cluster.size() > 0) //= min_size)
+			{
+				clusters_.push_back(new_cluster);
+				cluster_scores_.push_back(cluster_tree_[prio.top()].merged_at);
+			}
 			prio.pop();
+//cout << clusters_.size() << " " << prio.size() << endl;
 		}
 
+//cout << "after min size filter we finally get: " << clusters_.size() << endl;
+
 		return clusters_;
 	}
 
 
-	void PoseClustering::setConformationSet(ConformationSet* new_set)
+	std::vector<std::set<Index> > PoseClustering::filterClusters(Size min_size)
+	{
+//cout << "Got " << clusters_.size() << " clusters and min_size= " << min_size << endl;
+		std::vector< std::set<Index> >   temp_clusters;
+		std::vector< float >             temp_cluster_scores;
+
+//int c_counter = 0;
+		for (Size i = 0; i < clusters_.size(); i++)
+		{
+			if (clusters_[i].size() >= min_size)
+			{
+/*
+c_counter++;
+cout << "  ++ " << c_counter << " (" << clusters_[i].size() << "): ";
+for (std::set<Index>::iterator s_it = clusters_[i].begin(); s_it !=  clusters_[i].end(); ++s_it)
+	cout << *s_it << " ";
+cout << endl;
+*/
+
+				temp_clusters.push_back(clusters_[i]);
+				temp_cluster_scores.push_back(cluster_scores_[i]);
+			}
+		}
+		swap(clusters_, temp_clusters);
+		swap(cluster_scores_, temp_cluster_scores);
+		cluster_representatives_.clear();
+
+		return clusters_;
+	}
+
+	void PoseClustering::setConformationSet(ConformationSet* new_set, bool precompute_atombijection)
 	{
 		if (delete_conformation_set_)
 			delete current_set_;
@@ -221,8 +337,12 @@ namespace BALL
 		current_set_ = new_set;
 		base_system_ = new_set->getSystem();
 		storeSnapShotReferences_();
+
+		if (precompute_atombijection)
+			precomputeAtomBijection_();
 	}
 
+
 	void PoseClustering::setBaseSystemAndPoses(System const& base_system, std::vector<PosePointer> const& poses)
 	{
 		base_system_ = base_system;
@@ -237,6 +357,7 @@ namespace BALL
 		current_set_ = 0;
 	}
 
+
 	void PoseClustering::setBaseSystemAndTransformations(System const& base_system, String transformation_file_name)
 	{
 		// clear any potential pointers to old poses	
@@ -283,16 +404,16 @@ namespace BALL
 			if (poses_[0].snap == 0)
 			{
 				// but we don't have them... so let's produce some...
-				convertTransformations2Snaphots_();
+				convertTransformations2Snaphots();
 			}
-		} 
+		}
 		else if (rmsd_type == RIGID_RMSD)
 		{
 			// obviously, we need transforms
 			if (poses_[0].trafo == 0)
 			{
 				// but we don't have them... so let's produce some...
-				convertSnaphots2Transformations_();
+				convertSnaphots2Transformations();
 			}
 		}
 
@@ -315,6 +436,9 @@ namespace BALL
 			case NEAREST_NEIGHBOR_CHAIN_WARD:
 				result = nearestNeighborChainCompute_();
 				break;
+			case CLINK_ALTHAUS:
+				result = althausCompute_();
+				break;
 			default:
 				Log.error() << "Unknown parameter for option CLUSTER_METHOD " << options.get(Option::CLUSTER_METHOD) << endl;
 				result = false;
@@ -323,6 +447,7 @@ namespace BALL
 		return result;
 	}
 
+
 	bool PoseClustering::readTransformationsFromFile_(String filename)
 	{
 		poses_.clear();
@@ -344,7 +469,7 @@ namespace BALL
 			{
 				fields.clear();
 				current_transformation.split(fields);
-				
+
 				RigidTransformation rd;
 
 				rd.translation << fields[6].toFloat(), fields[10].toFloat(), fields[14].toFloat();
@@ -381,6 +506,7 @@ namespace BALL
 
 		// clean up old clusters
 		clusters_.clear();
+		cluster_representatives_.clear();
 		cluster_scores_.clear();
 
 		// reset the cluster tree
@@ -545,7 +671,7 @@ namespace BALL
 
 //cout << "Final num of clusters " << clusters_.size() << endl;
 //printClusters();
-//printClusterRMSDs();
+//printClusterScores();
 
 		return true;
 	}
@@ -581,7 +707,7 @@ namespace BALL
 			{
 				double percentage = current_level / (double)num_poses;
 				percentage *= 100. * percentage;
-//std::cout << current_level << " " << num_poses << " " << percentage << std::endl;
+std::cout << current_level << " " << num_poses << " " << percentage << std::endl;
 			}
 			// END TEST
 
@@ -617,6 +743,7 @@ namespace BALL
 		}
 		// convert lambda, pi, and mu to clusters datastructure
 		clusters_.clear();
+		cluster_representatives_.clear();
 		cluster_scores_.clear();
 
 //for (int i=0; i<pi_.size(); ++i)
@@ -657,7 +784,7 @@ namespace BALL
 				cluster_scores_.push_back(score_helper[current_cluster]);
 			}
 		}
-//printClusterRMSDs();
+//printClusterScores();
 		return true;
 	}
 
@@ -767,6 +894,10 @@ namespace BALL
 		*/
 	}
 
+	bool PoseClustering::althausCompute_()
+	{
+		return false;
+	}
 
 	bool PoseClustering::nearestNeighborChainCompute_()
 	{
@@ -785,6 +916,7 @@ namespace BALL
 		}
 		// clean up old clusters
 		clusters_.clear();
+		cluster_representatives_.clear();
 		cluster_scores_.clear();
 
 		// reset the cluster tree
@@ -792,13 +924,16 @@ namespace BALL
 
 		Index rmsd_type = options.getInteger(PoseClustering::Option::RMSD_TYPE);
 
+		bool run_parallel = options.getBool(PoseClustering::Option::RUN_PARALLEL);
+
 		float min_cluster_dist = std::numeric_limits<float>::max();
 
 		// the active clusters (as nodes in the cluster tree)
-		std::set<ClusterTreeNode> active_clusters;
+		std::vector<ClusterTreeNode> active_clusters;
+		active_clusters.reserve(num_poses);
 
-		// stack of clusters (as nodes in the cluster tree) storing nearest neighbor chains
-		std::stack<ClusterTreeNode> cluster_stack;
+		// stack of clusters (as indices into the active_cluster-vector) storing nearest neighbor chains
+		std::deque<Index> cluster_stack;
 
 		// in the beginning each pose is a cluster itself
 		for (Size i=0; i<num_poses; i++)
@@ -812,29 +947,37 @@ namespace BALL
 			cluster_tree_[v].current_cluster_id = -1;
 #endif
 
-			active_clusters.insert(v);
+			active_clusters.push_back(v);
 		}
 
 //cout << active_clusters.size() << " " << cluster_stack.size() << std::endl;
 
 		initWardDistance_(rmsd_type);
 
-		ClusterTreeNode current_cluster, nearest_cluster;
+		Index current_cluster, nearest_cluster;
+
+		Size num_active_clusters = num_poses;
 
 		// while there is more than one final cluster
-		while (active_clusters.size() > 1)
+		while (num_active_clusters > 1)
 		{
-//cout << "active clusters: " << active_clusters.size() << endl;
+			// TEST
+			if (num_active_clusters % 1000 == 0)
+			{
+				cout << "active clusters: " << num_active_clusters << " (" << 100.*num_active_clusters / (double)num_poses << ")" <<endl;
+			}
+			// END TEST
+
 			min_cluster_dist = std::numeric_limits<float>::max();
-			nearest_cluster = 0;
+			nearest_cluster = num_active_clusters - 1;
 
 			// if stack is empty add randomly
-			if (cluster_stack.size() == 0)
+			if (cluster_stack.empty())
 			{
 				// we simply take the first
-				cluster_stack.push(*(active_clusters.begin()));
+				cluster_stack.push_back(0);
 			}
-			current_cluster = cluster_stack.top();
+			current_cluster = cluster_stack.back();
 
 			// Compute the distances to all other clusters
 			// TODO: can this be guaranteed?
@@ -842,49 +985,69 @@ namespace BALL
 			//      tie-breaking rule: for instance, in this case, the nearest neighbor may be chosen, among the clusters 
 			//       at equal minimum distance from current_cluster, by numbering the clusters arbitrarily and choosing 
 			//       the one with the smallest index
-			for (std::set<ClusterTreeNode>::iterator clust_it = active_clusters.begin();
-					 clust_it != active_clusters.end(); ++clust_it)
+#ifdef BALL_HAS_TBB
+			if (run_parallel)
+			{
+//				std::cout << "Parallel computation...";
+				ComputeNearestClusterTask_ root_task(this, active_clusters, current_cluster, rmsd_type);
+				tbb::parallel_reduce(tbb::blocked_range<size_t>(0, num_active_clusters), root_task);
+//				std::cout << "...done." << std::endl;
+
+				nearest_cluster = root_task.getMinIndex();
+				min_cluster_dist = root_task.getMinValue();
+			}
+			else
+			{
+#endif
+			for (Index i=0; i<(Index)num_active_clusters; ++i)
 			{
 				// check all pairs between all_clusters[*clust_it] and all_clusters[current_cluster]
-				if (*clust_it != current_cluster)
+				if (i != current_cluster)
 				{
-					float rmsd = computeWardDistance_(current_cluster, *clust_it, rmsd_type);
+					float rmsd = computeWardDistance_(active_clusters[current_cluster], active_clusters[i], rmsd_type);
 
-					if (BALL_REAL_GREATER(min_cluster_dist, rmsd, 1e-5))
+					// for stability, make sure that "really" smaller cases are always taken...
+					if (BALL_REAL_LESS(rmsd, min_cluster_dist, 1e-5))
 					{
-						nearest_cluster = *clust_it;
+						nearest_cluster = i;
 						min_cluster_dist = rmsd;
 					}
 				}
 			}
+#ifdef BALL_HAS_TBB
+			}
+#endif
 
 			// have we put this cluster to the stack before ?
 			// due to the reducibility of Ward's distance, this would imply that the cluster
 			// was our predecessor.
 			if (cluster_stack.size() == 1) // we don't have a predecessor => just push
 			{
-				cluster_stack.push(nearest_cluster);
+				cluster_stack.push_back(nearest_cluster);
 				continue;
 			}
 
 			// look at the predecessor
-			cluster_stack.pop(); // already saved in current_cluster
+			cluster_stack.pop_back(); // already saved in current_cluster
 
-			ClusterTreeNode predecessor = cluster_stack.top();
+			Index predecessor = cluster_stack.back();
 			if (predecessor == nearest_cluster)
 			{
-				cluster_stack.pop(); // pop the predecessor
+				cluster_stack.pop_back(); // pop the predecessor
+
+				ClusterTreeNode current_node = active_clusters[current_cluster];
+				ClusterTreeNode nearest_node = active_clusters[nearest_cluster];
 
 				// add a new parent node to the tree
 				ClusterTreeNode new_parent = boost::add_vertex(cluster_tree_);
 
 				// make this parent the new root of the cluster tree
 				// (the final root will be the last parent we add)
-				cluster_tree_root_ = new_parent;
+				cluster_tree_[boost::graph_bundle] = new_parent;
 
 				// add an edge from the parent to both children
-				boost::add_edge(new_parent, current_cluster, cluster_tree_);
-				boost::add_edge(new_parent, nearest_cluster, cluster_tree_);
+				boost::add_edge(new_parent, current_node, cluster_tree_);
+				boost::add_edge(new_parent, nearest_node, cluster_tree_);
 
 				// remember the value at which these were merged
 				// NOTE: min_cluster_dist is the Ward distance, which is quadratic in the
@@ -894,20 +1057,20 @@ namespace BALL
 				//       squared average distance from the centroid per atom
 				cluster_tree_[new_parent].merged_at = sqrt(min_cluster_dist / number_of_selected_atoms_);
 
-				cluster_tree_[new_parent].size =    cluster_tree_[current_cluster].size
-					                                + cluster_tree_[nearest_cluster].size;
+				cluster_tree_[new_parent].size =    cluster_tree_[current_node].size
+					                                + cluster_tree_[nearest_node].size;
 #ifdef POSECLUSTERING_DEBUG 
 			 cluster_tree_[new_parent].current_cluster_id = -1;
 #endif
-
+//cout << cluster_tree_[new_parent].size << " " << num_poses << std::endl;
 //cout << " merged at: " << cluster_tree_[new_parent].merged_at << endl;
 
 				// TODO: here, we could decide if we want to merge the sets from our
 				//       children and explictly store them => save runtime, pay memory
 				//       (this would look similar to the following...)
 				/*
-				min_cluster_a = &clusters_[current_cluster];
-				min_cluster_b = &clusters_[nearest_cluster];
+				min_cluster_a = &clusters_[current_node];
+				min_cluster_b = &clusters_[nearest_node];
 
 				// merge
 				std::set<Index> temp_set;
@@ -917,20 +1080,42 @@ namespace BALL
 				*/
 
 				// Note: this needs to be done before clearing and swapping!
-				updateWardDistance_(new_parent, current_cluster, nearest_cluster, rmsd_type);
+				updateWardDistance_(new_parent, current_node, nearest_node, rmsd_type);
 
 				// make the old clusters inactive and add the new one
-				active_clusters.erase(current_cluster);
-				active_clusters.erase(nearest_cluster);
-				active_clusters.insert(new_parent);
+				// 
+				// in order to avoid unnecessary erases from the middle of the vector, we
+				// do the following:
+				//
+				// =====x====y=====k
+				//
+				// x and y are supposed to be erased, and we want to attach a new element behind k.
+				// instead, we now put k in x, and the new thing in y, and remove the last element => O(1)
+				//
+				// NOTE: this might invalidate our consistent tie breaking rule!
+				//
+				active_clusters[std::max(current_cluster, nearest_cluster)] = active_clusters.back();
+				active_clusters[std::min(current_cluster, nearest_cluster)] = new_parent;
+
+				// stupidly, we have to update all references to the formerly last element in the stack
+				for (std::deque<Index>::iterator s_it = cluster_stack.begin(); s_it != cluster_stack.end(); ++s_it)
+				{
+					if (*s_it == (Index)(num_active_clusters-1))
+					{
+						*s_it = std::max(current_cluster, nearest_cluster);
+					}
+				}
+
+				active_clusters.pop_back();
+
+				num_active_clusters--;
 
-				// push that cluster index onto the stack
-				cluster_stack.push(current_cluster);
+				cluster_stack.push_back(std::min(current_cluster, nearest_cluster));
 			}
 			else
 			{
-				cluster_stack.push(current_cluster);
-				cluster_stack.push(nearest_cluster);
+				cluster_stack.push_back(current_cluster);
+				cluster_stack.push_back(nearest_cluster);
 			}
 		}
 
@@ -952,9 +1137,6 @@ namespace BALL
 
 		if (rmsd_type == SNAPSHOT_RMSD)
 		{
-			// for snapshot-based rmsds, we will need a copy of the system later on
-			system_i_ = base_system_;
-
 			// and the number of atoms used for rmsd computation
 			for (AtomConstIterator atom_it = system_i_.beginAtom(); +atom_it; ++atom_it)
 			{
@@ -1138,26 +1320,33 @@ namespace BALL
 	{
 		// collect the respective leaves
 		std::set<Index> result;
-		std::stack<ClusterTreeNode> stack;
-		stack.push(v);
-
-		ClusterTreeNode current_node;
 
-		while (!stack.empty())
+		// is v itself a leaf?
+		if (out_degree(v, cluster_tree_) == 0)
 		{
-			current_node = stack.top();
-			stack.pop();
-
-			BGL_FORALL_ADJ(current_node, child, cluster_tree_, ClusterTree)
+			result.insert(*(cluster_tree_[v].poses.begin()));
+		}
+		else
+		{
+			std::stack<ClusterTreeNode> stack;
+			stack.push(v);
+			ClusterTreeNode current_node;
+			while (!stack.empty())
 			{
-				if (out_degree(child, cluster_tree_) == 0) // we found a leaf
-				{
-					// currently, each leaf represents one single pose
-					result.insert(*(cluster_tree_[child].poses.begin()));
-				}
-				else // something inbetween
+				current_node = stack.top();
+				stack.pop();
+
+				BGL_FORALL_ADJ(current_node, child, cluster_tree_, ClusterTree)
 				{
-					stack.push(child);
+					if (out_degree(child, cluster_tree_) == 0) // we found a leaf
+					{
+						// currently, each leaf represents one single pose
+						result.insert(*(cluster_tree_[child].poses.begin()));
+					}
+					else // something inbetween
+					{
+						stack.push(child);
+					}
 				}
 			}
 		}
@@ -1296,7 +1485,7 @@ namespace BALL
 					temp_cluster_scores.push_back(inner_pc.getClusterScore(j));
 				}
 //cout << "++++++++++++++++++++++++++++++***" << endl;
-//				inner_pc.printClusterRMSDs();
+//				inner_pc.printClusterScores();
 //cout << " cluster " << i << "( " << getClusterSize(i) << " ) was split into " << num_curr_clusters 
 //      << " clusters." << endl;
 //cout << "***++++++++++++++++++++++++++++++***" << endl;
@@ -1306,6 +1495,7 @@ namespace BALL
 		// switch the clusters
 		clusters_       = temp_clusters;
 		cluster_scores_ = temp_cluster_scores;
+		cluster_representatives_.clear();
 
 		//printClusters();
 
@@ -1332,7 +1522,7 @@ namespace BALL
 	}
 
 
-	void PoseClustering::printClusterRMSDs(std::ostream& out)
+	void PoseClustering::printClusterScores(std::ostream& out)
 	{
 		Index rmsd_type   = options.getInteger(Option::RMSD_TYPE);
 #ifdef POSECLUSTERING_DEBUG 
@@ -1348,7 +1538,7 @@ namespace BALL
 		for (Position i=0; i<clusters_.size(); ++i)
 		{
 			out << "=======================================" << endl;
-			out << "    Cluster " << i << "(" << getClusterScore(i) << ")" << endl;
+			out << "=   Cluster " << i << " (cluster score: " << getClusterScore(i) << ")" << endl;
 
 #ifdef POSECLUSTERING_DEBUG 
 			if (cluster_alg == NEAREST_NEIGHBOR_CHAIN_WARD)
@@ -1399,12 +1589,144 @@ namespace BALL
 		} //next cluster
 	}
 
-
-	void PoseClustering::exportWardClusterTree(std::ostream& out)
+	void PoseClustering::exportWardClusterTreeToGraphViz(std::ostream& out)
 	{
 		boost::write_graphviz(out, cluster_tree_, ClusterTreeWriter_(&cluster_tree_));
 	}
 
+	void PoseClustering::serializeWardClusterTree(std::ostream& out, bool binary)
+	{
+		if (binary)
+		{
+			boost::archive::binary_oarchive oa(out);
+			oa << cluster_tree_;
+		}
+		else
+		{
+			boost::archive::text_oarchive oa(out);
+			oa << cluster_tree_;
+		}
+	}
+
+	void PoseClustering::deserializeWardClusterTree(std::istream& in, bool binary)
+	{
+		if (binary)
+		{
+			boost::archive::binary_iarchive ia(in);
+			ia >> cluster_tree_;
+		}
+		else
+		{
+			boost::archive::text_iarchive ia(in);
+			ia >> cluster_tree_;
+		}
+
+		// unfortunately, old versions of boost don't serialize / deserialize graph_bundle properties... *sigh*
+		// so, be nice to them...
+#if BOOST_VERSION < 105100
+		// iterate over all nodes in the graph and find the one which has no in_edges
+		// this would be much simpler if boost would store in_degrees for directed graphs... we don't want a bidirectional graph, though
+		HashMap<ClusterTreeNode, Size> in_degrees;
+		BGL_FORALL_VERTICES(current_vertex, cluster_tree_, ClusterTree)
+		{
+			boost::graph_traits<ClusterTree>::out_edge_iterator e, e_end;
+
+			for (boost::tie(e, e_end) = boost::out_edges(current_vertex, cluster_tree_); e != e_end; ++e)
+			{
+				ClusterTreeNode target = boost::target(*e, cluster_tree_);
+				if (in_degrees.find(target) == in_degrees.end())
+				{
+					in_degrees[target] = 1;
+				}
+				else
+				{
+					in_degrees[target]++;
+				}
+			}
+		}
+
+		// now, iterate over the tree again to find the one node without a parent
+		BGL_FORALL_VERTICES(current_vertex, cluster_tree_, ClusterTree)
+		{
+			if (in_degrees[current_vertex] == 0)
+			{
+				cluster_tree_[boost::graph_bundle] = current_vertex;
+				break;
+			}
+		}
+#endif
+
+	}
+
+
+#ifdef BALL_HAS_TBB
+	PoseClustering::ComputeNearestClusterTask_::ComputeNearestClusterTask_(PoseClustering* parent,
+	                                           const std::vector<ClusterTreeNode>& active_clusters, 
+					                                   Position current_cluster, Index rmsd_type)
+		: parent_(parent),
+		  active_clusters_(active_clusters),
+			current_cluster_(current_cluster),
+			rmsd_type_(rmsd_type),
+			my_min_value_(std::numeric_limits<float>::max())
+	{
+	}
+
+	PoseClustering::ComputeNearestClusterTask_::ComputeNearestClusterTask_(PoseClustering::ComputeNearestClusterTask_& cnct, tbb::split)
+	  : parent_(cnct.parent_),
+		  active_clusters_(cnct.active_clusters_),
+		  current_cluster_(cnct.current_cluster_),
+			rmsd_type_(cnct.rmsd_type_),
+			my_min_value_(std::numeric_limits<float>::max())
+	{
+	}
+
+	void PoseClustering::ComputeNearestClusterTask_::join(ComputeNearestClusterTask_ const& cnct)
+	{
+		if (my_min_value_ > cnct.my_min_value_)
+		{
+			my_min_value_ = cnct.my_min_value_;
+			my_min_index_ = cnct.my_min_index_;
+		}
+	}
+
+	void PoseClustering::ComputeNearestClusterTask_::operator() (const tbb::blocked_range<size_t>& r)
+	{
+		// we use a local variable to squeeze out a little more efficiency, if possible
+		float    min_value = my_min_value_;
+		Position min_index = my_min_index_;
+
+		size_t end = r.end();
+		for (size_t i = r.begin(); i != end; ++i)
+		{
+			// check all pairs between all_clusters[*clust_it] and all_clusters[current_cluster]
+			if (i != current_cluster_)
+			{
+				float rmsd = parent_->computeWardDistance_(active_clusters_[current_cluster_], active_clusters_[i], rmsd_type_);
+
+				// for stability, make sure that "really" smaller cases are always taken...
+				if (BALL_REAL_LESS(rmsd, min_value, 1e-5))
+				{
+					min_index = i;
+					min_value = rmsd;
+				}
+			}
+		}
+
+		my_min_index_ = min_index;
+		my_min_value_ = min_value;
+	}
+#endif
+
+	template <class Archive>
+	void PoseClustering::ClusterProperties::serialize(Archive& ar, const unsigned int /*version*/)
+	{
+		ar & poses;
+		ar & size;
+		//		TODO: handle serialization of eigen matrix
+//		ar & center;
+		ar & merged_at;
+	}
+
 	void PoseClustering::ClusterTreeWriter_::operator() (std::ostream& out, const ClusterTreeNode& v) const
 	{
 		out << "[label=\"";
@@ -1477,6 +1799,8 @@ namespace BALL
 		Index rmsd_level_of_detail = temp_options.getInteger(Option::RMSD_LEVEL_OF_DETAIL);
 
 		// compute an atombijection
+		// Note: we cannot use precomputeAtomBijection as we might have 
+		// different systems sys_a and sys_b given
 		AtomBijection temp_atom_bijection;
 		StructureMapper mapper(sys_a, sys_b);
 
@@ -1500,7 +1824,7 @@ namespace BALL
 				Log.info() << "Option RMSDLevelOfDetaill::HEAVY_ATOMS not yet implemented" << endl;
 		}
 
-		// enter of masses
+		// center of masses
 		GeometricCenterProcessor center;
 		sys_a.apply(center);
 		Vector3 com_a = center.getCenter();
@@ -1537,7 +1861,6 @@ namespace BALL
 			Eigen::Matrix3f M_ab = rd_a.rotation - Eigen::Matrix3f::Identity();
 
 			rmsd = getRigidRMSD(t_ab, M_ab, temp_covariance_matrix);
-
 		}
 		else if (rmsd_type == PoseClustering::SNAPSHOT_RMSD)
 		{
@@ -1553,6 +1876,69 @@ namespace BALL
 	}
 
 
+	float PoseClustering::computeCompleteLinkageRMSD(Index i, Options temp_options, bool initialize)
+	{
+		if (i >= (Index)cluster_scores_.size())
+			throw(Exception::OutOfRange(__FILE__, __LINE__));
+
+		// we have to compute the maximal RMSD between all pairs in the cluster i
+
+		float rmsd = 0.;
+		Index rmsd_type            = temp_options.getInteger(Option::RMSD_TYPE);
+
+		// do we have to recompute the atombijection?
+		if (initialize)
+		{
+			// prepare whatever has to be prepared...
+			if ( (rmsd_type == SNAPSHOT_RMSD) || (rmsd_type == CENTER_OF_MASS_DISTANCE) )
+			{
+				// obviously, we need snapshots
+				if (poses_[0].snap == 0)
+				{
+					// but we don't have them... so let's produce some...
+					convertTransformations2Snaphots();
+				}
+			}
+			else if (rmsd_type == RIGID_RMSD)
+			{
+				// obviously, we need transforms
+				if (poses_[0].trafo == 0)
+				{
+					// but we don't have them... so let's produce some...
+					convertSnaphots2Transformations();
+				}
+			}
+
+			// precompute the atom bijection, that handles the 
+			// option RMSD_LEVEL_OF_DETAIL
+			precomputeAtomBijection_();
+		}
+
+		// now do the pairwise checking
+		for (set<Index>::iterator conf_it_i = clusters_[i].begin();
+				 conf_it_i != clusters_[i].end(); conf_it_i++)
+		{
+			poses_[*conf_it_i].snap->applySnapShot(system_i_);
+
+			for (set<Index>::iterator conf_it_j = conf_it_i; conf_it_j != clusters_[i].end(); conf_it_j++)
+			{
+				if (conf_it_i != conf_it_j)
+				{
+					if (rmsd_type == SNAPSHOT_RMSD)
+					{
+						poses_[*conf_it_j].snap->applySnapShot(system_j_);
+					}
+
+					float temp_rmsd = getRMSD_(*conf_it_i, *conf_it_j, rmsd_type);
+					rmsd = std::max(rmsd, temp_rmsd);
+				}
+			}
+		}
+
+		return rmsd;
+	}
+
+
 	boost::shared_ptr<System> PoseClustering::getPose(Index i) const
 	{
 		if (i >= (Index)poses_.size())
@@ -1594,19 +1980,50 @@ namespace BALL
 	}
 
 
-	boost::shared_ptr<System> PoseClustering::getClusterRepresentative(Index i) const
+	Index PoseClustering::findClusterRepresentative(Index i)
 	{
 		if (i >= (Index)clusters_.size())
 			throw(Exception::OutOfRange(__FILE__, __LINE__));
 
-		// as cluster representative we simply take the first cluster member
-		// this is a very simple heuristic :-)
-		// TODO: find the median?
+		Index rmsd_type = options.getInteger(Option::RMSD_TYPE);
+
+		// as cluster representative we simply compute the pose that 
+		// has the smallest deviation from all other cluster members
 
 		// take the first
-		Index conf_set_idx = *(clusters_[i].begin());
+		//Index conf_set_idx = *(clusters_[i].begin());
 
-		return getPose(conf_set_idx);
+		//std::set<Index> current_cluster = clusters_[i];
+
+		Index current_best = std::numeric_limits<Index>::max();
+		float min_distance = std::numeric_limits<float>::max();
+
+		for (set<Index>::iterator current_pose = clusters_[i].begin(); current_pose != clusters_[i].end(); current_pose++)
+		{
+			float sum_dist = 0;
+			for (set<Index>::iterator to_test_pose = clusters_[i].begin(); to_test_pose != clusters_[i].end(); to_test_pose++)
+			{
+				if (*current_pose != *to_test_pose)
+				{
+					sum_dist += getRMSD_(*current_pose, *to_test_pose, rmsd_type);
+				}
+			}
+			if (min_distance > sum_dist)
+			{
+				min_distance  = sum_dist;
+				current_best = *current_pose;
+			}
+		}
+		return current_best;
+	}
+
+
+	boost::shared_ptr<System> PoseClustering::getClusterRepresentative(Index i)
+	{
+		if (i >= (Index)clusters_.size())
+			throw(Exception::OutOfRange(__FILE__, __LINE__));
+
+		return getPose(findClusterRepresentative(i));
 	}
 
 
@@ -1624,6 +2041,9 @@ namespace BALL
 		options.setDefault(PoseClustering::Option::RMSD_TYPE,
 		                   PoseClustering::Default::RMSD_TYPE);
 
+		options.setDefault(PoseClustering::Option::RUN_PARALLEL,
+				               PoseClustering::Default::RUN_PARALLEL);
+
 //		options.setDefault(PoseClustering::Option::FULL_CLUSTER_DENDOGRAM,
 //				               PoseClustering::Default::FULL_CLUSTER_DENDOGRAM);
 	}
@@ -1638,7 +2058,7 @@ namespace BALL
 		{
 			// originally we were given transformations, not snapshots
 			// lets create some
-			convertTransformations2Snaphots_();
+			convertTransformations2Snaphots();
 		}
 		// create a new ConformationSet
 		boost::shared_ptr<ConformationSet> new_set(new ConformationSet());
@@ -1670,9 +2090,12 @@ namespace BALL
 		{
 			// originally we were given transformations, not snapshots
 			// lets create some
-			convertTransformations2Snaphots_();
+			convertTransformations2Snaphots();
 		}
 
+		cluster_representatives_.clear();
+		cluster_representatives_.resize(clusters_.size());
+
 		// create the set to be returned
 		boost::shared_ptr<ConformationSet> new_set(new ConformationSet());
 		new_set->setup(getSystem());
@@ -1681,11 +2104,12 @@ namespace BALL
 		// iterate over all clusters
 		for (Size i=0; i<clusters_.size(); i++)
 		{
-			// and take the first  
 			System conf(new_set->getSystem());
 
-			poses_[*clusters_[i].begin()].snap->applySnapShot(conf);
-
+			// get the cluster Representative
+			Index current_representative = findClusterRepresentative(i);
+			poses_[current_representative].snap->applySnapShot(conf);
+			cluster_representatives_[i] = current_representative;
 			new_set->add(0, conf);
 		}
 
@@ -1813,7 +2237,52 @@ namespace BALL
 		}
 	}
 
-	void PoseClustering::convertTransformations2Snaphots_()
+
+	void PoseClustering::applyTransformation2System(Index i, System& target_system)
+	{
+		// Please note, for efficiency reasons this code is copied 
+		// from function convertTransformations2Snaphots() below
+
+		if (i < (Index) poses_.size())
+		{
+			// compute the translation vector to the origin
+			GeometricCenterProcessor center;
+			target_system.apply(center);
+			Vector3 toOrigin = center.getCenter().negate();
+
+			// move to origin
+			TranslationProcessor translation;
+			translation.setTranslation(toOrigin);
+			target_system.apply(translation);
+
+			TransformationProcessor transformation;
+
+			RigidTransformation const& rigid_trafo = *(poses_[i].trafo);
+
+			Eigen::Vector3f const&     rd_translation = rigid_trafo.translation;
+			Eigen::Matrix3f const&     rd_rotation    = rigid_trafo.rotation;
+
+			// apply transformation and rotation
+			// NOTE: transformations given as input are always relative to the original pose
+			//       thus substraction of toOrigin is correct and more efficient than
+			//       the intuitive action sequence 
+			//             <toOrigin, pose rotate, negation of toOrigin, pose translation> !
+
+			transformation.setTransformation(Matrix4x4(rd_rotation(0,0), rd_rotation(0,1), rd_rotation(0,2), rd_translation(0) - toOrigin.x,
+						rd_rotation(1,0), rd_rotation(1,1), rd_rotation(1,2), rd_translation(1) - toOrigin.y,
+						rd_rotation(2,0), rd_rotation(2,1), rd_rotation(2,2), rd_translation(2) - toOrigin.z,
+						0, 0, 0, 1));
+
+			target_system.apply(transformation);
+		}
+		else
+		{
+			throw(Exception::OutOfRange(__FILE__, __LINE__));
+		}
+	}
+
+
+	void PoseClustering::convertTransformations2Snaphots()
 	{
 		if (current_set_ != NULL)
 		{
@@ -1854,7 +2323,10 @@ namespace BALL
 
 			// create a copy
 			System new_system(new_template_system);
+
 			// apply transformation and rotation
+			// NOTE: transformations given as input are always relative to the original pose
+			//       thus substraction of toOrigin is correct!
 			transformation.setTransformation(Matrix4x4(rd_rotation(0,0), rd_rotation(0,1), rd_rotation(0,2), rd_translation(0) - toOrigin.x,
 			                                           rd_rotation(1,0), rd_rotation(1,1), rd_rotation(1,2), rd_translation(1) - toOrigin.y,
 			                                           rd_rotation(2,0), rd_rotation(2,1), rd_rotation(2,2), rd_translation(2) - toOrigin.z,
@@ -1873,7 +2345,7 @@ namespace BALL
 	}
 
 
-	void PoseClustering::convertSnaphots2Transformations_()
+	void PoseClustering::convertSnaphots2Transformations()
 	{
 		// just to be sure...
 		transformations_.clear();
@@ -1929,7 +2401,12 @@ namespace BALL
 
 	void PoseClustering::printCluster_(Index i, std::ostream& out) const
 	{
-		out << "++++ cluster " << i << " score " << getClusterScore(i) << " ++++" << endl;
+		out << "++++ cluster " << i << " score " << getClusterScore(i) << " members "  << clusters_[i].size();
+
+		if (cluster_representatives_.size() <= i)
+				out  << " rep " << cluster_representatives_[i];
+	  out << " ++++" << endl;
+
 		std::copy(clusters_[i].begin(), clusters_[i].end(), std::ostream_iterator<Index>(out, " "));
 		out << endl;
 		out << "+++++++++++++++++++" << endl;
@@ -1938,7 +2415,7 @@ namespace BALL
 
 	void PoseClustering::printClusters(std::ostream& out) const
 	{
-		out << "\n\n    FINAL CLUSTERS     \n\n" << endl;
+		out << "+\n+\n+    FINAL CLUSTERS     \n+\n+" << endl;
 		for (Size i = 0; i < clusters_.size(); i++)
 		{
 			printCluster_(i, out);
@@ -1988,6 +2465,7 @@ namespace BALL
 		base_system_.clear();
 		base_conformation_.clear();
 		clusters_.clear();
+		cluster_representatives_.clear();
 		cluster_scores_.clear();
 		//rmsd_level_of_detail_;
 		lambda_.clear();
diff --git a/source/DOCKING/COMMON/staticLigandFragment.C b/source/DOCKING/COMMON/staticLigandFragment.C
index e7ab045..ff69c55 100644
--- a/source/DOCKING/COMMON/staticLigandFragment.C
+++ b/source/DOCKING/COMMON/staticLigandFragment.C
@@ -1,21 +1,3 @@
-/* staticLigandFragment.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/DOCKING/COMMON/structurePreparer.C b/source/DOCKING/COMMON/structurePreparer.C
index 22a2a46..a0e818d 100644
--- a/source/DOCKING/COMMON/structurePreparer.C
+++ b/source/DOCKING/COMMON/structurePreparer.C
@@ -1,21 +1,3 @@
-/* structurePreparer.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/DOCKING/GENETICDOCK/rotateBond.C b/source/DOCKING/GENETICDOCK/rotateBond.C
index b53fd0c..8cfb502 100644
--- a/source/DOCKING/GENETICDOCK/rotateBond.C
+++ b/source/DOCKING/GENETICDOCK/rotateBond.C
@@ -90,7 +90,7 @@ namespace BALL
 		*/
 		Quaternion quat;
 
-		quat.set(axis, a);
+        quat.fromAxisAngle(axis, a);
 
 		Matrix4x4 rotation;
 
@@ -127,18 +127,24 @@ namespace BALL
 			Atom* partner = it->getPartner(*probe);
 
 			if (partner == block)
-			if (probe == start)
-				continue;
-			else
-			{
-				cerr << "error: rotation axis is part of a ring" << endl;
-				exit(-1);
-			}
+            {
+                if (probe == start)
+                {
+                    continue;
+                }
+                else
+                {
+                    Log.error() << "error: rotation axis is part of a ring" << endl;
+                    exit(-1);
+                }
+            }
 
 			/** test if partner has not already been discoverd or is not block
 			*/
 			if (!hs.has(partner))
+            {
 				collectAtoms(partner, block, start, hs);
+            }
 		}
 	}
 
@@ -166,6 +172,7 @@ namespace BALL
 		/** if dihedral atoms are defined
 		*/
 		if (at3 != 0 && at4 != 0)
+        {
 			if (at1->isBoundTo(*nail_))
 			{
 				dihedral_heavy_ = at3;
@@ -176,6 +183,7 @@ namespace BALL
 				dihedral_heavy_ = at4;
 				dihedral_lite_ = at3;
 			}
+        }
 	}
 
 	Angle RotateBond::getDihedral()
diff --git a/source/DOCKING/IMGDOCK/IMGDock.C b/source/DOCKING/IMGDOCK/IMGDock.C
index c9db11b..da3ad4a 100644
--- a/source/DOCKING/IMGDOCK/IMGDock.C
+++ b/source/DOCKING/IMGDOCK/IMGDock.C
@@ -1,21 +1,3 @@
-/* IMGDock.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/DOCKING/geometricFit.C b/source/DOCKING/geometricFit.C
index 7423843..946f7a8 100755
--- a/source/DOCKING/geometricFit.C
+++ b/source/DOCKING/geometricFit.C
@@ -1239,8 +1239,8 @@ void GeometricFit::doPreTranslation_( ProteinIndex pro_idx )
 			mpi.sendOptions(options);
 
 			// and the systems
-			mpi.sendSystem(system1_);
-			mpi.sendSystem(system2_);
+			mpi.sendSystem(*system1_);
+			mpi.sendSystem(*system2_);
 
 			// now scatter the angles.
 			mpi.distributeDatapoints(rotAng.phi_,   our_phi);
@@ -1416,11 +1416,11 @@ std::cout << "I have " << rotation_num << " rotations" << std::endl;
 		delete(O);
 
 		System *S = mpi.receiveSystem();
-		system1_.set(*S, true);
+		system1_->set(*S, true);
 		delete(S);
 
 		S = mpi.receiveSystem();
-		system2_.set(*S, true);
+		system2_->set(*S, true);
 		delete(S);
 
 		/** Now receive the angles **/
@@ -1497,8 +1497,8 @@ std::cout << "I have " << rotation_num << " rotations" << std::endl;
 		peak_set_.clear();
 
 		// note: the backuped systems are systems after pre-translation.
-		system_backup_a_ = system1_;  // after pre-translation
-		system_backup_b_ = system2_;  // after pre-translation
+		system_backup_a_ = *system1_;  // after pre-translation
+		system_backup_b_ = *system2_;  // after pre-translation
 
 		// TODO: Use a vector
 		Peak_* top_n_peaks = new Peak_[options.getInteger(Option::TOP_N)];
@@ -1521,10 +1521,10 @@ std::cout << "I have " << rotation_num << " rotations" << std::endl;
 				Log << "rotation = " << phi << ";" << theta << ";" << psi << endl;
 			}
 
-			system2_ = system_backup_b_;
+			system2_ = &system_backup_b_;
 
 			detailed_timer.reset();
-			changeProteinOrientation_( system2_, Vector3( phi, theta, psi ) );
+			changeProteinOrientation_( *system2_, Vector3( phi, theta, psi ) );
 
 			if (verbosity > 10)
 			{
diff --git a/source/EXAMPLES/PDBChecker.C b/source/EXAMPLES/PDBChecker.C
index 891af81..7229f6c 100644
--- a/source/EXAMPLES/PDBChecker.C
+++ b/source/EXAMPLES/PDBChecker.C
@@ -7,6 +7,7 @@
 #include <BALL/FORMAT/PDBFile.h>
 #include <BALL/STRUCTURE/defaultProcessors.h>
 #include <BALL/STRUCTURE/residueChecker.h>
+#include <BALL/STRUCTURE/fragmentDB.h>
 
 using namespace BALL;
 using namespace std;
diff --git a/source/EXTENSIONS/PRESENTABALL/CMakeLists.txt b/source/EXTENSIONS/BALLAXY/CMakeLists.txt
similarity index 67%
copy from source/EXTENSIONS/PRESENTABALL/CMakeLists.txt
copy to source/EXTENSIONS/BALLAXY/CMakeLists.txt
index f9d8a20..55f4136 100644
--- a/source/EXTENSIONS/PRESENTABALL/CMakeLists.txt
+++ b/source/EXTENSIONS/BALLAXY/CMakeLists.txt
@@ -1,18 +1,20 @@
-PROJECT(PresentaBALL)
+PROJECT(BALLAXY)
 
 IF(NOT USE_QTWEBKIT)
-	MESSAGE(STATUS "QtWebkit support has not been enabled. Disabling the PresentaBALPresentaBALL plugin")
+	MESSAGE(STATUS "QtWebkit support has not been enabled. Disabling the BALLaxy plugin")
 	RETURN()
 ENDIF()
 
 SET(DIRECTORY source)
 ### list all filenames of the directory here ###
 SET(UI_SOURCES_LIST
+	${DIRECTORY}/BALLaxyInterfacePreferences.ui
 )
 
 SET(SOURCES_LIST
-	${DIRECTORY}/PresentaBALLPlugin.C
-	${DIRECTORY}/HTMLBasedInterface.C
+	${DIRECTORY}/BALLaxyPlugin.C
+	${DIRECTORY}/BALLaxyInterface.C
+	${DIRECTORY}/BALLaxyInterfacePreferences.C
 )
 
 SET(RCC_SOURCES_LIST
@@ -22,8 +24,9 @@ SET(RCC_SOURCES_LIST
 SET(DIRECTORY include)
 ### the list of all files requiring a moc run ###
 SET(MOC_SOURCES_LIST
-	${DIRECTORY}/PresentaBALLPlugin.h
-	${DIRECTORY}/HTMLBasedInterface.h
+	${DIRECTORY}/BALLaxyPlugin.h
+	${DIRECTORY}/BALLaxyInterface.h
+	${DIRECTORY}/BALLaxyInterfacePreferences.h
 )
 
 QT4_WRAP_CPP(MOC_OUTFILES ${MOC_SOURCES_LIST})
@@ -38,21 +41,21 @@ ADD_DEFINITIONS(-DQT_PLUGIN)
 ADD_DEFINITIONS(-DQT_NO_DEBUG)
 ADD_DEFINITIONS(-DQT_SHARED)
 
-ADD_LIBRARY(pluginPresentaBALL SHARED
+ADD_LIBRARY(pluginBALLaxy SHARED
 	${SOURCES_LIST}
 	${MOC_OUTFILES}
 	${RCC_OUTFILES}
 	${UIC_OUTFILES}
 )
 
-SET_TARGET_PROPERTIES(pluginPresentaBALL PROPERTIES
+SET_TARGET_PROPERTIES(pluginBALLaxy PROPERTIES
 	PREFIX ""
 )
 
-INSTALL(TARGETS pluginPresentaBALL
+INSTALL(TARGETS pluginBALLaxy
 	COMPONENT "${COMPONENT_PLUGINS}"
 	RUNTIME DESTINATION "${BALL_PLUGIN_INSTALL_DIRECTORY}"
 	LIBRARY DESTINATION "${BALL_PLUGIN_INSTALL_DIRECTORY}"
 )
 
-TARGET_LINK_LIBRARIES(pluginPresentaBALL BALL VIEW)
+TARGET_LINK_LIBRARIES(pluginBALLaxy BALL VIEW)
diff --git a/source/EXTENSIONS/BALLAXY/include/BALLaxyInterface.h b/source/EXTENSIONS/BALLAXY/include/BALLaxyInterface.h
new file mode 100644
index 0000000..e5f4b79
--- /dev/null
+++ b/source/EXTENSIONS/BALLAXY/include/BALLaxyInterface.h
@@ -0,0 +1,87 @@
+#ifndef BALLAXYINTERFACE_H
+#define BALLAXYINTERFACE_H
+
+#ifndef BALL_VIEW_WIDGETS_HTMLVIEW_H
+	#include <BALL/VIEW/WIDGETS/HTMLView.h>
+#endif
+
+#include <QtCore/QHash>
+#include <QtNetwork/QNetworkReply>
+#include <QReadWriteLock>
+
+namespace BALL
+{
+	class AtomContainer;
+
+	namespace VIEW
+	{
+		class BALLaxyInterfaceAction : public QObject
+		{
+			Q_OBJECT
+
+			public:
+				virtual QString getName() const = 0;
+
+			public slots:
+
+				void execute(const QList<QPair<QString, QString> >& parameters);
+
+			protected:
+				virtual void executeImpl_(const QList<QPair<QString, QString> >& parameters) = 0;
+
+			signals:
+				void finishedExecution();
+		};
+
+		class BALLaxyInterface : public HTMLView, public Embeddable
+		{
+			Q_OBJECT
+
+			public:
+				BALL_EMBEDDABLE(BALLaxyInterface, Embeddable)
+
+				BALLaxyInterface(MainControl* parent = 0);
+
+				virtual ~BALLaxyInterface();
+
+				void setBALLaxyBaseUrl(String const& ballaxy_base, String const& email, String const& password);
+
+				void registerAction(BALLaxyInterfaceAction* action);
+
+				bool uploadToBallaxy(AtomContainer* ac, const String& format);
+
+			public slots:
+				void sendPDBToBallaxy();
+				void sendMOL2ToBallaxy();
+				void handleDownload(QNetworkReply* request);
+				void loadFinished(bool ok);
+				void networkAccessFinished(QNetworkReply *);
+
+			protected:
+				typedef QList<QPair<QString, QString> > ParameterList;
+				void contextMenuEvent(QContextMenuEvent* evt);
+				QUrl ballaxy_base_;
+
+			protected slots:
+
+				void handleLinkClicked(const QUrl& url);
+				void executeLink(const QUrl& url);
+				void executePython_(const QString& action, const ParameterList& parameters);
+        void handleSslErrors(QNetworkReply* reply, const QList<QSslError> &errors);
+
+			private:
+				String script_base_;
+				QHash<QString, BALLaxyInterfaceAction*> action_registry_;
+
+				QMenu*   context_submenu_;
+				QAction* context_submenu_action_;
+				QAction* context_separator_;
+				QAction* context_action_pdb_;
+				QAction* context_action_mol2_;
+
+				QReadWriteLock page_lock_;
+		};
+	}
+}
+
+#endif // BALLAXYINTERFACE_H
diff --git a/source/EXTENSIONS/BALLAXY/include/BALLaxyInterfacePreferences.h b/source/EXTENSIONS/BALLAXY/include/BALLaxyInterfacePreferences.h
new file mode 100644
index 0000000..b136a2e
--- /dev/null
+++ b/source/EXTENSIONS/BALLAXY/include/BALLaxyInterfacePreferences.h
@@ -0,0 +1,57 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#ifndef BALLAXYINTERFACEPREFERENCES_H
+#define BALLAXYINTERFACEPREFERENCES_H
+
+#ifndef BALL_COMMON_GLOBAL_H
+# include <BALL/COMMON/global.h>
+#endif
+
+#ifndef BALL_VIEW_PLUGIN_VIEWPLUGIN_H
+# include <BALL/VIEW/PLUGIN/VIEWPlugin.h>
+#endif
+
+#include <ui_BALLaxyInterfacePreferences.h>
+
+#include <QtGui/QWidget>
+
+namespace BALL
+{
+	namespace VIEW
+	{
+
+		/** BALLaxyInterfacePreferences is a widget that will be inserted into the
+				tab dialog Preferences.
+				\ingroup ViewDialogs
+		*/
+		class BALLaxyInterfacePreferences 
+			:	public ConfigDialog,
+			  public Ui_BALLaxyInterfacePreferencesData
+		{
+			Q_OBJECT
+
+			public:
+			
+				/// Default Constructor.
+				BALLaxyInterfacePreferences(QWidget *parent = NULL, const char *name = "BALLaxyInterfacePreferences", Qt::WFlags fl=0);
+				
+				/// Destructor.
+				virtual ~BALLaxyInterfacePreferences();
+
+				///
+				virtual void storeValues();
+
+				///
+				void getSettings();
+
+				///
+				QUrl getBALLaxyBaseUrl();
+
+		};
+			
+	} 
+} // namespace
+
+#endif // BALLAXYINTERFACEPREFERENCES_H
diff --git a/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLPlugin.h b/source/EXTENSIONS/BALLAXY/include/BALLaxyPlugin.h
similarity index 75%
copy from source/EXTENSIONS/PRESENTABALL/include/PresentaBALLPlugin.h
copy to source/EXTENSIONS/BALLAXY/include/BALLaxyPlugin.h
index 15b359b..b0b59c6 100644
--- a/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLPlugin.h
+++ b/source/EXTENSIONS/BALLAXY/include/BALLaxyPlugin.h
@@ -1,10 +1,11 @@
-#ifndef PRESENTABALLPLUGIN_H
-#define PRESENTABALLPLUGIN_H
+#ifndef BALLAXYPLUGIN_H
+#define BALLAXYPLUGIN_H
 
 #include <QtCore/QObject>
 #include <QtGui/QPixmap>
 
-#include <HTMLBasedInterface.h>
+#include <BALLaxyInterface.h>
+#include <BALLaxyInterfacePreferences.h>
 
 #include <BALL/PLUGIN/BALLPlugin.h>
 #include <BALL/VIEW/PLUGIN/VIEWPlugin.h>
@@ -14,7 +15,7 @@ namespace BALL
 {
 	namespace VIEW
 	{
-		class PresentaBALLPlugin
+		class BALLaxyPlugin
 			: public QObject,
 			  public BALLPlugin,
 				public VIEWPlugin,
@@ -24,8 +25,8 @@ namespace BALL
 			Q_INTERFACES(BALL::BALLPlugin BALL::VIEW::VIEWPlugin BALL::VIEW::ModularWidgetPlugin)
 
 			public:
-				PresentaBALLPlugin();
-				virtual ~PresentaBALLPlugin();
+				BALLaxyPlugin();
+				virtual ~BALLaxyPlugin();
 
 				const QPixmap* getIcon() const;
 				QString getName() const;
@@ -43,9 +44,10 @@ namespace BALL
 			private:
 				QPixmap icon_;
 				bool is_active_;
+				BALLaxyInterfacePreferences* preferences_;
 		};
 	}
 }
 
 
-#endif // PRESENTABALLPLUGIN_H
+#endif // BALLAXYPLUGIN_H
diff --git a/source/EXTENSIONS/BALLAXY/source/BALLaxyInterface.C b/source/EXTENSIONS/BALLAXY/source/BALLaxyInterface.C
new file mode 100644
index 0000000..b408623
--- /dev/null
+++ b/source/EXTENSIONS/BALLAXY/source/BALLaxyInterface.C
@@ -0,0 +1,417 @@
+#include <BALLaxyInterface.h>
+
+#include <BALL/SYSTEM/path.h>
+#include <BALL/SYSTEM/directory.h>
+#include <BALL/KERNEL/system.h>
+#include <BALL/FORMAT/INIFile.h>
+#include <BALL/FORMAT/PDBFile.h>
+#include <BALL/SYSTEM/fileSystem.h>
+#include <BALL/SYSTEM/systemCalls.h>
+#include <BALL/PYTHON/pyInterpreter.h>
+#include <BALL/VIEW/KERNEL/common.h>
+#include <BALL/VIEW/KERNEL/mainControl.h>
+#include <BALL/VIEW/KERNEL/message.h>
+#include <BALL/VIEW/KERNEL/threads.h>
+#include <BALL/VIEW/WIDGETS/molecularControl.h>
+#include <BALL/KERNEL/atomContainer.h>
+#include <BALL/KERNEL/system.h>
+#include <BALL/KERNEL/molecule.h>
+#include <BALL/FORMAT/molFileFactory.h>
+
+#include <QEventLoop>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QNetworkCookieJar>
+#include <QNetworkCookie>
+#include <QWebElement>
+#include <QWebFrame>
+#include <QHttpMultiPart>
+#include <QSslError>
+#include <QWriteLocker>
+
+#include <QtCore/QDebug>
+
+namespace BALL
+{
+	namespace VIEW
+	{
+
+		void BALLaxyInterfaceAction::execute(const QList<QPair<QString, QString> >& parameters)
+		{
+			executeImpl_(parameters);
+
+			emit finishedExecution();
+		}
+
+		BALLaxyInterface::BALLaxyInterface(MainControl* parent)
+			: HTMLView(parent),
+				Embeddable()
+		{
+			registerThis();
+
+// NOTE: we cannot currently use link delegation, since qt does not provide information about the target frame of
+//       the link
+//			page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
+//			connect(this, SIGNAL(linkClicked(const QUrl&)), this, SLOT(handleLinkClicked(const QUrl&)));
+//			connect(this, SIGNAL( urlChanged(const QUrl&)), this, SLOT(executeLink(const QUrl&)));
+
+			connect(page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> & )),
+					    this, SLOT(handleSslErrors(QNetworkReply*, const QList<QSslError> & )));
+
+//			connect(page()->networkAccessManager(), SIGNAL(finished(QNetworkReply*)),
+//							this, SLOT(networkAccessFinished(QNetworkReply*)));
+
+			connect(page(), SIGNAL(unsupportedContent(QNetworkReply*)),
+					    this, SLOT(handleDownload(QNetworkReply*)));
+
+			connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
+
+			page()->setForwardUnsupportedContent(true);
+
+			// Here, we can register python scripts with which we could interact with BALLView from the HTML side
+			Path p;
+			script_base_ = p.find("BALLaxyInterface/scripts") + "/";
+
+			context_submenu_ = new QMenu(tr("Send to ballaxy"), this);
+			context_separator_      = MolecularControl::getInstance(0)->getContextMenu().addSeparator();
+			context_submenu_action_ = MolecularControl::getInstance(0)->getContextMenu().addMenu(context_submenu_);
+
+			context_action_pdb_  = context_submenu_->addAction(tr("as pdb"), this, SLOT(sendPDBToBallaxy()));
+			context_action_mol2_ = context_submenu_->addAction(tr("as mol2"), this, SLOT(sendMOL2ToBallaxy()));
+		}
+
+		BALLaxyInterface::~BALLaxyInterface()
+		{
+			for(QHash<QString, BALLaxyInterfaceAction*>::iterator it = action_registry_.begin(); it != action_registry_.end(); ++it)
+			{
+				delete it.value();
+			}
+
+			MolecularControl::getInstance(0)->getContextMenu().removeAction(context_separator_);
+			context_submenu_->removeAction(context_action_pdb_);
+			context_submenu_->removeAction(context_action_mol2_);
+			MolecularControl::getInstance(0)->getContextMenu().removeAction(context_submenu_action_);
+		}
+
+		void BALLaxyInterface::setBALLaxyBaseUrl(String const& ballaxy_base, String const& email, String const& password)
+		{
+			QWriteLocker lock(&page_lock_);
+			ballaxy_base_.setUrl(ballaxy_base.c_str());
+			load(ballaxy_base_.toString());
+			QEventLoop loop;
+			QObject::connect(this, SIGNAL(loadFinished(bool)), &loop, SLOT(quit()));
+			loop.exec();
+
+			// should we try to login?
+			if (email != "" && password != "")
+			{
+				// find main frame
+				QWebFrame* page_main_frame   = page()->mainFrame();
+				QWebFrame* galaxy_main_frame = page_main_frame;
+
+				if (galaxy_main_frame->frameName() != "galaxy_main") // try its children
+				{
+					foreach(QWebFrame* child_frame, page_main_frame->childFrames())
+					{
+						if (child_frame->frameName() == "galaxy_main")
+						{
+							galaxy_main_frame = child_frame;
+						}
+					}
+				}
+
+				if (!galaxy_main_frame)
+					return;
+
+				QString login_url = ballaxy_base_.toString().endsWith("/") ? "user/login" : "/user/login";
+				galaxy_main_frame->load(QUrl(ballaxy_base_.toString()+login_url));
+
+				QEventLoop loop;
+				QObject::connect(this, SIGNAL(loadFinished(bool)), &loop, SLOT(quit()));
+				loop.exec();
+
+				// now, find the email field in the page
+				QWebElement email_field = galaxy_main_frame->findFirstElement("input[name=email]");
+				email_field.setAttribute("value", email.c_str());
+
+				// and repeat for the password
+				QWebElement password_field = galaxy_main_frame->findFirstElement("input[name=password]");
+				password_field.setAttribute("value", password.c_str());
+
+				// find the login - button
+				QWebElement login_button = galaxy_main_frame->findFirstElement("input[name=login_button]");
+				login_button.evaluateJavaScript("this.click()");
+			}
+		}
+
+		void BALLaxyInterface::registerAction(BALLaxyInterfaceAction* action)
+		{
+			if(!action)
+			{
+				return;
+			}
+
+			QHash<QString, BALLaxyInterfaceAction*>::iterator it = action_registry_.find(action->getName());
+
+			if(it != action_registry_.end())
+			{
+				delete *it;
+			}
+
+			action_registry_.insert(action->getName(), action);
+		}
+
+		bool BALLaxyInterface::uploadToBallaxy(AtomContainer* ac, const String& format)
+		{
+			String tmp_filename = VIEW::createTemporaryFilename() + format;
+			GenericMolFile* mol_file = MolFileFactory::open(tmp_filename, std::ios::out);
+
+			// currently, we can only handle Molecules and Systems
+			if (dynamic_cast<System*>(ac) != 0)
+			{
+				*mol_file << *dynamic_cast<System*>(ac);
+				mol_file->close();
+			}
+			else if (dynamic_cast<Molecule*>(ac) != 0)
+			{
+				*mol_file << *dynamic_cast<Molecule*>(ac);
+				mol_file->close();
+			}
+			else
+			{
+				mol_file->close();
+				File::remove(tmp_filename);
+
+				return false;
+			}
+
+			// find main frame
+			QWebFrame* page_main_frame   = page()->mainFrame();
+			QWebFrame* galaxy_main_frame = page_main_frame;
+
+			if (galaxy_main_frame->frameName() != "galaxy_main") // try its children
+			{
+				foreach(QWebFrame* child_frame, page_main_frame->childFrames())
+				{
+					if (child_frame->frameName() == "galaxy_main")
+					{
+						galaxy_main_frame = child_frame;
+					}
+				}
+			}
+
+			galaxy_main_frame->load(QUrl(ballaxy_base_.toString()+"/tool_runner?tool_id=upload1"));
+			QEventLoop loop;
+			QObject::connect(this, SIGNAL(loadFinished(bool)), &loop, SLOT(quit()));
+			loop.exec();
+
+			// now, try to find the submit button in the page
+			QWebElement run_button = galaxy_main_frame->findFirstElement("input[name=runtool_btn]");
+
+			// also, find the input area
+			QWebElement text_field = galaxy_main_frame->findFirstElement("textarea");
+
+			std::ifstream input_stream(tmp_filename.c_str());
+			std::string content((std::istreambuf_iterator<char>(input_stream)), std::istreambuf_iterator<char>());
+
+			text_field.setPlainText(content.c_str());
+
+			run_button.evaluateJavaScript("this.click()");
+
+			File::remove(tmp_filename);
+
+			return true;
+		}
+
+		void BALLaxyInterface::handleLinkClicked(const QUrl& url)
+		{
+			if (!getMainControl()->isBusy())
+			{
+				load(url);
+			}
+		}
+
+		void BALLaxyInterface::contextMenuEvent(QContextMenuEvent*)
+		{
+			// here, we could, e.g., download structures to BALLView from a context menu in the web page
+		}
+
+		void BALLaxyInterface::executeLink(const QUrl& url)
+		{
+			QString action_name = url.queryItemValue("action");
+			if(action_name == QString::null)
+			{
+				return;
+			}
+
+			QString method_type = url.queryItemValue("method");
+			QString parameters  = url.queryItemValue("parameters");
+
+			//Ideally this if should be converted into another registry
+			if(method_type == "native")
+			{
+				QHash<QString, BALLaxyInterfaceAction*>::iterator it = action_registry_.find(action_name);
+
+				if(it != action_registry_.end())
+				{
+					(*it)->execute(url.queryItems());
+				}
+			}
+			else if(method_type == "" || method_type == "python")
+			{
+					executePython_(action_name, url.queryItems());
+			}
+		}
+
+		void BALLaxyInterface::executePython_(const QString& action, const ParameterList& parameters)
+		{
+			//Ensure, that the module search path is registered
+			static bool added_module_path = false;
+
+			if(!added_module_path)
+			{
+				PyInterpreter::run(String("sys.path.append(\"") + script_base_ + "\")", added_module_path);
+
+				if(!added_module_path)
+				{
+					Log.error() << "Could not add module path" << std::endl;
+					return;
+				}
+			}
+
+			//Search the module to load
+			QString load_module = "__main__";
+			for(ParameterList::const_iterator it = parameters.begin(); it != parameters.end(); ++it)
+			{
+				if(it->first == "module")
+				{
+					load_module = it->second;
+					break;
+				}
+			}
+
+			try
+			{
+				PyInterpreter::execute(load_module, action, parameters);
+			}
+			catch(Exception::FileNotFound)
+			{
+				Log.error() << "Could not execute action " << action.toAscii().data() << "\n No such file or directory." << std::endl;
+			}
+		}
+
+		// TODO: ask the user what to do (for the moment, we just ignore any ssl errors)
+		void BALLaxyInterface::handleSslErrors(QNetworkReply* reply, const QList<QSslError> &errors)
+		{
+			// TODO: reenable display of ssl errors
+			/*
+			Log.warn() << "Warning: got an ssl error: " << std::endl;
+			foreach (QSslError e, errors)
+			{
+				Log.warn() << ascii(e.errorString()) << std::endl;
+			}
+			*/
+			reply->ignoreSslErrors();
+		}
+
+		void BALLaxyInterface::sendPDBToBallaxy()
+		{
+			AtomContainer* ac = dynamic_cast<AtomContainer*>(MolecularControl::getInstance(0)->getContextComposite());
+
+			if (ac)
+			{
+				uploadToBallaxy(ac, ".pdb");
+			}
+		}
+
+		void BALLaxyInterface::sendMOL2ToBallaxy()
+		{
+			AtomContainer* ac = dynamic_cast<AtomContainer*>(MolecularControl::getInstance(0)->getContextComposite());
+
+			if (ac)
+			{
+				uploadToBallaxy(ac, ".mol2");
+			}
+		}
+
+		void BALLaxyInterface::loadFinished(bool ok)
+		{
+		}
+
+		void BALLaxyInterface::networkAccessFinished(QNetworkReply* reply)
+		{
+				Log.info() << "nam: " << ascii(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toString()) << std::endl;
+				Log.info() << "redirect: " << ascii(reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString()) << std::endl;
+				Log.info() << "error: " << reply->error() << std::endl;
+
+				QString data(reply->readAll());
+				Log.info() << "data: " << ascii(data) << std::endl;
+		}
+
+
+		void BALLaxyInterface::handleDownload(QNetworkReply* reply)
+		{
+			// if qt wants to signal that the user wants to download something,
+			// it generates an unsupportedContent-signal with the raw header
+			// "Content-Disposition" set
+			if (reply->hasRawHeader("Content-Disposition"))
+			{
+				// we need the filename to extract the type
+				String content_disposition = ascii(reply->rawHeader("Content-Disposition"));
+
+				// the string should have the format "attachment; filename"
+				if (content_disposition.hasPrefix("attachment;"))
+				{
+					String filename = content_disposition.after("attachment;");
+					std::vector<String> split;
+
+					// remove potential quotes introduced by the web server
+					filename.substituteAll("\"", "");
+					filename.substituteAll("\'", "");
+
+					filename.split(split, ".");
+
+					String extension = split.back();
+					if (MolFileFactory::isFileExtensionSupported(extension))
+					{
+						String tmp_filename = VIEW::createTemporaryFilename() + "." + extension;
+
+						// write the data to a file
+						QFile outfile(tmp_filename.c_str());
+						outfile.open(QIODevice::WriteOnly);
+						outfile.write(reply->readAll());
+						outfile.close();
+
+						// and read it back
+						System* system = new System();
+
+						GenericMolFile* molfile = MolFileFactory::open(tmp_filename, std::ios::in);
+						*molfile >> *system;
+						molfile->close();
+
+						File::remove(tmp_filename);
+
+						getMainControl()->setStatusbarText(String("read ")
+								      + String(system->countAtoms()) + " atoms from BALLaxy", true);
+
+						if (system->getName() == "")
+						{
+							system->setName(filename);
+						}
+
+						getMainControl()->insert(*system, system->getName());
+
+						CompositeMessage* cm = new CompositeMessage(*system, CompositeMessage::CENTER_CAMERA);
+						qApp->postEvent(parent(), new MessageEvent(cm));
+					}
+					else
+					{
+						Log.error() << "BALLaxy plugin: cannot download file of unsupported extension " 
+												<< extension << std::endl;
+					}
+				}
+			}
+		}
+
+	}
+}
diff --git a/source/EXTENSIONS/BALLAXY/source/BALLaxyInterfacePreferences.C b/source/EXTENSIONS/BALLAXY/source/BALLaxyInterfacePreferences.C
new file mode 100644
index 0000000..5744c6d
--- /dev/null
+++ b/source/EXTENSIONS/BALLAXY/source/BALLaxyInterfacePreferences.C
@@ -0,0 +1,51 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALLaxyInterfacePreferences.h>
+
+#include <BALLaxyInterface.h>
+#include <BALL/VIEW/KERNEL/common.h>
+
+#include <QtGui/QLineEdit>
+
+namespace BALL
+{
+	namespace VIEW
+	{
+
+		BALLaxyInterfacePreferences::BALLaxyInterfacePreferences(QWidget* parent, const char* name, Qt::WFlags fl)
+			: ConfigDialog(parent, fl),
+			  Ui_BALLaxyInterfacePreferencesData()
+				
+		{
+			setupUi(this);
+			setObjectName(name);
+			setINIFileSectionName("BALLAXYPlugin");
+			setWidgetStackName((String)tr("BALLaxyInterface"));
+
+			registerWidgets_();
+		}
+
+		BALLaxyInterfacePreferences::~BALLaxyInterfacePreferences()
+		{
+			#ifdef BALL_VIEW_DEBUG
+				Log.error() << "Destructing object " << (void *)this 
+										<< " of class BALLaxyInterfacePreferences" << endl;
+			#endif 
+		}
+
+		void BALLaxyInterfacePreferences::storeValues()
+		{
+			BALLaxyInterface* bi = BALLaxyInterface::getInstance(0);
+			if (bi == 0) return;
+
+			bi->setBALLaxyBaseUrl(ascii(url_edit->text()), ascii(login_edit->text()), ascii(password_edit->text()));
+		}
+
+		QUrl BALLaxyInterfacePreferences::getBALLaxyBaseUrl()
+		{
+			return QUrl(url_edit->text());
+		}
+	}
+} // namespaces
diff --git a/source/EXTENSIONS/BALLAXY/source/BALLaxyInterfacePreferences.ui b/source/EXTENSIONS/BALLAXY/source/BALLaxyInterfacePreferences.ui
new file mode 100644
index 0000000..c433fb3
--- /dev/null
+++ b/source/EXTENSIONS/BALLAXY/source/BALLaxyInterfacePreferences.ui
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>BALLaxyInterfacePreferencesData</class>
+ <widget class="QWidget" name="BALLaxyInterfacePreferencesData">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>669</width>
+    <height>426</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>0</width>
+    <height>0</height>
+   </size>
+  </property>
+  <property name="maximumSize">
+   <size>
+    <width>32000</width>
+    <height>32000</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>BALLaxyInterfacePreferences</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <widget class="QGroupBox" name="groupBox31">
+     <property name="title">
+      <string>BALLaxy-Interface Settings</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_3">
+      <item>
+       <widget class="QGroupBox" name="proxy_settings_group">
+        <property name="enabled">
+         <bool>true</bool>
+        </property>
+        <property name="title">
+         <string>Connection</string>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout_4">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout">
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_2">
+             <item>
+              <widget class="QLabel" name="textLabel1_2">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="minimumSize">
+                <size>
+                 <width>150</width>
+                 <height>27</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>ballaxy url</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLineEdit" name="url_edit">
+               <property name="enabled">
+                <bool>true</bool>
+               </property>
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="minimumSize">
+                <size>
+                 <width>25</width>
+                 <height>25</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>https://ballaxy.bioinf.uni-sb.de</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_4">
+             <item>
+              <widget class="QLabel" name="textLabel1_6">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="minimumSize">
+                <size>
+                 <width>150</width>
+                 <height>27</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>login</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLineEdit" name="login_edit">
+               <property name="enabled">
+                <bool>true</bool>
+               </property>
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="minimumSize">
+                <size>
+                 <width>25</width>
+                 <height>25</height>
+                </size>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_5">
+             <item>
+              <widget class="QLabel" name="textLabel1_5">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="minimumSize">
+                <size>
+                 <width>150</width>
+                 <height>27</height>
+                </size>
+               </property>
+               <property name="text">
+                <string>password</string>
+               </property>
+               <property name="alignment">
+                <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QLineEdit" name="password_edit">
+               <property name="enabled">
+                <bool>true</bool>
+               </property>
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="echoMode">
+                <enum>QLineEdit::Password</enum>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>NOTE: If given,  passwords are stored in cleartext in BALLView.ini!</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="verticalSpacer">
+        <property name="orientation">
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>40</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <tabstops>
+  <tabstop>url_edit</tabstop>
+ </tabstops>
+ <includes>
+  <include location="global">BALL/COMMON/global.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/source/EXTENSIONS/BALLAXY/source/BALLaxyPlugin.C b/source/EXTENSIONS/BALLAXY/source/BALLaxyPlugin.C
new file mode 100644
index 0000000..b88daef
--- /dev/null
+++ b/source/EXTENSIONS/BALLAXY/source/BALLaxyPlugin.C
@@ -0,0 +1,69 @@
+#include <BALLaxyPlugin.h>
+
+#include <BALL/VIEW/KERNEL/mainControl.h>
+
+Q_EXPORT_PLUGIN2(pluginBALLaxy, BALL::VIEW::BALLaxyPlugin)
+
+namespace BALL
+{
+	namespace VIEW
+	{
+		BALLaxyPlugin::BALLaxyPlugin()
+			: icon_(":pluginBALLaxy.png"),
+				is_active_(false),
+				preferences_(new BALLaxyInterfacePreferences())
+		{
+		}
+
+		BALLaxyPlugin::~BALLaxyPlugin()
+		{
+		}
+
+		QString BALLaxyPlugin::getName() const
+		{
+			return QString("BALLaxy");
+		}
+
+		QString BALLaxyPlugin::getDescription() const
+		{
+			return QString("An interface to the BALLaxy workflow engine.");
+		}
+
+		const QPixmap* BALLaxyPlugin::getIcon() const
+		{
+			return &icon_;
+		}
+
+		ConfigDialog* BALLaxyPlugin::getConfigDialog()
+		{
+			return preferences_;
+		}
+
+		ModularWidget* BALLaxyPlugin::createModularWidget(MainControl* main_control)
+		{
+			BALLaxyInterface* ballaxy_interface = new BALLaxyInterface(main_control);
+			HTMLViewDock*     ballaxy_view      = new HTMLViewDock(ballaxy_interface, main_control, String(tr("BALLaxy")).c_str());
+
+			preferences_->storeValues();
+
+			main_control->addDockWidget(Qt::BottomDockWidgetArea, ballaxy_view);
+
+			return ballaxy_view;
+		}
+
+		bool BALLaxyPlugin::activate()
+		{
+			is_active_ = true;
+
+			return true;
+		}
+
+		bool BALLaxyPlugin::deactivate()
+		{
+			is_active_ = false;
+
+			return true;
+		}
+
+	}
+}
diff --git a/source/EXTENSIONS/BALLAXY/source/logo.png b/source/EXTENSIONS/BALLAXY/source/logo.png
new file mode 100644
index 0000000..16cfe4e
Binary files /dev/null and b/source/EXTENSIONS/BALLAXY/source/logo.png differ
diff --git a/source/EXTENSIONS/BALLAXY/source/logo.qrc b/source/EXTENSIONS/BALLAXY/source/logo.qrc
new file mode 100644
index 0000000..84498ca
--- /dev/null
+++ b/source/EXTENSIONS/BALLAXY/source/logo.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+   <file alias="pluginBALLaxy.png">logo.png</file>
+</qresource>
+</RCC>
diff --git a/source/EXTENSIONS/BALLPluginComponents.cmake b/source/EXTENSIONS/BALLPluginComponents.cmake
index 942088c..2c5250e 100644
--- a/source/EXTENSIONS/BALLPluginComponents.cmake
+++ b/source/EXTENSIONS/BALLPluginComponents.cmake
@@ -4,8 +4,6 @@ ELSEIF(APPLE)
 	SET(COMPONENT_PLUGINS "BALL${BALL_PACKAGE_VERSION_MAJOR}.${BALL_PACKAGE_VERSION_MINOR}-plugins")
 ELSEIF(WIN32)
 	SET(COMPONENT_PLUGINS "")
-ELSE()
-	SET(COMPONENT_PLUGINS "")
 ENDIF()
 
 IF (COMPONENT_PLUGINS)
diff --git a/source/EXTENSIONS/CMakeLists.txt b/source/EXTENSIONS/CMakeLists.txt
index 1eddd32..708b21d 100644
--- a/source/EXTENSIONS/CMakeLists.txt
+++ b/source/EXTENSIONS/CMakeLists.txt
@@ -5,6 +5,7 @@ OPTION(USE_XML3D_PLUGIN "Build the XML3D plugin" ON)
 OPTION(USE_SPACENAV_PLUGIN "Build the SpaceNavigator input device plugin" ON)
 OPTION(USE_VRPN_PLUGIN "Build the VRPN input device plugin" ON)
 OPTION(USE_VRPNHD_PLUGIN "Build the VRPNDH input device plugin" ON)
+OPTION(USE_BALLAXY_PLUGIN "Build the BALLaxy widget plugin" ON)
 
 IF (USE_PRESENTABALL_PLUGIN)
 	ADD_SUBDIRECTORY(PRESENTABALL)
@@ -25,3 +26,7 @@ ENDIF()
 IF (USE_VRPNHD_PLUGIN)
 	ADD_SUBDIRECTORY(VRPNHD)
 ENDIF()
+
+IF (USE_BALLAXY_PLUGIN)
+	ADD_SUBDIRECTORY(BALLAXY)
+ENDIF()
diff --git a/source/EXTENSIONS/PRESENTABALL/CMakeLists.txt b/source/EXTENSIONS/PRESENTABALL/CMakeLists.txt
index f9d8a20..ca24568 100644
--- a/source/EXTENSIONS/PRESENTABALL/CMakeLists.txt
+++ b/source/EXTENSIONS/PRESENTABALL/CMakeLists.txt
@@ -1,17 +1,24 @@
 PROJECT(PresentaBALL)
 
+IF(NOT BALL_HAS_VIEW)
+	MESSAGE(STATUS "BALL is configured to not build the VIEW components. Disabling the PresentaBALL plugin.")
+	RETURN()
+ENDIF()
+
 IF(NOT USE_QTWEBKIT)
-	MESSAGE(STATUS "QtWebkit support has not been enabled. Disabling the PresentaBALPresentaBALL plugin")
+	MESSAGE(STATUS "QtWebkit support has not been enabled. Disabling the PresentaBALL plugin.")
 	RETURN()
 ENDIF()
 
 SET(DIRECTORY source)
 ### list all filenames of the directory here ###
 SET(UI_SOURCES_LIST
+	${DIRECTORY}/PresentaBALLSettings.ui
 )
 
 SET(SOURCES_LIST
 	${DIRECTORY}/PresentaBALLPlugin.C
+	${DIRECTORY}/PresentaBALLSettings.C
 	${DIRECTORY}/HTMLBasedInterface.C
 )
 
@@ -23,6 +30,7 @@ SET(DIRECTORY include)
 ### the list of all files requiring a moc run ###
 SET(MOC_SOURCES_LIST
 	${DIRECTORY}/PresentaBALLPlugin.h
+	${DIRECTORY}/PresentaBALLSettings.h
 	${DIRECTORY}/HTMLBasedInterface.h
 )
 
diff --git a/source/EXTENSIONS/PRESENTABALL/include/HTMLBasedInterface.h b/source/EXTENSIONS/PRESENTABALL/include/HTMLBasedInterface.h
index 4e444a6..8231dae 100644
--- a/source/EXTENSIONS/PRESENTABALL/include/HTMLBasedInterface.h
+++ b/source/EXTENSIONS/PRESENTABALL/include/HTMLBasedInterface.h
@@ -5,12 +5,15 @@
 	#include <BALL/VIEW/WIDGETS/HTMLView.h>
 #endif
 
+#include <QtCore/QSignalMapper>
 #include <QtCore/QHash>
 
 namespace BALL
 {
 	namespace VIEW
 	{
+		class PresentaBALLSettings;
+
 		class HTMLInterfaceAction : public QObject
 		{
 			Q_OBJECT
@@ -29,28 +32,50 @@ namespace BALL
 				void finishedExecution();
 		};
 
-		class HTMLBasedInterface : public HTMLView
+		class HTMLBasedInterface : public HTMLView, public ModularWidget
 		{
 			Q_OBJECT
+			BALL_EMBEDDABLE(HTMLBasedInterface, ModularWidget)
 
 			public:
-				HTMLBasedInterface(QWidget* parent = 0);
+				HTMLBasedInterface(QWidget* parent = 0, const char* name = 0);
 				virtual ~HTMLBasedInterface();
 
 				void registerAction(HTMLInterfaceAction* action);
+				virtual void onNotify(Message* message);
+
+				virtual void setIndexHTML(String const& index_html);
+				String const& getIndexHTML();
+
+				virtual void restoreDefaults();
+
+				virtual void applyPreferences();
 
+				PresentaBALLSettings* getSettings();
+
+			signals:
+				
+				void fireJSActionSignal(int actionType);
+				void fireJSMessage(int i, int j);
+				
 			protected:
 				typedef QList<QPair<QString, QString> > ParameterList;
 				void contextMenuEvent(QContextMenuEvent* evt);
+			
 			protected slots:
-
+				
+				void test(int i);
+				void exposeQObjectToJavascript();
 				void handleLinkClicked(const QUrl& url);
 				void executeLink(const QUrl& url);
 				void executePython_(const QString& action, const ParameterList& parameters);
 
 			private:
+				QSignalMapper *signalMapper;
+				String index_html_;
 				String script_base_;
 				QHash<QString, HTMLInterfaceAction*> action_registry_;
+				PresentaBALLSettings* settings_;
 		};
 	}
 }
diff --git a/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLPlugin.h b/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLPlugin.h
index 15b359b..5c5687a 100644
--- a/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLPlugin.h
+++ b/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLPlugin.h
@@ -5,6 +5,7 @@
 #include <QtGui/QPixmap>
 
 #include <HTMLBasedInterface.h>
+#include <PresentaBALLSettings.h>
 
 #include <BALL/PLUGIN/BALLPlugin.h>
 #include <BALL/VIEW/PLUGIN/VIEWPlugin.h>
@@ -43,6 +44,8 @@ namespace BALL
 			private:
 				QPixmap icon_;
 				bool is_active_;
+				HTMLBasedInterface* html_interface_;
+				PresentaBALLSettings* settings_;
 		};
 	}
 }
diff --git a/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLSettings.h b/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLSettings.h
new file mode 100644
index 0000000..3ccb3d3
--- /dev/null
+++ b/source/EXTENSIONS/PRESENTABALL/include/PresentaBALLSettings.h
@@ -0,0 +1,55 @@
+#ifndef BALL_EXTENSIONS_PRESENTABALLSETTINGS_H
+#define BALL_EXTENSIONS_PRESENTABALLSETTINGS_H
+
+#ifndef BALL_COMMON_GLOBAL_H
+# include <BALL/COMMON/global.h>
+#endif
+
+#include "ui_PresentaBALLSettings.h"
+
+// TODO: register as a preferencesentry
+#ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
+# include <BALL/VIEW/KERNEL/preferencesEntry.h>
+#endif
+
+#include <BALL/VIEW/PLUGIN/VIEWPlugin.h>
+
+#include <QtGui/QDialog>
+
+namespace BALL
+{
+	namespace VIEW
+	{
+		class HTMLBasedInterface;
+
+		class PresentaBALLSettings
+			: public ConfigDialog,
+			  public Ui_PresentaBALLSettingsData
+		{
+			Q_OBJECT
+
+			public:
+
+				/// Constructor
+				PresentaBALLSettings(HTMLBasedInterface* parent = 0,
+													 const char* name = "PresentaBALLSettings", Qt::WFlags fl = 0);
+
+				/// Destructor
+				~PresentaBALLSettings();
+
+				virtual void restoreDefaultValues(bool all = false);
+
+				void setIndexHTMLLocation(const QString& path);
+				QString getIndexHTMLLocation();
+
+			public slots:
+				virtual void selectIndexHTMLLocation();
+
+			protected:
+				HTMLBasedInterface* html_interface_;
+		};
+
+	}
+}
+
+#endif
diff --git a/source/EXTENSIONS/PRESENTABALL/source/HTMLBasedInterface.C b/source/EXTENSIONS/PRESENTABALL/source/HTMLBasedInterface.C
index 669dd1f..8330192 100644
--- a/source/EXTENSIONS/PRESENTABALL/source/HTMLBasedInterface.C
+++ b/source/EXTENSIONS/PRESENTABALL/source/HTMLBasedInterface.C
@@ -1,4 +1,5 @@
 #include <HTMLBasedInterface.h>
+#include <PresentaBALLSettings.h>
 
 #include <BALL/SYSTEM/path.h>
 #include <BALL/SYSTEM/directory.h>
@@ -7,6 +8,12 @@
 #include <BALL/PYTHON/pyInterpreter.h>
 #include <BALL/VIEW/KERNEL/common.h>
 #include <BALL/VIEW/KERNEL/mainControl.h>
+#include <BALL/VIEW/KERNEL/message.h>
+#include <BALL/VIEW/KERNEL/shortcutRegistry.h>
+#include <BALL/VIEW/WIDGETS/scene.h>
+
+#include <QtWebKit/QWebPage>
+#include <QtWebKit/QWebFrame>
 
 namespace BALL
 {
@@ -20,14 +27,40 @@ namespace BALL
 			emit finishedExecution();
 		}
 
-		HTMLBasedInterface::HTMLBasedInterface(QWidget* parent)
-			: HTMLView(parent)
+		HTMLBasedInterface::HTMLBasedInterface(QWidget* parent, const char* name)
+			: HTMLView(parent),
+				ModularWidget(name)
 		{
 			page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
 
+			settings_ = new PresentaBALLSettings(this);
+			
+			//create SignalMapper for Scene actions
+			signalMapper = new QSignalMapper(this);
+			
+			// make us available in Javascript, even after a new url has been loaded
+			connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(exposeQObjectToJavascript()));
+			
 			connect(this, SIGNAL(linkClicked(const QUrl&)), this, SLOT(handleLinkClicked(const QUrl&)));
 			connect(this, SIGNAL(urlChanged(const QUrl&)), this, SLOT(executeLink(const QUrl&)));
+			
+			restoreDefaults();
 
+			ModularWidget::registerWidget(this);
+		}
+
+		HTMLBasedInterface::~HTMLBasedInterface()
+		{
+			for(QHash<QString, HTMLInterfaceAction*>::iterator it = action_registry_.begin(); it != action_registry_.end(); ++it)
+			{
+				delete it.value();
+			}
+
+			ModularWidget::unregisterThis();
+		}
+
+		void HTMLBasedInterface::restoreDefaults()
+		{
 			Path p;
 			String s;
 			
@@ -53,7 +86,7 @@ namespace BALL
 
 			if (!s.isEmpty())
 			{
-			  setUrl(QUrl::fromLocalFile(QString(s.c_str()) + "/index.html"));
+				setIndexHTML((s + "/index.html").c_str());
 			}
 			else
 			{
@@ -63,14 +96,27 @@ namespace BALL
 			script_base_ = p.find("HTMLBasedInterface/scripts") + "/";
 		}
 
-		HTMLBasedInterface::~HTMLBasedInterface()
+		void HTMLBasedInterface::applyPreferences()
 		{
-			for(QHash<QString, HTMLInterfaceAction*>::iterator it = action_registry_.begin(); it != action_registry_.end(); ++it)
+			setIndexHTML(ascii(settings_->getIndexHTMLLocation()));
+		}
+
+		void HTMLBasedInterface::setIndexHTML(const String& index_html)
+		{
+			if (index_html != index_html_)
 			{
-				delete it.value();
+				index_html_ = index_html;
+				setUrl(QUrl::fromLocalFile(index_html_.c_str()));
+
+				settings_->setIndexHTMLLocation(index_html_.c_str());
 			}
 		}
 
+		String const& HTMLBasedInterface::getIndexHTML()
+		{
+			return index_html_;
+		}
+
 		void HTMLBasedInterface::registerAction(HTMLInterfaceAction* action)
 		{
 			if(!action)
@@ -87,6 +133,37 @@ namespace BALL
 
 			action_registry_.insert(action->getName(), action);
 		}
+		
+		void HTMLBasedInterface::test(int i)
+		{
+			emit fireJSActionSignal(i);
+		}
+		
+		void HTMLBasedInterface::exposeQObjectToJavascript()
+		{
+			QAction* action = 0;
+			
+			ShortcutRegistry& sr = MainControl::getInstance(0)->getShortcutRegistry();
+			
+			for(uint i = 0; i < sr.size(); i++)
+			{
+				action = sr[i].second;
+				if (action)
+				{
+					connect(action, SIGNAL(triggered()), signalMapper, SLOT(map()));
+					signalMapper->setMapping(action, i);
+					connect(signalMapper, SIGNAL(mapped(int)), this, SIGNAL(fireJSActionSignal(int)));
+					#ifdef BALL_VIEW_DEBUG
+					Log.info() << "Connected <" << action->text().toStdString() << "> action to JSActionSignal " << i << std::endl;
+					#endif
+				}
+			}
+			//add us (the object of HTMLBasedInterface) to JavaScript runtime of currently loaded page
+			page()->mainFrame()->addToJavaScriptWindowObject(QString("mywebview"), this);
+			
+			// Just for testing
+			//page()->mainFrame()->evaluateJavaScript("alert('Qt is good'); ");
+		}
 
 		void HTMLBasedInterface::handleLinkClicked(const QUrl& url)
 		{
@@ -96,6 +173,70 @@ namespace BALL
 			}
 		}
 
+		void HTMLBasedInterface::onNotify(Message* message)
+		{
+			//Try to cast message to the type, that you want to handle
+			CompositeMessage* cmsg = RTTI::castTo<CompositeMessage>(*message);
+			RepresentationMessage* rmsg = RTTI::castTo<RepresentationMessage>(*message);
+			SceneMessage* smsg = RTTI::castTo<SceneMessage>(*message);
+			DatasetMessage* dmsg = RTTI::castTo<DatasetMessage>(*message);			
+			
+			
+			if (cmsg == 0)
+			{
+
+				if (rmsg == 0)
+
+				{
+					if (smsg == 0)
+
+					{
+						if (dmsg == 0)
+						{
+							return;
+						}
+						else
+						{
+							emit fireJSMessage(3, (int) dmsg->getType()); //DataMessage = 3
+
+							#ifdef BALL_VIEW_DEBUG
+							Log.info() << "DataMessage fired to JS" << std::endl;
+							#endif
+						}
+					}
+					else
+					{
+
+						emit fireJSMessage(2, (int) smsg->getType()); //SceneMessage = 2
+
+						#ifdef BALL_VIEW_DEBUG
+						Log.info() << "SceneMessage fired to JS" << std::endl;
+						#endif
+					}
+				}
+				else
+				{
+					emit fireJSMessage(1, (int) rmsg->getType()); // RepresentationMessage = 1
+
+					#ifdef BALL_VIEW_DEBUG
+					Log.info() << "RepresentationMessage fired to JS" << std::endl;
+					#endif
+				}
+			}
+			else
+			{
+
+				// fire a Qt signal that can be handled by the website 
+				emit fireJSMessage(0, (int) cmsg->getType()); // CompositeMessage = 0
+
+				#ifdef BALL_VIEW_DEBUG
+				Log.info() << "CompositeMessage fired to JS" << std::endl;
+				#endif
+			}
+
+
+		}
+		
 		void HTMLBasedInterface::contextMenuEvent(QContextMenuEvent*)
 		{
 		}
@@ -168,5 +309,10 @@ namespace BALL
 #endif
 		}
 
+		PresentaBALLSettings* HTMLBasedInterface::getSettings()
+		{
+			return settings_;
+		}
+
 	}
 }
diff --git a/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLPlugin.C b/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLPlugin.C
index 07b3fd6..f6d2f01 100644
--- a/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLPlugin.C
+++ b/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLPlugin.C
@@ -10,7 +10,8 @@ namespace BALL
 	{
 		PresentaBALLPlugin::PresentaBALLPlugin()
 			: icon_(":pluginPresentaBALL.png"),
-				is_active_(false)
+				is_active_(false),
+				settings_(0)
 		{
 		}
 
@@ -35,13 +36,16 @@ namespace BALL
 
 		ConfigDialog* PresentaBALLPlugin::getConfigDialog()
 		{
-			return 0;
+			return settings_;
 		}
 
 		ModularWidget* PresentaBALLPlugin::createModularWidget(MainControl* main_control)
 		{
-			HTMLBasedInterface* html_interface = new HTMLBasedInterface(main_control);
-			HTMLViewDock*       html_view      = new HTMLViewDock(html_interface, main_control, String(tr("PresentaBALL")).c_str());
+			html_interface_ = new HTMLBasedInterface(main_control);
+
+			HTMLViewDock* html_view = new HTMLViewDock(html_interface_, main_control, String(tr("PresentaBALL")).c_str());
+
+			settings_ = html_interface_->getSettings();
 
 			if (UIOperationMode::instance().getMode() > UIOperationMode::MODE_ADVANCED)
 			{
diff --git a/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLSettings.C b/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLSettings.C
new file mode 100644
index 0000000..4696d52
--- /dev/null
+++ b/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLSettings.C
@@ -0,0 +1,58 @@
+#include <PresentaBALLSettings.h>
+#include <HTMLBasedInterface.h>
+
+#include <QLineEdit>
+#include <QFileDialog>
+
+#include <BALL/VIEW/KERNEL/common.h>
+
+namespace BALL
+{
+	namespace VIEW
+	{
+		PresentaBALLSettings::PresentaBALLSettings(HTMLBasedInterface* parent, const char* name, Qt::WFlags fl)
+			: ConfigDialog(parent, fl),
+			  Ui_PresentaBALLSettingsData(),
+				html_interface_(parent)
+		{
+			setupUi(this);
+			setObjectName(name);
+			setWidgetStackName((String)tr("PresentaBALL"));
+			setINIFileSectionName("PresentaBALL_PLUGIN");
+			registerWidgets_();
+
+			connect(browse_button, SIGNAL(clicked()), this, SLOT(selectIndexHTMLLocation()));
+		}
+
+		PresentaBALLSettings::~PresentaBALLSettings()
+		{
+		}
+
+		void PresentaBALLSettings::setIndexHTMLLocation(const QString& path)
+		{
+			index_html_edit->setText(path);
+		}
+
+		QString PresentaBALLSettings::getIndexHTMLLocation()
+		{
+			return index_html_edit->text();
+		}
+
+		void PresentaBALLSettings::selectIndexHTMLLocation()
+		{
+			QString new_location = QFileDialog::getOpenFileName(this, "Select a start page for PresentaBALL");
+
+			if (new_location != "")
+			{
+				setIndexHTMLLocation(new_location);
+			}
+		}
+
+		void PresentaBALLSettings::restoreDefaultValues(bool all)
+		{
+			PreferencesEntry::restoreDefaultValues(all);
+			html_interface_->restoreDefaults();
+		}
+
+	}
+}
diff --git a/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLSettings.ui b/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLSettings.ui
new file mode 100644
index 0000000..db06550
--- /dev/null
+++ b/source/EXTENSIONS/PRESENTABALL/source/PresentaBALLSettings.ui
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PresentaBALLSettingsData</class>
+ <widget class="QDialog" name="PresentaBALLSettingsData">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>530</width>
+    <height>83</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>PresentaBALL Settings</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="label">
+       <property name="text">
+        <string>user defined start page</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="index_html_edit">
+       <property name="toolTip">
+        <string>Position x</string>
+       </property>
+       <property name="text">
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="browse_button">
+       <property name="text">
+        <string>browse</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/source/EXTENSIONS/SPACENAV/CMakeLists.txt b/source/EXTENSIONS/SPACENAV/CMakeLists.txt
index b1a46fe..c212e31 100644
--- a/source/EXTENSIONS/SPACENAV/CMakeLists.txt
+++ b/source/EXTENSIONS/SPACENAV/CMakeLists.txt
@@ -1,5 +1,10 @@
 PROJECT(SPACENAVIGATOR)
 
+IF(NOT BALL_HAS_VIEW)
+	MESSAGE(STATUS "BALL is configured to not build the VIEW components. Disabling the SpaceNavigator plugin.")
+	RETURN()
+ENDIF()
+
 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
 
 FIND_PACKAGE(SpaceNavigator)
diff --git a/source/EXTENSIONS/SPACENAV/source/spaceNavigatorPlugin.C b/source/EXTENSIONS/SPACENAV/source/spaceNavigatorPlugin.C
index b7aed09..9cbbc8a 100644
--- a/source/EXTENSIONS/SPACENAV/source/spaceNavigatorPlugin.C
+++ b/source/EXTENSIONS/SPACENAV/source/spaceNavigatorPlugin.C
@@ -10,7 +10,8 @@ namespace BALL
 	namespace VIEW
 	{
 		SpaceNavigatorPlugin::SpaceNavigatorPlugin()
-			: icon_(":pluginSpaceNavigator.png")
+			: icon_(":pluginSpaceNavigator.png"),
+			  driver_(0)
 		{
 		}
 
diff --git a/source/EXTENSIONS/VRPN/CMakeLists.txt b/source/EXTENSIONS/VRPN/CMakeLists.txt
index 308b294..b47dadc 100644
--- a/source/EXTENSIONS/VRPN/CMakeLists.txt
+++ b/source/EXTENSIONS/VRPN/CMakeLists.txt
@@ -1,5 +1,10 @@
 PROJECT(VRPN)
 
+IF(NOT BALL_HAS_VIEW)
+	MESSAGE(STATUS "BALL is configured to not build the VIEW components. Disabling the VRPN plugin.")
+	RETURN()
+ENDIF()
+
 FIND_PACKAGE(VRPN)
 
 ## VRPN
diff --git a/source/EXTENSIONS/VRPNHD/CMakeLists.txt b/source/EXTENSIONS/VRPNHD/CMakeLists.txt
index 48f3309..99eec06 100644
--- a/source/EXTENSIONS/VRPNHD/CMakeLists.txt
+++ b/source/EXTENSIONS/VRPNHD/CMakeLists.txt
@@ -1,5 +1,10 @@
 PROJECT(VRPNHD)
 
+IF(NOT BALL_HAS_VIEW)
+	MESSAGE(STATUS "BALL is configured to not build the VIEW components. Disabling the VRPNHD plugin.")
+	RETURN()
+ENDIF()
+
 FIND_PACKAGE(VRPN)
 
 ## VRPN
diff --git a/source/EXTENSIONS/XML3D/CMakeLists.txt b/source/EXTENSIONS/XML3D/CMakeLists.txt
index 9799eb3..ae95d79 100644
--- a/source/EXTENSIONS/XML3D/CMakeLists.txt
+++ b/source/EXTENSIONS/XML3D/CMakeLists.txt
@@ -1,13 +1,18 @@
 PROJECT(XML3D)
 
+IF(NOT BALL_HAS_VIEW)
+	MESSAGE(STATUS "BALL is configured to not build the VIEW components. Disabling the XML3D plugin.")
+	RETURN()
+ENDIF()
+
 IF(NOT BALL_PYTHON_SUPPORT)
-	MESSAGE(STATUS "Python support has not been enabled. Disabling the XML3D plugin")
+	MESSAGE(STATUS "Python support has not been enabled. Disabling the XML3D plugin.")
 	RETURN()
 ENDIF()
 
 FIND_PACKAGE(Loudmouth)
 IF(NOT LIBLOUDMOUTH_FOUND)
-	MESSAGE(STATUS "libloudmouth not found. Disabling the XML3D plugin")
+	MESSAGE(STATUS "libloudmouth not found. Disabling the XML3D plugin.")
 	RETURN()
 ENDIF()
 INCLUDE_DIRECTORIES(${LIBLOUDMOUTH_INCLUDE_DIR} ${LIBLOUDMOUTH_PKGCONF_INCLUDE_DIRS})
diff --git a/source/EXTENSIONS/XML3D/Makefile b/source/EXTENSIONS/XML3D/Makefile
deleted file mode 100644
index 7ebbe06..0000000
--- a/source/EXTENSIONS/XML3D/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- Mode: C++; tab-width: 2; -*-
-# vi: set ts=2:
-#
-# Author:
-#  Anne Dehof
-#
-
-.PHONY: all clean depend
-
-DIRECTORY=EXTENSIONS/MULTITOUCH
-
-all:
-	@cd source; make all;
-
-depend:
-	@cd source; make depend;
-
-clean:
-	@cd source; make clean;
-
diff --git a/source/FORMAT/CIFParserLexer.l b/source/FORMAT/CIFParserLexer.l
index e89d8ca..a256497 100644
--- a/source/FORMAT/CIFParserLexer.l
+++ b/source/FORMAT/CIFParserLexer.l
@@ -278,5 +278,7 @@ VALUE								[.?]|({NUMERIC}|{CHARSTRING})
 
 void CIFParser_destroy()
 {
+#ifdef BALL_HAS_YYLEX_DESTROY
 	CIFParserlex_destroy();
+#endif
 }
diff --git a/source/FORMAT/HMOFile.C b/source/FORMAT/HMOFile.C
new file mode 100644
index 0000000..73565dd
--- /dev/null
+++ b/source/FORMAT/HMOFile.C
@@ -0,0 +1,448 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALL/FORMAT/HMOFile.h>
+
+namespace BALL
+{
+	HMOFile::HMOFile()
+		: LineBasedFile(),
+			charges_(),
+			comments_()
+	{
+	}
+
+	HMOFile::HMOFile(const String& filename, File::OpenMode open_mode)
+		: LineBasedFile(filename, open_mode),
+		  charges_(),
+			comments_()
+	{
+	}
+
+	HMOFile::~HMOFile()
+	{
+	}
+
+	void HMOFile::clear()
+	{
+		LineBasedFile::clear();
+
+		charges_.clear();
+		comments_.clear();
+	}
+
+	bool HMOFile::operator == (const HMOFile& file)
+	{
+		// ignore the comments for comparison
+		return (    (LineBasedFile::operator == (file)
+		         && (charges_ == file.charges_)));
+	}
+
+	bool HMOFile::open(const String& name, File::OpenMode open_mode)
+	{
+		return LineBasedFile::open(name, open_mode);
+	}
+	
+	bool HMOFile::read(Surface& surface)
+	{
+		// we can only read something if the file has been opened correctly
+		if (!isOpen() || getOpenMode() != MODE_IN)
+		{
+			return false;
+		}
+
+		// now make sure that there is no old crap lying around
+		charges_.clear();
+		comments_.clear();
+
+		// find the first block of interest (NODL_DATA)
+		if (!readUntil_("BEG_NODL_DATA"))
+		{
+			throw(Exception::ParseError(__FILE__, __LINE__, "HMOFile::read", "file does not contain node data"));	
+		}
+
+		readNodeData_(surface);
+
+		// now, find the geometric elements (ELEM_DATA)
+		if (!readUntil_("BEG_ELEM_DATA"))
+		{
+			throw(Exception::ParseError(__FILE__, __LINE__, "HMOFile::read", "file does not contain element data"));	
+		}
+
+		readElementData_(surface);
+
+		// now, see if there is additional charge data (CHARGE_DATA); if not, we are done
+		if (readUntil_("BEG_CHARGE_DATA"))
+		{
+			readChargeData_();	
+		}
+
+		return true;
+	}
+
+	bool HMOFile::write(Surface const& surface)
+	{
+		// we can only write something if the file has been opened correctly
+		if (!isOpen() || !(getOpenMode() & MODE_OUT))
+		{
+			throw File::CannotWrite(__FILE__, __LINE__, name_);
+		}
+
+		// write a comment as a header replacement
+		if (comments_.size() == 0)
+		{
+			getFileStream() << "# HYPERMESH file written by BALL::HMOFile" << std::endl << std::endl;
+		}
+		else
+		{
+			for (Position i=0; i<comments_.size(); ++i)
+			{
+				getFileStream() << comments_[i] << std::endl;
+			}
+			getFileStream() << std::endl;
+		}
+
+		writeNodes_(surface);
+		writeElements_(surface);
+
+		return true;
+	}
+
+	bool HMOFile::write(Surface const& surface, AtomContainer const& ac)
+	{
+		if (!isOpen() || !(getOpenMode() & MODE_OUT))
+		{
+			throw File::CannotWrite(__FILE__, __LINE__, name_);
+		}
+
+		// write a comment as a header replacement
+		if (comments_.size() == 0)
+		{
+			getFileStream() << "# HYPERMESH file for " << ac.getName() << ", written by BALL::HMOFile" << std::endl << std::endl;
+		}
+		else
+		{
+			for (Position i=0; i<comments_.size(); ++i)
+			{
+				getFileStream() << comments_[i] << std::endl;
+			}
+			getFileStream() << std::endl;
+		}
+
+		writeNodes_(surface);
+		writeElements_(surface);
+		writeCharges_(ac);
+
+		return true;
+	}
+
+	void HMOFile::readNodeData_(Surface& surface)
+	{
+		// at this point, we know that we are at the BEG_NODL_DATA line
+		bool parsing_done = false;
+
+		// the next line will contain the number of nodes
+		if (!readLine())
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readNodeData_", "node data does not contain number of entries");
+		}
+
+		Size num_nodes = 0;
+		try 
+		{
+			num_nodes = line_.toInt();	
+		} 
+		catch (...) 
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readNodeData_", "node data does not contain number of entries");
+		}
+
+		Size current_node = 0;
+		std::vector<String> split;
+
+		while (!parsing_done && readLine())
+		{
+			line_.split(split);
+
+			if (line_.hasSubstring("END_NODL_DATA"))
+			{
+				parsing_done = true;
+				break;
+			}
+
+			try 
+			{
+				surface.vertex.push_back(Vector3(split[1].toFloat(), split[2].toFloat(), split[3].toFloat()));
+			} 
+			catch (...) 
+			{
+				throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readNodeData_", "invalid node entry");
+			}
+
+			++current_node;
+		}
+
+		if (current_node != num_nodes)
+		{
+			Log.warn() << "HMOFile::readNodeData_: number of nodes found (" 
+			           << current_node 
+								 << ") does not match number of nodes expected ("
+								 << num_nodes
+								 << ")!" << std::endl;
+		}
+
+		if (!parsing_done)
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readNodeData_", "node data not correctly terminated");
+		}	
+	}
+
+	void HMOFile::readElementData_(Surface& surface)
+	{
+		// at this point, we know that we are at the BEG_ELEM_DATA line
+		bool parsing_done = false;
+
+		// the next line will contain the number of elements of the different supported kinds
+		if (!readLine())
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readElementData_", "element data does not contain number of entries");
+		}
+
+		std::vector<String> elem_numbers;
+		line_.split(elem_numbers);
+
+		if (elem_numbers.size() != 13)
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readElementData_", "format error in first line of elements block (expected 13 numbers)");
+		}
+
+		Size total_num_elements = 0;
+		try 
+		{
+			total_num_elements = elem_numbers[0].toInt();
+
+			Size sum_elements = elem_numbers[1].toInt();
+			for (Position i=2; i<13; ++i)
+				sum_elements += elem_numbers[i].toInt();
+
+			if (total_num_elements != sum_elements)
+			{
+				Log.warn() << "HMOFile::readElementData_: number of total elements (" 
+									 << total_num_elements 
+									 << ") does not match sum of elements by type ("
+									 << sum_elements
+									 << ")!" << std::endl;
+			}
+		} 
+		catch (...) 
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readElementData_", "format error in number of elements");
+		}
+
+		Size current_elem = 0;
+		std::vector<String> split;
+
+		while (!parsing_done && readLine())
+		{
+			line_.split(split);
+
+			if (line_.hasSubstring("END_ELEM_DATA"))
+			{
+				parsing_done = true;
+				break;
+			}
+
+			try 
+			{
+				// TODO: generate different surfaces for different components. so far, we just ignore it
+				Size component_number = split[1].toInt();
+
+				if (component_number != 1)
+				{
+					Log.warn() << "HMOFile::readElementData_: support for multiple components is not implemented yet" << std::endl;
+				}
+
+				Size element_type = split[2].toInt();
+
+				if (element_type != T3)
+				{
+					Log.warn() << "HMOFile::readElementData_: support for non-triangular elements not implemented yet; ignoring element" << std::endl;
+					continue;
+				}
+
+				Surface::Triangle t;
+				t.v1 = split[3].toInt();
+				t.v2 = split[4].toInt();
+				t.v3 = split[5].toInt();
+
+				surface.triangle.push_back(t);
+			} 
+			catch (...) 
+			{
+				throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readNodeData_", "invalid element entry");
+			}
+
+			++current_elem;
+		}
+
+		if (current_elem != total_num_elements)
+		{
+			Log.warn() << "HMOFile::readElementData_: number of elements found (" 
+			           << current_elem 
+								 << ") does not match number of elements expected ("
+								 << total_num_elements
+								 << ")!" << std::endl;
+		}
+
+		if (!parsing_done)
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readElementData_", "element data not correctly terminated");
+		}	
+	}
+
+	void HMOFile::readChargeData_()
+	{
+		// at this point, we know that we are at the BEG_CHARGE_DATA line
+		bool parsing_done = false;
+
+		// the next line will contain the number of charges
+		if (!readLine())
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readChargeData_", "charge data does not contain number of entries");
+		}
+
+		Size num_charges = 0;
+		try 
+		{
+			num_charges = line_.toInt();	
+		} 
+		catch (...) 
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readChargeData_", "charge data does not contain number of entries");
+		}
+
+		Size current_charge = 0;
+		std::vector<String> split;
+
+		while (!parsing_done && readLine())
+		{
+			line_.split(split);
+
+			if (line_.hasSubstring("END_CHARGE_DATA"))
+			{
+				parsing_done = true;
+				break;
+			}
+
+			try 
+			{
+				HMOCharge c;
+
+				c.position.x = split[1].toFloat();
+				c.position.y = split[2].toFloat();
+				c.position.z = split[3].toFloat();
+
+				c.value = split[4].toFloat();
+
+				charges_.push_back(c);
+			} 
+			catch (...) 
+			{
+				throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readChargeData_", "invalid charge entry");
+			}
+
+			++current_charge;
+		}
+
+		if (current_charge != num_charges)
+		{
+			Log.warn() << "HMOFile::readChargeData_: number of charges found (" 
+			           << current_charge 
+								 << ") does not match number of charges expected ("
+								 << num_charges
+								 << ")!" << std::endl;
+		}
+
+		if (!parsing_done)
+		{
+			throw Exception::ParseError(__FILE__, __LINE__, "HMOFile::readChargeData_", "charge data not correctly terminated");
+		}	
+	}
+
+	bool HMOFile::readUntil_(String const& pattern)
+	{
+		bool pattern_found = false;
+
+		while (!pattern_found && readLine())
+		{
+			// is this a comment?
+			if (line_.hasPrefix("#"))
+			{
+				comments_.push_back(line_);
+
+				continue;
+			}
+
+			// nope. does it match the pattern?
+			if (line_.hasSubstring(pattern))
+			{
+				pattern_found = true;
+			}
+		}
+
+		return pattern_found;
+	}
+
+	void HMOFile::writeNodes_(Surface const& surface)
+	{
+		getFileStream() << "BEG_NODL_DATA" << std::endl;
+		getFileStream() << "\t" << surface.vertex.size() << std::endl;
+
+		for (Position i=0; i<surface.vertex.size(); ++i)
+		{
+			Vector3 const& v = surface.vertex[i];
+
+			getFileStream() << "\t" << i+1 << " " << v.x << " " << v.y << " " << v.z << std::endl;
+		}
+
+		getFileStream() << "END_NODL_DATA" << std::endl << std::endl;
+	}
+
+	void HMOFile::writeElements_(Surface const& surface)
+	{
+		getFileStream() << "BEG_ELEM_DATA" << std::endl;
+
+		// NOTE: so far, we only support elements of type T3, and single components
+		Size num_triangles = surface.triangle.size();
+		getFileStream() << "\t" << num_triangles << " 0 0 " << num_triangles << " 0 0 0 0 0 0 0 0 0" << std::endl;
+
+		for (Position i=0; i<num_triangles; ++i)
+		{
+			Surface::Triangle const& t = surface.triangle[i];
+
+			getFileStream() << "\t" << i+1 << "\t" << 1 << " " << T3 << "\t";
+			getFileStream() << t.v1 << " " << t.v2 << " " << t.v3 << std::endl;
+		}
+
+		getFileStream() << "END_ELEM_DATA" << std::endl << std::endl;
+	}
+
+	void HMOFile::writeCharges_(AtomContainer const& ac)
+	{
+		getFileStream() << "BEG_CHARGE_DATA" << std::endl;
+
+		Size num_charges = ac.countAtoms();
+		getFileStream() << "\t" << num_charges << std::endl;
+
+		Size current_atom = 1;
+		for (AtomConstIterator at_it = ac.beginAtom(); +at_it; ++at_it)
+		{
+			Vector3 const& pos = at_it->getPosition();
+			getFileStream() << "\t" << current_atom << " " << pos.x << " " << pos.y << " " << pos.z << " " << at_it->getCharge() << std::endl;
+			++current_atom;
+		}
+
+		getFileStream() << "END_CHARGE_DATA" << std::endl;
+	}
+}
diff --git a/source/FORMAT/NMRStarFile.C b/source/FORMAT/NMRStarFile.C
index 2f6231a..de5c092 100644
--- a/source/FORMAT/NMRStarFile.C
+++ b/source/FORMAT/NMRStarFile.C
@@ -1249,21 +1249,52 @@ Log.info()  << "NMRStarfile::assignShifts(): number of mismatched residues: "
 			if (atom_data_sets_.size() > i)
 			{	
 				bool identical_sequences = true;
-				std::vector<NMRAtomData> atom_data = atom_data_sets_[0].atom_data;
+				std::vector<NMRAtomData> const& atom_data = atom_data_sets_[i].atom_data;
 				String residue_sequence = monomeric_polymers_[i].residue_sequence;
-				
+				bool is_dna = monomeric_polymers_[i].polymer_class == "DNA";	
+				bool is_rna = monomeric_polymers_[i].polymer_class == "RNA";	
+
 				for (Position j=0; identical_sequences && (j<atom_data.size()); j++)
 				{
-					if (   (  atom_data[j].residue_seq_code != POSITION_VALUE_NA ) 
-							&& (  atom_data[j].residue_seq_code - 1 < residue_sequence.size())
-							&& (   residue_sequence[atom_data[j].residue_seq_code - 1] 
-							    != Peptides::OneLetterCode(atom_data[j].residue_label))
-						 )
+					if (atom_data[j].residue_seq_code == POSITION_VALUE_NA)
 					{
 						identical_sequences = false;
-						Log.warn() << "NMRStarFile::getResidueSequence(): Warning: Inconsistent residue sequence information." 
-						           << residue_sequence[atom_data[j].residue_seq_code - 1] 
-											 << " != "  << Peptides::OneLetterCode(atom_data[j].residue_label) << endl;
+						Log.warn() << "NMRStarFile::getResidueSequence(): Warning: invalid residue sequence code" << std::endl;
+					}
+
+					if (atom_data[j].residue_seq_code - 1 >= residue_sequence.size())
+					{
+						identical_sequences = false;
+						Log.warn() << "NMRStarFile::getResidueSequence(): Warning: residue sequence code " << atom_data[j].residue_seq_code 
+						           << " is larger than the sequence length (" << residue_sequence.size() << ")" << std::endl;
+					}
+
+					// now check if the residue information is consistent
+					char current_letter = residue_sequence[atom_data[j].residue_seq_code - 1];
+
+					if (current_letter == 'X') // this case is handled like a wildcard character
+						continue;
+
+					// currently, we treat polymers of type DNA or RNA differently. all else is considered a protein
+					if (is_dna || is_rna)
+					{
+						if (current_letter != atom_data[j].residue_label)
+						{
+							identical_sequences = false;
+							Log.warn() << "NMRStarFile::getResidueSequence(): Warning: Inconsistent residue sequence information." 
+								         << residue_sequence[atom_data[j].residue_seq_code - 1] 
+											   << " != "  << Peptides::OneLetterCode(atom_data[j].residue_label) << endl;
+						}
+					}
+					else
+					{
+						if (current_letter != Peptides::OneLetterCode(atom_data[j].residue_label))
+						{
+							identical_sequences = false;
+							Log.warn() << "NMRStarFile::getResidueSequence(): Warning: Inconsistent residue sequence information." 
+								         << residue_sequence[atom_data[j].residue_seq_code - 1] 
+											   << " != "  << Peptides::OneLetterCode(atom_data[j].residue_label) << endl;
+						}
 					}
 				}
 		
@@ -2251,12 +2282,12 @@ Log.info()  << "NMRStarfile::assignShifts(): number of mismatched residues: "
 		return result;
 	}
 
-	bool NMRStarFile::operator == (const NMRStarFile& f)  
+	bool NMRStarFile::operator == (const NMRStarFile& f) const 
 	{
 		return File::operator == (f);
 	}
 
-	bool NMRStarFile::operator != (const NMRStarFile& f)  
+	bool NMRStarFile::operator != (const NMRStarFile& f) const 
 	{
 		return !(*this == f);
 	}
diff --git a/source/FORMAT/PDBFileDetails.C b/source/FORMAT/PDBFileDetails.C
index 97c2572..aedc5db 100644
--- a/source/FORMAT/PDBFileDetails.C
+++ b/source/FORMAT/PDBFileDetails.C
@@ -901,7 +901,7 @@ namespace BALL
 	{
 		if (!(current_protein_->hasProperty("CRYSTALINFO")))
 		{
-			boost::shared_ptr<CrystalInfo> temp_ptr(new CrystalInfo());
+			boost::shared_ptr<PersistentObject> temp_ptr(new CrystalInfo());
 			current_protein_->setProperty(NamedProperty("CRYSTALINFO", temp_ptr));
 		}
 
diff --git a/source/FORMAT/SCWRLRotamerFile.C b/source/FORMAT/SCWRLRotamerFile.C
index 6ad3dd4..ee0c762 100644
--- a/source/FORMAT/SCWRLRotamerFile.C
+++ b/source/FORMAT/SCWRLRotamerFile.C
@@ -32,14 +32,15 @@ namespace BALL
 		void SCWRLRotamerFile::operator >> (RotamerLibrary& rotamer_library)
 		{
 			// Ok, this is stupid, but at least better and faster than what we used to do.
-			// We first try to read the file as a backbone dependent version. If this fails,
-			// we try the backbone independent variant before we barf.
+			// We first try to read the file as a backbone-dependent version. If this fails,
+			// we try the backbone-independent variant before we barf.
 
-			try {
-				readSCWRLBackboneDependentLibraryFile_(rotamer_library);
+			try 
+			{
+				readSCWRLBackboneDependentLibraryFile(rotamer_library);
 			} catch (...) { // ok, it was not a backbone dependent library. But is it indep?
 				rewind();
-				readSCWRLBackboneIndependentLibraryFile_(rotamer_library);
+				readSCWRLBackboneIndependentLibraryFile(rotamer_library);
 			}
 
 			if (!rotamer_library.validate())
@@ -50,7 +51,7 @@ namespace BALL
 			return;
 		}
 
-		void SCWRLRotamerFile::readSCWRLBackboneDependentLibraryFile_(RotamerLibrary& rotamer_library)
+		void SCWRLRotamerFile::readSCWRLBackboneDependentLibraryFile(RotamerLibrary& rotamer_library)
 		{
 			rotamer_library.setBackboneDependent(true);
 
@@ -60,11 +61,10 @@ namespace BALL
 			double probability(0);
 		
 			std::vector<String> split;
-			while(readLine()) 
+			while (readLine()) 
 			{
 				line_.split(split);
-
-				if (!split.size() == 13)
+				if (split.size() != 17)
 				{
 					rotamer_library.clear();		
 					throw(Exception::ParseError(__FILE__, __LINE__, "Invalid Format in backbone dependent SCWRL rotamer file!", ""));
@@ -105,7 +105,7 @@ namespace BALL
 			return;
 		}
 
-		void SCWRLRotamerFile::readSCWRLBackboneIndependentLibraryFile_(RotamerLibrary& rotamer_library)
+		void SCWRLRotamerFile::readSCWRLBackboneIndependentLibraryFile(RotamerLibrary& rotamer_library)
 		{
 			rotamer_library.setBackboneDependent(false);
 
diff --git a/source/FORMAT/commandlineParser.C b/source/FORMAT/commandlineParser.C
index 6f67988..3f6559f 100644
--- a/source/FORMAT/commandlineParser.C
+++ b/source/FORMAT/commandlineParser.C
@@ -14,7 +14,9 @@ using namespace std;
 const String BALL::CommandlineParser::NOT_FOUND = "parameter_not_found";
 const list<String> BALL::CommandlineParser::EMTPY_LIST(0);
 
-CommandlineParser::CommandlineParser(String tool_name, String tool_description, String tool_version, String build_date, String category)
+CommandlineParser::CommandlineParser
+  (String tool_name, String tool_description, 
+   String tool_version, String build_date, String category)
 {
 	max_parname_length_ = 0;
 	max_flagname_length_ = 0;
@@ -41,40 +43,44 @@ CommandlineParser::CommandlineParser(String tool_name, String tool_description,
 	strftime (buffer, 150, "%Y-%m-%d, %X (%Z)", ptm);
 	start_time_ = String(buffer);
 
-	// For the moment, register Galaxy's char-excapes here.
-	// If necessary, we could create a function to allow switching to other char-excape schemes ...
-	excaped_chars_.push_back(make_pair("__gt__",">"));
-	excaped_chars_.push_back(make_pair("__lt__","<"));
-	excaped_chars_.push_back(make_pair("__sq__","'"));
-	excaped_chars_.push_back(make_pair("__dq__","\""));
-	excaped_chars_.push_back(make_pair("__ob__","["));
-	excaped_chars_.push_back(make_pair("__cb__","]"));
-	excaped_chars_.push_back(make_pair("__oc__","{"));
-	excaped_chars_.push_back(make_pair("__cc__","}"));
-	excaped_chars_.push_back(make_pair("__at__","@"));
-	excaped_chars_.push_back(make_pair("__cn__","\n"));
-	excaped_chars_.push_back(make_pair("__cr__","\r"));
-	excaped_chars_.push_back(make_pair("__tc__","\t"));
+	// For the moment, register Galaxy's char-escapes here.
+	// If necessary, we could create a function to allow switching to other char-escape schemes ...
+	escaped_chars_.push_back(make_pair("__gt__", ">"));
+	escaped_chars_.push_back(make_pair("__lt__", "<"));
+	escaped_chars_.push_back(make_pair("__sq__", "i'"));
+	escaped_chars_.push_back(make_pair("__dq__", "\""));
+	escaped_chars_.push_back(make_pair("__ob__", "["));
+	escaped_chars_.push_back(make_pair("__cb__", "]"));
+	escaped_chars_.push_back(make_pair("__oc__", "{"));
+	escaped_chars_.push_back(make_pair("__cc__", "}"));
+	escaped_chars_.push_back(make_pair("__at__", "@"));
+	escaped_chars_.push_back(make_pair("__cn__", "\n"));
+	escaped_chars_.push_back(make_pair("__cr__", "\r"));
+	escaped_chars_.push_back(make_pair("__tc__", "\t"));
 
 	// init the blacklist
-	// "write_par", "par", "help", "ini"
+	// "write_par", "par", "help", "ini", "env"
 	// write_ini is allowed to be used, but some tools might ignore it
 	reserved_params_.insert("write_par");
 	reserved_params_.insert("par");
+	reserved_params_.insert("h");
 	reserved_params_.insert("help");
 	reserved_params_.insert("ini");
+	reserved_params_.insert("env");
 }
 
-void CommandlineParser::checkAndRegisterParameter(String name, String description, ParameterType type, bool mandatory, String default_value, bool perform_check, bool hidden)
+void CommandlineParser::checkAndRegisterParameter
+  (String name, String description, ParameterType type, bool mandatory,
+   String default_value, bool perform_check, bool hidden)
 {
 	checkParameterName(name, perform_check);
 
 	ParameterDescription pardes;
-	pardes.name = name;
+	pardes.name        = name;
 	pardes.description = description;
-	pardes.mandatory = mandatory;
-	pardes.type = type;
-	pardes.hidden = hidden;
+	pardes.mandatory   = mandatory;
+	pardes.type        = type;
+	pardes.hidden      = hidden;
 
 	registered_parameters_.insert(make_pair(name, pardes));
 	original_parameter_order_.push_back(registered_parameters_.find(name));
@@ -101,31 +107,47 @@ void CommandlineParser::checkAndRegisterParameter(String name, String descriptio
 	{
 		size += 9;
 	}
-	if (size > max_parname_length_) max_parname_length_ = size;
+	if (size > max_parname_length_) 
+  {
+		max_parname_length_ = size;
+	}
 }
 
-void CommandlineParser::registerParameter(String name, String description, ParameterType type, bool mandatory, String default_value, bool hidden)
+void CommandlineParser::registerParameter
+  (String name, String description,
+   ParameterType type, bool mandatory,
+	 String default_value, bool hidden)
 {
 	// add parameter and check if the parameter name is valid
 	checkAndRegisterParameter(name, description, type, mandatory, default_value, true, hidden);
 }
 
-void CommandlineParser::checkAndRegisterFlag(String name, String description, bool default_gui_value, bool perform_check)
+void CommandlineParser::checkAndRegisterFlag(String name, String description,
+                                             bool default_gui_value,
+																						 bool perform_check, bool hidden)
 {
 	checkParameterName(name, perform_check);
 
 	ParameterDescription pardes;
 	pardes.name = name;
 	pardes.description = description;
-	pardes.mandatory = false;
+	pardes.mandatory   = false;
+	pardes.hidden      = hidden;
+
 	list<String> values;
 	values.push_back("0");
 	values.push_back("1");
+
 	pardes.type = BALL::INT;
+
 	registered_flags_.insert(make_pair(name, pardes));
 	registered_flags_.find(name)->second.allowed_values = values;
 	original_flag_order_.push_back(registered_flags_.find(name));
-	if (name.size() > max_flagname_length_) max_flagname_length_ = name.size();
+
+	if (name.size() > max_flagname_length_)
+	{
+		max_flagname_length_ = name.size();
+	}
 	if (default_gui_value)
 	{
 		list<String> alist;
@@ -134,26 +156,28 @@ void CommandlineParser::checkAndRegisterFlag(String name, String description, bo
 	}
 }
 
-void CommandlineParser::registerFlag(String name, String description, bool default_gui_value)
+void CommandlineParser::registerFlag(String name, String description, bool default_gui_value, bool hidden)
 {
-	checkAndRegisterFlag(name, description, default_gui_value, true);
+	checkAndRegisterFlag(name, description, default_gui_value, true, hidden);
 }
 
-
+/// TODO: figure out the meaning of the hard-coded prefixes and remove them!
 void CommandlineParser::registerAdvancedParameters(Options& options)
 {
-	if (options.getName().hasPrefix("ReferenceArea") ||
-		options.getName().hasPrefix("PharmacophoreConstraint") )
+	if (   options.getName().hasPrefix("ReferenceArea")
+			|| options.getName().hasPrefix("PharmacophoreConstraint") )
 	{
 		return;
 	}
+
 	String category = options.getName();
-	if (category != "" && category != "Docking-Settings")
+	if ((category != "") && category != "Docking-Settings")
 	{
 		for (Options::ConstIterator it = options.begin(); it != options.end(); it++)
 		{
 			const String& name = it->first;
 			checkParameterName(name, true);
+
 			const ParameterDescription* pardes = options.getParameterDescription(name);
 			if (!pardes)
 			{
@@ -167,12 +191,17 @@ void CommandlineParser::registerAdvancedParameters(Options& options)
 		}
 	}
 
-	for(StringHashMap<Options*>::Iterator it = options.beginSubcategories(); it != options.endSubcategories(); it++)
+	for (StringHashMap<Options*>::Iterator it = options.beginSubcategories();
+			 it != options.endSubcategories(); it++)
 	{
 		registerAdvancedParameters(*it->second);
 	}
 }
 
+void CommandlineParser::setParameterAsAdvanced(String name)
+{
+	registered_parameters_[name].advanced = true;
+}
 
 void CommandlineParser::setParameterRestrictions(String par_name, double min_value, double max_value)
 {
@@ -227,47 +256,55 @@ void CommandlineParser::setOutputFormatSource(String output_parname, String inpu
 
 void CommandlineParser::printToolInfo()
 {
-	cout<<endl;
-	Size length = tool_name_.size()+tool_description_.size()+6;
-	cout<<" "; for (Size i = 0; i < length; i++) cout<<"="; cout<<endl; 
-	cout<<"| "<<tool_name_<<" -- "<<tool_description_<<" |"<<endl;
-	cout<<"|"; for (Size i = 0; i < length; i++) cout<<"="; cout<<"|"<<endl; 
-	cout<<"|"; for (Size i = 0; i < length; i++) cout<<" "; 
-	cout<<"|"<<endl;
-
-	int n = length-tool_version_.size()-11;
-	cout<<"| Version: "<<tool_version_;
-	for (int i = 0; i < n; i++) cout<<" "; 
-	cout<<" |"<<endl;
-
-	cout<<"| build date: "<<build_date_;
-	n = length-build_date_.size()-14;
-	for (int i = 0; i < n; i++) cout<<" "; 
-	cout<<" |"<<endl;
-
-	n = length-hostname_.size()-18;
-	cout<<"| execution host: "<<hostname_;
-	for (int i = 0; i < n; i++) cout<<" "; 
-	cout<<" |"<<endl;
-
-	n = length-start_time_.size()-18;
-	cout<<"| execution time: "<<start_time_;
-	for (int i = 0; i < n; i++) cout<<" "; 
-	cout<<" |"<<endl;
-
-	cout<<" "; for (Size i = 0; i < length; i++) cout<<"-"; 
-	cout<<endl<<endl;
+	String tool = "| " + tool_name_ + " -- " + tool_description_;
+	String version = "| Version: " + tool_version_;
+	String build = "| build date: " + build_date_;
+	String host = "| execution host: " + hostname_;
+	String time = "| execution time: " + start_time_;
+
+	Size max_len = tool.size();
+
+	if (max_len < version.size())
+	{
+		max_len = version.size();
+	}
+	if (max_len < build.size())
+	{
+		max_len = build.size();
+	}
+	if (max_len < host.size())
+	{
+		max_len = host.size();
+	}
+	if (max_len < time.size())
+	{
+		max_len = time.size();
+	}
+
+	Log << endl;
+	Log << " " << String('=', max_len) << endl; 
+	Log << tool << String(' ', max_len - tool.size()) << " |" << endl;
+	Log << "|" << String('=', max_len) << "|" << endl; 
+	Log << "|" << String(' ', max_len) << "|" << endl;
+	Log << version << String(' ', max_len - version.size()) << " |" << endl;
+	Log << build   << String(' ', max_len - build.size()) <<" |" << endl;
+	Log << host    << String(' ', max_len - host.size()) << " |" << endl;
+	Log << time    << String(' ', max_len - time.size()) << " |" << endl;
+	Log << " "     << String('-', max_len) << endl << endl; 
 }
 
 
 void CommandlineParser::parse(int argc, char* argv[])
 {
+	checkAndRegisterFlag("h", "show help about parameters and flags of this program", false, false);
 	checkAndRegisterFlag("help", "show help about parameters and flags of this program", false, false);
 	checkAndRegisterParameter("write_par", "write xml parameter file for this tool", OUTFILE, false, "", false);
 	checkAndRegisterParameter("par", "read parameters from parameter-xml-file", INFILE, false, "", false);
 	setSupportedFormats("par", "xml");
 	setSupportedFormats("write_par", "xml");
 
+	checkAndRegisterParameter("env", "set runtime environment (default cmdline) ", STRING, false, "cmdline", false);
+
 	validateRegisteredFilesHaveFormats();
 
 	printToolInfo();
@@ -316,7 +353,7 @@ void CommandlineParser::parse(int argc, char* argv[])
 					if (registered_parameters_.find(current_par_name) != registered_parameters_.end())
 					{
 						Log.error()<<"No value specified for '"<<current_par_name<<"', but it is a parameter not a flag!!\n"
-							         <<"Use '-help' to display information about available parameters and flags."<<endl;
+									 <<"Use '-help' to display information about available parameters and flags."<<endl;
 					}
 					else
 					{
@@ -330,7 +367,7 @@ void CommandlineParser::parse(int argc, char* argv[])
 		{
 			if (name_read) // command line parameter
 			{
-				replaceExcapedCharacters_(token);
+				replaceEscapedCharacters_(token);
 
 				map<String, list<String> >::iterator it = parameter_map_.find(current_par_name);
 				if (it != parameter_map_.end())
@@ -389,13 +426,13 @@ void CommandlineParser::parse(int argc, char* argv[])
 
 
 	// Do not complain about missing parameters if the user just wants to see the help page.
-	if (parameter_map_.find("help") != parameter_map_.end())
+	if (parameter_map_.find("help") != parameter_map_.end() || parameter_map_.find("h") != parameter_map_.end())
 	{
 		printHelp();
 		exit(0);
 	}
 
-	// Do not complain about missing parameters if the user just wants to write ini-file w/ default values.
+	// Do not complain about missing parameters if the user just wants to write ini-file/default values.
 	if (parameter_map_.find("write_ini") != parameter_map_.end())
 	{
 		return;
@@ -472,14 +509,17 @@ void CommandlineParser::parse(int argc, char* argv[])
 
 		pf.writeSection(tool_name_, tool_description_, tool_version_, tool_manual_, tool_category_, descriptions, parameter_map_);
 		pf.close();
-		Log << "Tool-parameter file has been written to '"<<write_par<<"'. Goodbye!"<<endl;
+		Log << "Tool-parameter file has been written to '" << write_par << "'. Goodbye!" << endl;
 		exit(0);
 	}
 
 	set<String> missing_parameters;
 	for (map < String, ParameterDescription > :: iterator it = registered_parameters_.begin(); it != registered_parameters_.end(); it++)
 	{
-		if (it->second.mandatory == false) continue;
+		if (it->second.mandatory == false) 
+  	{
+			continue;
+		}
 		if (parameter_map_.find(it->second.name) == parameter_map_.end())
 		{
 			missing_parameters.insert(it->first);
@@ -488,15 +528,15 @@ void CommandlineParser::parse(int argc, char* argv[])
 	if (missing_parameters.size() > 0)
 	{
 		Log.error() << "[Error:] The following mandatory parameters are missing:" << endl;
-		printHelp(&missing_parameters, false);
+		printHelp(missing_parameters, false);
 		exit(1);
 	}
 }
 
 
-void CommandlineParser::replaceExcapedCharacters_(String& parameter_value)
+void CommandlineParser::replaceEscapedCharacters_(String& parameter_value)
 {
-	for (list<pair<String, String> >::iterator it = excaped_chars_.begin(); it != excaped_chars_.end(); it++)
+	for (list<pair<String, String> >::iterator it = escaped_chars_.begin(); it != escaped_chars_.end(); it++)
 	{
 		parameter_value.substituteAll(it->first, it->second);
 	}
@@ -510,7 +550,7 @@ void CommandlineParser::copyAdvancedParametersToOptions(Options& options)
 		ParameterDescription& p = (*it)->second;
 
 		if (!p.advanced) continue;
-		
+
 		map<String, list<String> >::iterator search_it = parameter_map_.find(p.name);
 		if (search_it != parameter_map_.end())
 		{
@@ -525,76 +565,77 @@ void CommandlineParser::copyAdvancedParametersToOptions(Options& options)
 }
 
 
-void CommandlineParser::printHelp(set<String>* parameter_names, bool show_manual)
+void CommandlineParser::printHelp(const set<String>& parameter_names, bool show_manual)
 {
-	if (!parameter_names && registered_parameters_.size() > 0)
+	if (parameter_names.size() == 0 && registered_parameters_.size() > 0)
 	{
-		cout<<"Available parameters are ('*' indicates mandatory parameters): "<<endl;
+		Log << "Available parameters are ('*' indicates mandatory parameters): " << endl;
 	}
 
 	for (list<MapIterator>::iterator it = original_parameter_order_.begin(); it != original_parameter_order_.end(); it++)
 	{
 		ParameterDescription& p = (*it)->second;
-		if ((parameter_names && parameter_names->find(p.name) == parameter_names->end()) || p.advanced)
+		if (((parameter_names.size() > 0) && parameter_names.find(p.name) == parameter_names.end()) || p.advanced)
 		{
 			continue;
 		}
-		cout<<"   ";
-		if (!parameter_names && p.mandatory) cout<<"*  "; 
-		else cout<<"   ";
-		cout<<"-"<<p.name;
+		Log << "   ";
+		if ((parameter_names.size() == 0) && p.mandatory) 
+		{
+			Log<<"*  ";
+		}
+		else 
+		{
+		  Log << "   ";
+		}
+		Log << "-" << p.name;
 		String n = "";
 		if (p.type == INFILE)
 		{
-			n=" <in.file>";
+			n = " <in.file>";
 		}
 		else if (p.type == OUTFILE)
 		{
-			n=" <out.file>";
+			n = " <out.file>";
 		}
 		else if (p.type == BALL::INT)
 		{
-			n=" <int>";
+			n = " <int>";
 		}
 		else if (p.type == DOUBLE)
 		{
-			n=" <double>";
+			n = " <double>";
 		}
 		else if (p.type == STRING)
 		{
-			n=" <string>";
+			n = " <string>";
 		}
-		cout<<n;
+		Log<<n;
 		Size space_size = max_parname_length_+4-p.name.size()-n.size();
 		for (Size j = 0; j < space_size; j++)
 		{
-			cout<<" ";
+			Log << " ";
 		}
-		cout<<p.description<<endl;
+		Log << p.description << endl;
 	}
-	if (!parameter_names && registered_flags_.size() > 0)
+	if (parameter_names.size() == 0 && registered_flags_.size() > 0)
 	{
-		cout<<endl<<"Available flags are: "<<endl;
+		Log << endl << "Available flags are: " << endl;
 	}
 	for (list<MapIterator>::iterator it = original_flag_order_.begin(); it != original_flag_order_.end(); it++)
 	{
 		ParameterDescription& p = (*it)->second;
-		if (parameter_names && parameter_names->find(p.name) == parameter_names->end())
+		if (parameter_names.size() > 0 && parameter_names.find(p.name) == parameter_names.end())
 		{
 			continue;
 		}
-		cout<<"      "<<"-"<<p.name;
-		Size space_size = max_flagname_length_+4-p.name.size();
-		for (Size j = 0; j < space_size; j++)
-		{
-			cout<<" ";
-		}
-		cout<<p.description<<endl;
+		Log << "      " << "-" << p.name << String(' ', max_flagname_length_ + 4 - p.name.size())
+        << p.description << endl;
 	}
-	cout<<endl;
+	Log << endl;
 	if (show_manual && tool_manual_ != "")
 	{
-		cout<<endl<<tool_manual_<<endl<<endl<<endl;
+		Log << endl << tool_manual_ << endl << endl << endl;
 	}
 }
 
@@ -658,7 +699,7 @@ void CommandlineParser::checkParameterName(const String& name, bool perform_chec
 {
 	if (perform_check && reserved_params_.count(name) != 0)
 		{
-			throw BALL::Exception::GeneralException(__FILE__,__LINE__,"registerParameter error","The parameter [" + name + "] is part of the reserved parameters. Reserved parameters are: [write_par, par, help, ini]");
+			throw BALL::Exception::GeneralException(__FILE__,__LINE__,"registerParameter error","The parameter [" + name + "] is part of the reserved parameters. Reserved parameters are: [write_par, par, help, ini, env]");
 		}
 }
 
diff --git a/source/FORMAT/dockResultFile.C b/source/FORMAT/dockResultFile.C
index 6e34b21..9c0b8c5 100755
--- a/source/FORMAT/dockResultFile.C
+++ b/source/FORMAT/dockResultFile.C
@@ -673,6 +673,10 @@ namespace BALL
 
 			written_ligand_IDs_.clear();
 			file_->close();
+			
+			// Necessary to perform output compression if enabled
+			GenericMolFile::close();
+			
 			closed_ = true;
 		}
 
diff --git a/source/FORMAT/lineBasedFile.C b/source/FORMAT/lineBasedFile.C
index 34a4a1d..61ccf77 100644
--- a/source/FORMAT/lineBasedFile.C
+++ b/source/FORMAT/lineBasedFile.C
@@ -117,14 +117,7 @@ namespace BALL
 			throw Exception::ParseError(__FILE__, __LINE__, String("File '") + getName() + "' not open for reading" , 
 																	"LineBasedFile::readLine");
 		}
-
-		if (line_buffer_.empty())
-			line_buffer_.resize(BALL_MAX_LINE_LENGTH);
-
-		char* buffer = &(line_buffer_[0]);
-
-		getFileStream().getline(buffer, BALL_MAX_LINE_LENGTH);
-		line_.assign(buffer);
+		line_.getline(getFileStream());
 		if (trim_whitespaces_) line_.trim();
 		++line_number_;
 		return !eof();
diff --git a/source/FORMAT/molFileFactory.C b/source/FORMAT/molFileFactory.C
index 210a6db..467c046 100644
--- a/source/FORMAT/molFileFactory.C
+++ b/source/FORMAT/molFileFactory.C
@@ -20,324 +20,355 @@
 namespace BALL
 {
 
-	GenericMolFile* MolFileFactory::open(const String& name, File::OpenMode open_mode)
-	{
-		bool compression = false;
-		String filename = name;
 
-		if (name.hasSuffix(".gz"))
-		{
-			compression = true;
-		}
-		else if (open_mode == std::ios::in && !isFileExtensionSupported(filename)) // check whether file is zipped
-		{
-			std::ifstream zipped_file(filename.c_str(), std::ios_base::in | std::ios_base::binary);
-			boost::iostreams::filtering_istream in;
-			in.push(boost::iostreams::gzip_decompressor());
-			in.push(zipped_file);
-			bool ok = false;
-			try
-			{
-				string s;
-				ok = std::getline(in,s);
-			}
-			catch (const boost::iostreams::gzip_error& e)
-			{
-				compression = false;
-			}
-			if (ok) compression = true;
-		}
+  String MolFileFactory::getSupportedFormats()
+  {
+    String formats = "mol2,sdf,drf,pdb,ac,ent,brk,hin,mol,xyz,mol2.gz,sdf.gz,drf.gz,pdb.gz,ac.gz,ent.gz,brk.gz,hin.gz,mol.gz,xyz.gz";
+    return formats;
+  }
 
-		if (compression)
-		{
-			compression = true;
-			String unzipped_filename;
-			if (name.hasSuffix(".gz"))
-			{
-				String tmp = name.before(".gz");
-				String ext = tmp.substr(tmp.find_last_of("."));
-				File::createTemporaryFilename(unzipped_filename, ext);
-			}
-			else // unknown extension
-			{
-				File::createTemporaryFilename(unzipped_filename);
-			}
+  bool MolFileFactory::isFileExtensionSupported(String filename)
+  {
+    vector<String> exts;
+    String s = getSupportedFormats();
+    s.split(exts,",");
+    for (Size i=0; i<exts.size(); i++)
+    {
+      if (filename.hasSuffix(exts[i]))
+      {
+        return true;
+      }
+    }
+    return false;
+  }
 
-			if (open_mode == std::ios::in)
-			{
-				std::ifstream zipped_file(name.c_str(), std::ios_base::in | std::ios_base::binary);
-				boost::iostreams::filtering_istream in;
-				in.push(boost::iostreams::gzip_decompressor());
-				in.push(zipped_file);
-				std::ofstream unzipped_file(unzipped_filename.c_str());
-				boost::iostreams::copy(in, unzipped_file);
-			}
+  GenericMolFile* MolFileFactory::open(const String& name, File::OpenMode open_mode)
+  {
+    bool compression = false;
+    String filename = name;
 
-			filename = unzipped_filename;
-		}
-		
-		GenericMolFile* gmf = 0;
-		if (filename.hasSuffix(".ac") || filename.hasSuffix(".AC"))
-		{
-			gmf = new AntechamberFile(filename, open_mode);
-		}
-		else if(filename.hasSuffix(".pdb") || filename.hasSuffix(".ent") || filename.hasSuffix(".brk") ||
-			filename.hasSuffix(".PDB") || filename.hasSuffix(".ENT") || filename.hasSuffix(".BRK"))
-		{
-			gmf = new PDBFile(filename, open_mode);
-		}
-		else if(filename.hasSuffix(".hin") || filename.hasSuffix(".HIN"))
-		{
-			gmf = new HINFile(filename, open_mode);
-		}
-		else if(filename.hasSuffix(".mol") || filename.hasSuffix(".MOL"))
-		{
-			gmf = new MOLFile(filename, open_mode);
-		}
-		else if(filename.hasSuffix(".sdf") || filename.hasSuffix(".SDF"))
-		{
-			gmf = new SDFile(filename, open_mode);
-		}
-		else if(filename.hasSuffix(".mol2") || filename.hasSuffix(".MOL2"))
-		{
-			gmf = new MOL2File(filename, open_mode);
-		}
-		else if(filename.hasSuffix(".xyz") || filename.hasSuffix(".XYZ"))
-		{
-			gmf = new XYZFile(filename, open_mode);
-		}
-		else if(filename.hasSuffix(".drf") || filename.hasSuffix(".DRF"))
-		{
-			gmf = new DockResultFile(filename, open_mode);
-		}
-		else
-		{
-			if (open_mode == std::ios::in)
-			{
-				gmf = detectFormat(filename);
-				// Make sure that temporary input-file is deleted when GenericMolFile is closed.
-				if (gmf && compression)
-				{
-					gmf->defineInputAsTemporary();
-				}
-				return gmf;
-			}
-			return NULL;
-		}
+    if (name.hasSuffix(".gz"))
+    {
+      compression = true;
+    }
+    else if (open_mode == std::ios::in && !isFileExtensionSupported(filename)) // check whether file is zipped
+    {
+      std::ifstream zipped_file(filename.c_str(), std::ios_base::in | std::ios_base::binary);
+      boost::iostreams::filtering_istream in;
+      in.push(boost::iostreams::gzip_decompressor());
+      in.push(zipped_file);
+      bool ok = false;
+      try
+      {
+        string s;
+        ok = bool(std::getline(in,s));
+      }
+      catch (const boost::iostreams::gzip_error& e)
+      {
+        compression = false;
+      }
+      if (ok) compression = true;
+    }
 
-		if (compression)
-		{
-			if (open_mode == std::ios::in)
-			{
-				// Make sure that temporary input-file is deleted when GenericMolFile is closed.
-				gmf->defineInputAsTemporary();
-			}
-			else
-			{
-				// Make sure that temporary output-file is compressed and then deleted when GenericMolFile is closed.
-				gmf->enableOutputCompression(name);
-			}
-		}
-		
-		return gmf;
-	}
+    if (compression)
+    {
+      compression = true;
+      String unzipped_filename;
+      if (name.hasSuffix(".gz"))
+      {
+        String tmp = name.before(".gz");
+        String ext = tmp.substr(tmp.find_last_of("."));
+        File::createTemporaryFilename(unzipped_filename, ext);
+      }
+      else // unknown extension
+      {
+        File::createTemporaryFilename(unzipped_filename);
+      }
 
-	bool MolFileFactory::isFileExtensionSupported(String filename)
-	{
-		vector<String> exts;
-		String s = getSupportedFormats();
-		s.split(exts,",");
-		for (Size i=0; i<exts.size(); i++)
-		{
-			if (filename.hasSuffix(exts[i]))
-			{
-				return true;
-			}
-		}
-		return false;
-	}
+      if (open_mode == std::ios::in)
+      {
+        std::ifstream zipped_file(name.c_str(), std::ios_base::in | std::ios_base::binary);
+        boost::iostreams::filtering_istream in;
+        in.push(boost::iostreams::gzip_decompressor());
+        in.push(zipped_file);
+        std::ofstream unzipped_file(unzipped_filename.c_str());
+        boost::iostreams::copy(in, unzipped_file);
+      }
 
-	GenericMolFile* MolFileFactory::open(const String& name, File::OpenMode open_mode, String default_format)
-	{
-		GenericMolFile* file = open(name, open_mode);
-		if (file)
-		{
-			return file;
-		}
+      filename = unzipped_filename;
+    }
+    
+    GenericMolFile* gmf = 0;
+    if (filename.hasSuffix(".ac") || filename.hasSuffix(".AC"))
+    {
+      gmf = new AntechamberFile(filename, open_mode);
+    }
+    else if(filename.hasSuffix(".pdb") || filename.hasSuffix(".ent") || filename.hasSuffix(".brk") ||
+      filename.hasSuffix(".PDB") || filename.hasSuffix(".ENT") || filename.hasSuffix(".BRK"))
+    {
+      gmf = new PDBFile(filename, open_mode);
+    }
+    else if(filename.hasSuffix(".hin") || filename.hasSuffix(".HIN"))
+    {
+      gmf = new HINFile(filename, open_mode);
+    }
+    else if(filename.hasSuffix(".mol") || filename.hasSuffix(".MOL"))
+    {
+      gmf = new MOLFile(filename, open_mode);
+    }
+    else if(filename.hasSuffix(".sdf") || filename.hasSuffix(".SDF"))
+    {
+      gmf = new SDFile(filename, open_mode);
+    }
+    else if(filename.hasSuffix(".mol2") || filename.hasSuffix(".MOL2"))
+    {
+      gmf = new MOL2File(filename, open_mode);
+    }
+    else if(filename.hasSuffix(".xyz") || filename.hasSuffix(".XYZ"))
+    {
+      gmf = new XYZFile(filename, open_mode);
+    }
+    else if(filename.hasSuffix(".drf") || filename.hasSuffix(".DRF"))
+    {
+      gmf = new DockResultFile(filename, open_mode);
+    }
+    else
+    {
+      if (open_mode == std::ios::in)
+      {
+        gmf = detectFormat(filename);
+        // Make sure that temporary input-file is deleted when GenericMolFile is closed.
+        if (gmf && compression)
+        {
+          gmf->defineInputAsTemporary();
+        }
+        return gmf;
+      }
+      return NULL;
+    }
 
-		if (open_mode == std::ios::out)
-		{
-			bool compression = false;
-			String filename = name;
-			String zipped_filename = "";
-			if (default_format.hasSuffix(".gz"))
-			{
-				compression = true;
-				zipped_filename = filename;
-				default_format = default_format.before(".gz");
-				String unzipped_filename;
-				File::createTemporaryFilename(unzipped_filename, default_format);
-				filename = unzipped_filename;
-			}
+    if (compression)
+    {
+      if (open_mode == std::ios::in)
+      {
+        // Make sure that temporary input-file is deleted when GenericMolFile is closed.
+        gmf->defineInputAsTemporary();
+      }
+      else
+      {
+        // Make sure that temporary output-file is compressed and then deleted when GenericMolFile is closed.
+        gmf->enableOutputCompression(name);
+      }
+    }
+    
+    return gmf;
+  }
 
-			if (default_format == "ac")
-			{
-				file = new AntechamberFile(filename, open_mode);
-			}
-			else if(default_format == "pdb" || default_format == "ent" || default_format == "brk")
-			{
-				file = new PDBFile(filename, open_mode);
-			}
-			else if(default_format == "hin")
-			{
-				file = new HINFile(filename, open_mode);
-			}
-			else if(default_format == "mol")
-			{
-				file = new MOLFile(filename, open_mode);
-			}
-			else if(default_format == "sdf")
-			{
-				file = new SDFile(filename, open_mode);
-			}
-			else if(default_format == "mol2")
-			{
-				file = new MOL2File(filename, open_mode);
-			}
-			else if(default_format == "xyz")
-			{
-				file = new XYZFile(filename, open_mode);
-			}
-			else if(default_format == "drf")
-			{
-				file = new DockResultFile(filename, open_mode);
-			}
-			// Make sure that temporary output-file is compressed and then deleted when GenericMolFile is closed.
-			if (compression)
-			{
-				file->enableOutputCompression(zipped_filename);
-			}
-		}
-		return file;
-	}
+  GenericMolFile* MolFileFactory::open(const String& name, File::OpenMode open_mode, String default_format, bool forced)
+  {
+    //If we do not force the default format, we start as in others
+    //else skip to avoid unnecessary computation
+    if(!forced)
+    {
+      //try to read/write using filename with suffix (try recognise if necessary)
+      GenericMolFile* file = open(name, open_mode);
+      if (file)
+      {
+        return file;
+      }
+    }
+    
+    //if forced or if filetype could not be recognised by ending use default format
+    GenericMolFile* file = 0;
 
-	GenericMolFile* MolFileFactory::open(const String& name, File::OpenMode open_mode, GenericMolFile* default_format_file)
-	{
-		GenericMolFile* file = open(name, open_mode);
-		if (file)
-		{
-			return file;
-		}
+    bool compression = false;
+    String filename = name;
+    String zipped_filename = "";
 
-		if (open_mode == std::ios::out)
-		{
-			bool compression = false;
-			String filename = name;
-			String zipped_filename = "";
-			if (default_format_file->isCompressedFile())
-			{
-				compression = true;
-				zipped_filename = filename;
-				String unzipped_filename;
-				File::createTemporaryFilename(unzipped_filename);
-				filename = unzipped_filename;
-			}
+    
+    if (default_format.hasSuffix(".gz"))
+    {
+      compression = true;
+      zipped_filename = filename;
+      default_format = default_format.before(".gz");
+      String unzipped_filename;
+      File::createTemporaryFilename(unzipped_filename, default_format);
+      if (open_mode == std::ios::in)
+        {
+          std::ifstream zipped_file(zipped_filename.c_str(), std::ios_base::in | std::ios_base::binary);
+          boost::iostreams::filtering_istream in;
+          in.push(boost::iostreams::gzip_decompressor());
+          in.push(zipped_file);
+          std::ofstream unzipped_file(unzipped_filename.c_str());
+          boost::iostreams::copy(in, unzipped_file);
+        }
+      filename = unzipped_filename;
+    }
 
-			if (dynamic_cast<AntechamberFile*>(default_format_file))
-			{
-				file = new AntechamberFile(filename, open_mode);
-			}
-			else if(dynamic_cast<PDBFile*>(default_format_file))
-			{
-				file = new PDBFile(filename, open_mode);
-			}
-			else if(dynamic_cast<HINFile*>(default_format_file))
-			{
-				file = new HINFile(filename, open_mode);
-			}
-			else if(dynamic_cast<SDFile*>(default_format_file))
-			{
-				file = new SDFile(filename, open_mode);
-			}
-			else if(dynamic_cast<MOL2File*>(default_format_file))
-			{
-				file = new MOL2File(filename, open_mode);
-			}
-			else if(dynamic_cast<MOLFile*>(default_format_file))
-			{
-				file = new MOLFile(filename, open_mode);
-			}
-			else if(dynamic_cast<XYZFile*>(default_format_file))
-			{
-				file = new XYZFile(filename, open_mode);
-			}
-			else if(dynamic_cast<DockResultFile*>(default_format_file))
-			{
-				file = new DockResultFile(filename, open_mode);
-			}
-			// Make sure that temporary output-file is compressed and then deleted when GenericMolFile is closed.
-			if (compression)
-			{
-				file->enableOutputCompression(zipped_filename);
-			}
-		}
-		return file;
-	}
 
-	String MolFileFactory::getSupportedFormats()
-	{
-		String formats = "mol2,sdf,drf,pdb,ac,ent,brk,hin,mol,xyz,mol2.gz,sdf.gz,drf.gz,pdb.gz,ac.gz,ent.gz,brk.gz,hin.gz,mol.gz,xyz.gz";
-		return formats;
-	}
+    if (default_format == "ac")
+    {
+      file = new AntechamberFile(filename, open_mode);
+    }
+    else if(default_format == "pdb" || default_format == "ent" || default_format == "brk")
+    {
+      file = new PDBFile(filename, open_mode);
+    }
+    else if(default_format == "hin")
+    {
+      file = new HINFile(filename, open_mode);
+    }
+    else if(default_format == "mol")
+    {
+      file = new MOLFile(filename, open_mode);
+    }
+    else if(default_format == "sdf")
+    {
+      file = new SDFile(filename, open_mode);
+    }
+    else if(default_format == "mol2")
+    {
+      file = new MOL2File(filename, open_mode);
+    }
+    else if(default_format == "xyz")
+    {
+      file = new XYZFile(filename, open_mode);
+    }
+    else if(default_format == "drf")
+    {
+      file = new DockResultFile(filename, open_mode);
+    }
 
-	GenericMolFile* MolFileFactory::detectFormat(const String& name)
-	{
-		LineBasedFile input(name, std::ios::in);
-		bool empty_file = true;
 
-		// Read at most 400 lines.
-		// If no format-indicator is found, return NULL
-		for (Size no=1; no < 400 && input.readLine(); no++)
-		{
-			String& line = input.getLine();
-			if (!line.trim().empty())
-			{
-				empty_file = false;
-			}
-			if (line.hasPrefix("@<TRIPOS>MOLECULE"))
-			{
-				input.close();
-				return new MOL2File(name, std::ios::in);
-			}
-			else if (line.hasPrefix("$$$$") || line.hasPrefix("M  END"))
-			{
-				input.close();
-				return new SDFile(name, std::ios::in);
-			}
-			else if (line.hasPrefix("<dockingfile>"))
-			{
-				input.close();
-				return new DockResultFile(name, std::ios::in);
-			}
-			else if (line.hasPrefix("HEADER") || line.hasPrefix("ATOM") || line.hasPrefix("USER"))
-			{
-				input.close();
-				return new PDBFile(name, std::ios::in);
-			}
-		}
+    if (compression)
+    {
+      if (open_mode == std::ios::in)
+      {
+        // Make sure that temporary input-file is deleted when GenericMolFile is closed.
+        file->defineInputAsTemporary();
+      }
+      else
+      {
+        // Make sure that temporary output-file is compressed and then deleted when GenericMolFile is closed.
+        file->enableOutputCompression(zipped_filename);
+      }
+    }
 
-		if (empty_file)
-		{
-			Log.error() << std::endl << "[Error:] Specified input file is empty!" << std::endl << std::endl;
-		}
-		else
-		{
-			Log.error() << std::endl << "[Error:] Specified input file has unknown extension and its format could not be detected automatically!" << std::endl << std::endl;
-		}
-		
-		input.close();
-		
-		return NULL;
-	}
+    return file;
+    }
+  
+
+  GenericMolFile* MolFileFactory::open(const String& name, File::OpenMode open_mode, GenericMolFile* default_format_file)
+  {
+    GenericMolFile* file = open(name, open_mode);
+    if (file)
+    {
+      return file;
+    }
+
+    if (open_mode == std::ios::out)
+    {
+      bool compression = false;
+      String filename = name;
+      String zipped_filename = "";
+      if (default_format_file->isCompressedFile())
+      {
+        compression = true;
+        zipped_filename = filename;
+        String unzipped_filename;
+        File::createTemporaryFilename(unzipped_filename);
+        filename = unzipped_filename;
+      }
+
+      if (dynamic_cast<AntechamberFile*>(default_format_file))
+      {
+        file = new AntechamberFile(filename, open_mode);
+      }
+      else if(dynamic_cast<PDBFile*>(default_format_file))
+      {
+        file = new PDBFile(filename, open_mode);
+      }
+      else if(dynamic_cast<HINFile*>(default_format_file))
+      {
+        file = new HINFile(filename, open_mode);
+      }
+      else if(dynamic_cast<SDFile*>(default_format_file))
+      {
+        file = new SDFile(filename, open_mode);
+      }
+      else if(dynamic_cast<MOL2File*>(default_format_file))
+      {
+        file = new MOL2File(filename, open_mode);
+      }
+      else if(dynamic_cast<MOLFile*>(default_format_file))
+      {
+        file = new MOLFile(filename, open_mode);
+      }
+      else if(dynamic_cast<XYZFile*>(default_format_file))
+      {
+        file = new XYZFile(filename, open_mode);
+      }
+      else if(dynamic_cast<DockResultFile*>(default_format_file))
+      {
+        file = new DockResultFile(filename, open_mode);
+      }
+      // Make sure that temporary output-file is compressed and then deleted when GenericMolFile is closed.
+      if (compression)
+      {
+        file->enableOutputCompression(zipped_filename);
+      }
+    }
+    return file;
+  }
+
+  GenericMolFile* MolFileFactory::detectFormat(const String& name)
+  {
+    LineBasedFile input(name, std::ios::in);
+    bool empty_file = true;
+
+    // Read at most 400 lines.
+    // If no format-indicator is found, return NULL
+    for (Size no=1; no < 400 && input.readLine(); no++)
+    {
+      String& line = input.getLine();
+      if (!line.trim().empty())
+      {
+        empty_file = false;
+      }
+      if (line.hasPrefix("@<TRIPOS>MOLECULE"))
+      {
+        input.close();
+        return new MOL2File(name, std::ios::in);
+      }
+      else if (line.hasPrefix("$$$$") || line.hasPrefix("M  END"))
+      {
+        input.close();
+        return new SDFile(name, std::ios::in);
+      }
+      else if (line.hasPrefix("<dockingfile>"))
+      {
+        input.close();
+        return new DockResultFile(name, std::ios::in);
+      }
+      else if (line.hasPrefix("HEADER") || line.hasPrefix("ATOM") || line.hasPrefix("USER"))
+      {
+        input.close();
+        return new PDBFile(name, std::ios::in);
+      }
+    }
+
+    if (empty_file)
+    {
+      Log.error() << std::endl << "[Error:] Specified input file is empty!" << std::endl << std::endl;
+    }
+    else
+    {
+      Log.error() << std::endl << "[Error:] Specified input file has unknown extension and its format could not be detected automatically!" << std::endl << std::endl;
+    }
+    
+    input.close();
+    
+    return NULL;
+  }
 }
 
diff --git a/source/FORMAT/paramFile.C b/source/FORMAT/paramFile.C
index db0fa65..6bcd2bf 100644
--- a/source/FORMAT/paramFile.C
+++ b/source/FORMAT/paramFile.C
@@ -180,6 +180,17 @@ void ParamFile::writeSection(String section_name, String section_description, St
 			type = "float";
 			is_list = true;
 		}
+		else if (d_it->second.type==GALAXY_OPT_OUTDIR)
+		{
+			type = "string";
+			tag = "galaxy_opt_outdir";
+		}
+		else if (d_it->second.type==GALAXY_OPT_OUTID)
+		{
+			type = "string";
+			tag = "galaxy_opt_outid";
+		}
+
 
 		if (d_it->second.mandatory)
 		{
@@ -394,6 +405,14 @@ void ParamFile::readSection(String& section_name, String& section_description, S
 							{
 								pd.type=OUTFILE;
 							}
+							else if (tags.hasSubstring("galaxy_opt_outdir"))
+							{
+								pd.type=GALAXY_OPT_OUTDIR;
+							}
+							else if (tags.hasSubstring("galaxy_opt_outid"))
+							{
+								pd.type=GALAXY_OPT_OUTID;
+							}
 							else
 							{
 								pd.type=STRING;
diff --git a/source/FORMAT/sources.cmake b/source/FORMAT/sources.cmake
index 471517c..8b062e0 100644
--- a/source/FORMAT/sources.cmake
+++ b/source/FORMAT/sources.cmake
@@ -14,6 +14,7 @@ SET(SOURCES_LIST
 #	GAMESSLogFile.C
 	genericMolFile.C
 	HINFile.C
+	HMOFile.C
 	INIFile.C
 	JCAMPFile.C
 	KCFFile.C
@@ -29,7 +30,6 @@ SET(SOURCES_LIST
 	paramFile.C
 	parameters.C
 	parameterSection.C
-	paramFile.C
 	PDBdefs.C
 	PDBFileGeneral.C
 	PDBFileDetails.C
diff --git a/source/KERNEL/expressionParserLexer.l b/source/KERNEL/expressionParserLexer.l
index 596784a..6e1f75c 100644
--- a/source/KERNEL/expressionParserLexer.l
+++ b/source/KERNEL/expressionParserLexer.l
@@ -76,5 +76,7 @@ void ExpressionParser_delBuffer()
 
 void ExpressionParser_destroy()
 {
+#ifdef BALL_HAS_YYLEX_DESTROY
 	ExpressionParserlex_destroy();
+#endif
 }
diff --git a/source/MOLMEC/AMBER/GAFFCESParserLexer.l b/source/MOLMEC/AMBER/GAFFCESParserLexer.l
index e087439..3754f01 100644
--- a/source/MOLMEC/AMBER/GAFFCESParserLexer.l
+++ b/source/MOLMEC/AMBER/GAFFCESParserLexer.l
@@ -81,5 +81,7 @@ END_PROPERTY   "]"
 
 void GAFFCESParser_destroy()
 {
+#ifdef BALL_HAS_YYLEX_DESTROY
 	GAFFCESParserlex_destroy();
+#endif
 }
diff --git a/source/MOLMEC/COMMON/snapShotManager.C b/source/MOLMEC/COMMON/snapShotManager.C
index a0ec536..8c295fd 100644
--- a/source/MOLMEC/COMMON/snapShotManager.C
+++ b/source/MOLMEC/COMMON/snapShotManager.C
@@ -602,7 +602,6 @@ namespace BALL
 		trajectory_file_ptr_->reopen();
 		trajectory_file_ptr_->readHeader();
 		Size number = trajectory_file_ptr_->getNumberOfSnapShots();
-		trajectory_file_ptr_->reopen();
 		for (Size count = 0; count < number; ++count)
 		{
 			SnapShot buffer;
diff --git a/source/PLUGIN/pluginManager.C b/source/PLUGIN/pluginManager.C
index d26726f..0a5436e 100644
--- a/source/PLUGIN/pluginManager.C
+++ b/source/PLUGIN/pluginManager.C
@@ -167,9 +167,14 @@ namespace BALL
 		{
 			//Shutdown the plugin
 			stopPlugin(qobject_cast<BALLPlugin*>(it.value()->instance()));
+			
+			// NOTE: unloading crashes BALLView, for some reason!
+			//       it is not really crucial to unload the plugins, but we should have
+			//       a look at this anyhow
 			//Delete the loader
-			it.value()->unload();
-			delete it.value();
+//			it.value()->unload();
+//			delete it.value();
+
 			loaders_.erase(it);
 
 			return true;
diff --git a/source/PYTHON/EXTENSIONS/BALL/BALLCore.sip b/source/PYTHON/EXTENSIONS/BALL/BALLCore.sip
index af676c5..7a9fed8 100644
--- a/source/PYTHON/EXTENSIONS/BALL/BALLCore.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/BALLCore.sip
@@ -9,7 +9,7 @@
 // module definition file
 //
 
-%Module BALLCore
+%Module(name=BALLCore, all_raise_py_exception=True)
 
 %ModuleHeaderCode
 #include <BALLPyMacros.h>
@@ -96,6 +96,7 @@
 // FORMAT
 %Include DCDFile.sip
 %Include HINFile.sip
+%Include HMOFile.sip
 %Include INIFile.sip
 // %Include JCAMPFile.sip
 %Include KCFFile.sip
@@ -203,7 +204,7 @@
 %Include charmmTorsion.sip
 
 // MOLMEC/COMMON
-// assignTypes.h // ??
+%Include assignTypes.sip
 %Include atomVector.sip
 %Include chargeRuleProcessor.sip
 %Include forceField.sip
@@ -265,6 +266,7 @@
 // QSAR
 //%Include descriptor.sip
 //%Include simpleDescriptors.sip
+%Include aromaticityProcessor.sip
 
 // SOLVATION
 // %Include molecularSurfaceGrid.sip // ??
diff --git a/source/PYTHON/EXTENSIONS/BALL/HMOFile.sip b/source/PYTHON/EXTENSIONS/BALL/HMOFile.sip
new file mode 100644
index 0000000..5d7a23b
--- /dev/null
+++ b/source/PYTHON/EXTENSIONS/BALL/HMOFile.sip
@@ -0,0 +1,62 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+class HMOFile 
+	: public LineBasedFile
+{
+%TypeHeaderCode
+  #include <BALL/FORMAT/HMOFile.h>
+	using namespace BALL;
+	using namespace BALL::Exception;
+	typedef HMOFile::HMOCharge HMOFile_HMOCharge;
+%End
+
+	public:
+		class HMOCharge
+		{
+			public:
+				Vector3 position;
+				float   value;
+
+//				bool operator == (const HMOCharge&) const;
+		};
+
+		enum ElementType
+		{
+			L2   = 60,          // line element with two nodes
+			L3   = 63,          // line element with three nodes
+			T3   = 103,         // triangular element with three nodes
+			T6   = 106,         // triangular element with six nodes
+			Q4   = 104,         // quadrilateral element with four nodes
+			Q8   = 108,         // quadrilateral element with eight nodes
+			TH4  = 204,         // tetrahedral element with four nodes
+			TH10 = 210,         // tetrahedral element with ten nodes
+			P6   = 206,         // pentahedral element with six nodes
+			P15  = 215,         // pentahedral element with fifteen nodes
+			H8   = 208,         // hexaedral element with eight nodes
+			H20  = 220          // hexaedral element with twenty nodes
+		};
+
+		HMOFile();
+		HMOFile(const String& filename, OpenMode open_mode = std::ios::in);
+		virtual ~HMOFile();
+
+		virtual void clear();
+		bool operator == (const HMOFile& file);
+		bool hasCharges() const;
+		vector<HMOFile_HMOCharge>& getCharges();
+		//vector<HMOCharge> const& getCharges() const;
+		bool hasComments() const;
+		vector<String>& getComments();
+		//vector<String> const& getComments();
+
+		virtual bool open(const String& name, OpenMode open_mode = std::ios::in);
+		virtual bool read(Surface& surface) throw(FileNotFound, ParseError);
+
+		virtual bool write(const Surface& surface);
+		virtual bool write(const Surface& surface, const AtomContainer& ac);
+
+	private:
+		HMOFile(const HMOFile&);
+};
diff --git a/source/PYTHON/EXTENSIONS/BALL/NMRStarFile.sip b/source/PYTHON/EXTENSIONS/BALL/NMRStarFile.sip
index 75134e4..437724a 100644
--- a/source/PYTHON/EXTENSIONS/BALL/NMRStarFile.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/NMRStarFile.sip
@@ -382,8 +382,8 @@ class NMRStarFile
 			bool hasCshifts();
 			bool hasNshifts();
 
-			bool operator == (const NMRStarFile& );
-			bool operator != (const NMRStarFile& );
+			bool operator == (const NMRStarFile& ) const;
+			bool operator != (const NMRStarFile& ) const;
 	
 			void clear(); 
 
diff --git a/source/PYTHON/EXTENSIONS/BALL/RMSDMinimizer.sip b/source/PYTHON/EXTENSIONS/BALL/RMSDMinimizer.sip
index c791395..721eefc 100644
--- a/source/PYTHON/EXTENSIONS/BALL/RMSDMinimizer.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/RMSDMinimizer.sip
@@ -8,18 +8,42 @@ class RMSDMinimizer
 %End
 
 	public:
-		class IncompatibleCoordinateSets
-			: GeneralException
+		%Exception RMSDMinimizer::IncompatibleCoordinateSets(GeneralException) /PyName=RMSDMinimizer_IncompatibleCoordinateSets/
 		{
-			public:
-				IncompatibleCoordinateSets(const char*, int, Size, Size);
+%TypeHeaderCode
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
+%End
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_RMSDMinimizer_IncompatibleCoordinateSets, detail.c_str());
+    SIP_UNBLOCK_THREADS
+%End
 		};
 
-		class TooFewCoordinates
-			: GeneralException
+		%Exception RMSDMinimizer::TooFewCoordinates(GeneralException) /PyName=RMSDMinimizer_TooFewCoordinates/
 		{
-			public:
-				TooFewCoordinates(const char*, int, Size);
+%TypeHeaderCode
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
+%End
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_RMSDMinimizer_TooFewCoordinates, detail.c_str());
+    SIP_UNBLOCK_THREADS
+%End
 		};
 
 		typedef vector<Vector3> PointVector;
diff --git a/source/PYTHON/EXTENSIONS/BALL/XYZFile.sip b/source/PYTHON/EXTENSIONS/BALL/XYZFile.sip
index 6674a8d..862aa3e 100644
--- a/source/PYTHON/EXTENSIONS/BALL/XYZFile.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/XYZFile.sip
@@ -15,12 +15,12 @@ class XYZFile
 %End
   public:
   XYZFile();
-  XYZFile(const String&, OpenMode openmode = std::ios::in) throw(FileNotFound);
-  ~XYZFile() throw();
-  virtual bool write(const System&) throw(File::CannotWrite);
-	virtual bool write(const Molecule&) throw(File::CannotWrite);
-  virtual bool read(System&) throw(ParseError);
-	virtual Molecule* read() throw(ParseError);
+  XYZFile(const String&, OpenMode openmode = std::ios::in);
+  ~XYZFile();
+  virtual bool write(const System&);
+	virtual bool write(const Molecule&);
+  virtual bool read(System&);
+	virtual Molecule* read();
 	const String& getComment();
 	private:
 		XYZFile(const XYZFile&);
diff --git a/source/PYTHON/EXTENSIONS/BALL/aromaticityProcessor.sip b/source/PYTHON/EXTENSIONS/BALL/aromaticityProcessor.sip
new file mode 100644
index 0000000..b27c6e8
--- /dev/null
+++ b/source/PYTHON/EXTENSIONS/BALL/aromaticityProcessor.sip
@@ -0,0 +1,54 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+//
+
+%ModuleCode
+	#include <BALL/QSAR/aromaticityProcessor.h>
+	using namespace BALL;
+	typedef UnaryProcessor<Composite> CompositeProcessor;
+%End
+
+class AromaticityProcessor
+	:	CompositeProcessor
+{
+%TypeHeaderCode
+	#include <BALL/QSAR/aromaticityProcessor.h>
+	using namespace BALL;
+	using namespace BALL::Exception;
+	typedef UnaryProcessor<Composite> CompositeProcessor;
+%End
+
+	public:
+
+		struct Option
+		{	
+			static const char* OVERWRITE_BOND_ORDERS;	
+		};
+
+		struct Default
+		{
+			static const bool OVERWRITE_BOND_ORDERS;
+		};
+
+		// BALL_CREATE(AromaticityProcessor)
+
+		AromaticityProcessor();
+//		AromaticityProcessor(const AromaticityProcessor& aro);
+
+		virtual ~AromaticityProcessor();
+
+//		AromaticityProcessor& operator = (const AromaticityProcessor& aro);
+
+		Options options;
+		void setDefaultOptions();
+
+//		void aromatize(const vector<vector<Atom*> >&, AtomContainer&);
+
+//		void aromatizeSimple(vector<vector<Atom*> >&);
+
+		Processor::Result operator () (AtomContainer& ac);
+%MethodCode
+  sipRes = sipCpp->operator () (*a0);
+%End
+};
diff --git a/source/PYTHON/EXTENSIONS/BALL/assignTypes.sip b/source/PYTHON/EXTENSIONS/BALL/assignTypes.sip
new file mode 100644
index 0000000..6dee52e
--- /dev/null
+++ b/source/PYTHON/EXTENSIONS/BALL/assignTypes.sip
@@ -0,0 +1,74 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+%ModuleCode
+	#include <BALL/MOLMEC/COMMON/assignTypes.h>
+	using namespace BALL;
+	typedef UnaryProcessor<Atom> AtomProcessor;
+%End
+
+class	AssignBaseProcessor
+	:	public AtomProcessor
+{
+%TypeHeaderCode
+	#include <BALL/MOLMEC/COMMON/assignTypes.h>
+	using namespace BALL;
+	using namespace BALL::Exception;
+	typedef UnaryProcessor<Atom> AtomProcessor;
+%End
+
+	public:
+
+		AssignBaseProcessor();
+
+		void setMaximumUnassignedAtoms(Size);
+		Size getMaximumUnassignedAtoms() const;
+		Size getNumberOfUnassignedAtoms() const;
+
+		virtual Processor::Result operator () (Atom& atom);
+%MethodCode
+	sipRes = sipCpp->operator () (*a0);
+%End
+
+		virtual ~AssignBaseProcessor();
+
+//		HashSet<const Atom*>& getUnassignedAtoms();
+};
+
+class	AssignTypeProcessor
+	:	public AssignBaseProcessor
+{
+%TypeHeaderCode
+	#include <BALL/MOLMEC/COMMON/assignTypes.h>
+	using namespace BALL;
+	using namespace BALL::Exception;
+%End
+
+	public:
+
+		AssignTypeProcessor(const AtomTypes&);
+		virtual Processor::Result operator () (Atom&);
+%MethodCode
+		sipRes = sipCpp->operator () (*a0);
+%End
+};
+
+class	AssignTypeNameProcessor
+	:	public AssignBaseProcessor
+{
+%TypeHeaderCode
+	#include <BALL/MOLMEC/COMMON/assignTypes.h>
+	using namespace BALL;
+	using namespace BALL::Exception;
+%End
+
+	public:
+
+		AssignTypeNameProcessor(const String&, bool overwrite);
+
+		virtual Processor::Result operator () (Atom& atom);
+%MethodCode
+		sipRes = sipCpp->operator () (*a0);
+%End
+};
diff --git a/source/PYTHON/EXTENSIONS/BALL/exception.sip b/source/PYTHON/EXTENSIONS/BALL/exception.sip
index 1e0b700..3aa769e 100644
--- a/source/PYTHON/EXTENSIONS/BALL/exception.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/exception.sip
@@ -1,10 +1,8 @@
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id$
-//
 
-class GeneralException 
+%Exception GeneralException(SIP_Exception) /PyName=GeneralException, Default/
 {
 %TypeHeaderCode
 	#include <BALL/DATATYPE/string.h>
@@ -12,531 +10,377 @@ class GeneralException
 	using namespace BALL;
 	using namespace BALL::Exception;
 %End
-	
-	public:
-	GeneralException();
-	GeneralException
-    (const char*, int);
-	
-	GeneralException
-    (const char*, int,	
-     const String&,
-     const String&);
-
-	GeneralException(const GeneralException&);
-	~GeneralException();
-	const char* getName() const;
-	const char* getMessage() const;
-	int getLine() const;
-	const char* getFile() const;
-
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
-%End
-
-};  
-
-
-class IndexUnderflow 
- 	: GeneralException
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_GeneralException, detail.c_str());
+    SIP_UNBLOCK_THREADS
+%End
+};
+
+%Exception IndexUnderflow(GeneralException) /PyName=IndexUnderflow/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-  public:
-  IndexUnderflow(const char*, int, Index index = 0, Size size = 0);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_IndexUnderflow, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class SizeUnderflow 
-  : GeneralException
+%Exception SizeUnderflow(GeneralException) /PyName=SizeUnderflow/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
-%End
-  public:
-  SizeUnderflow(const char*, int, Size size = 0);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
 
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_SizeUnderflow, detail.c_str());
+    SIP_UNBLOCK_THREADS
+%End
 };
 
-
-class IndexOverflow 
-  : GeneralException
+%Exception IndexOverflow(GeneralException) /PyName=IndexOverflow/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	IndexOverflow(const char*, int, Index index = 0, Size size = 0);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_IndexOverflow, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class InvalidRange 
-	: GeneralException
+%Exception InvalidRange(GeneralException) /PyName=InvalidRange/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	InvalidRange(const char*, int, float);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_InvalidRange, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class InvalidFormat 
-	: GeneralException
+%Exception InvalidFormat(GeneralException) /PyName=InvalidFormat/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	InvalidFormat(const char*, int, const String&);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_InvalidFormat, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class IllegalSelfOperation
-	: GeneralException
+%Exception IllegalSelfOperation(GeneralException) /PyName=IllegalSelfOperation/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	IllegalSelfOperation(const char*, int);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_IllegalSelfOperation, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class NullPointer 
-	: GeneralException
+%Exception NullPointer(GeneralException) /PyName=NullPointer/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	NullPointer(const char*, int);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_NullPointer, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class InvalidIterator
-	: GeneralException
+%Exception InvalidIterator(GeneralException) /PyName=InvalidIterator/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	InvalidIterator(const char*, int);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_InvalidIterator, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class IncompatibleIterators
-	: GeneralException
+%Exception IncompatibleIterators(GeneralException) /PyName=IncompatibleIterators/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	IncompatibleIterators(const char*, int);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_IncompatibleIterators, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class NotImplemented
-	: GeneralException
+%Exception NotImplemented(GeneralException) /PyName=NotImplemented/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	NotImplemented(const char*, int);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_NotImplemented, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class InvalidOption
-	: GeneralException
+%Exception InvalidOption(GeneralException) /PyName=InvalidOption/
 {
 %TypeHeaderCode
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-		InvalidOption(const char* file, int line, String option);
-
-		SIP_PYOBJECT __repr__();
-%MethodCode
-	if(sipCpp == 0)
-	{
-		sipRes = PyString_FromString("");
-	}
-	else
-	{
-		sipRes = PyString_FromString(String(String(sipCpp->getName())
-		         + " in line " + String(sipCpp->getLine()) + " of "
-		         + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-	}
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_InvalidOption, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class TooManyErrors
-	: GeneralException
+%Exception TooManyErrors(GeneralException) /PyName=TooManyErrors/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	TooManyErrors(const char*, int);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_TooManyErrors, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-
-class OutOfMemory
-	: GeneralException
+%Exception OutOfMemory(GeneralException) /PyName=OutOfMemory/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	OutOfMemory(const char*, int, Size size = 0);
-	~OutOfMemory() throw();
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_OutOfMemory, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class OutOfGrid
-  : GeneralException
+%Exception OutOfGrid(GeneralException) /PyName=OutOfGrid/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	OutOfGrid(const char*, int)
-    throw();
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_OutOfGrid, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
-
   
-class BufferOverflow 
-	: GeneralException
+%Exception BufferOverflow(GeneralException) /PyName=BufferOverflow/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	BufferOverflow(const char*, int);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_BufferOverflow, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class DivisionByZero 
-	: GeneralException
+%Exception DivisionByZero(GeneralException) /PyName=DivisionByZero/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	DivisionByZero(const char*, int);
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_DivisionByZero, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class FileNotFound 
- : GeneralException
+%Exception FileNotFound(GeneralException) /PyName=FileNotFound/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-  public:
-  FileNotFound(const char*, int, const String&);
-  String getFilename() const;
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_FileNotFound, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class ParseError
-	: GeneralException
+%Exception ParseError(GeneralException) /PyName=ParseError/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-	#include <BALL/COMMON/exception.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-	public:
-	ParseError(const char*, int, const String&,
- 	  				 const String&)
-							throw();
- 	SIP_PYOBJECT __repr__();
-%MethodCode
-  if (sipCpp == 0)
-  {
-    sipRes = PyString_FromString("");
-  }
-  else
-  {
-    sipRes = PyString_FromString(String(String(sipCpp->getName())
-					+ " in line " + String(sipCpp->getLine()) + " of "
-          + String(sipCpp->getFile()) + ": " + String(sipCpp->getMessage())).c_str());
-  }
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_ParseError, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
 };
 
-class TooManyBonds
- : GeneralException
+%Exception TooManyBonds(GeneralException) /PyName=TooManyBonds/
 {
 %TypeHeaderCode
-	#include <BALL/DATATYPE/string.h>
-  #include <BALL/COMMON/exception.h>
-  using namespace BALL;
-  using namespace BALL::Exception;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
 %End
-  public:
-  TooManyBonds(const char*, int, const String) throw();
-};
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
 
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_TooManyBonds, detail.c_str());
+    SIP_UNBLOCK_THREADS
+%End
+};
 
 /// creates a crash under windows:
 class GlobalExceptionHandler
diff --git a/source/PYTHON/EXTENSIONS/BALL/file.sip b/source/PYTHON/EXTENSIONS/BALL/file.sip
index 52db1a4..cf219f7 100644
--- a/source/PYTHON/EXTENSIONS/BALL/file.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/file.sip
@@ -22,14 +22,14 @@ class File
 	#include <BALL/SYSTEM/file.h>
 	using namespace BALL;
 
-/*
-	const File::OpenMode BALL_File__IN = File::MODE_IN;
-	const File::OpenMode BALL_File__OUT = File::MODE_OUT;
-	const File::OpenMode BALL_File__APP = File::MODE_APP;
-	const File::OpenMode BALL_File__BINARY = File::MODE_BINARY;
-	const File::OpenMode BALL_File__ATE = File::MODE_ATE;
-	const File::OpenMode BALL_File__TRUNC = File::MODE_TRUNC;
-*/
+	/*
+	const File::OpenMode MODE_IN     = std::ios::in;
+	const File::OpenMode MODE_OUT    = std::ios::out;
+	const File::OpenMode MODE_APP    = std::ios::app;
+	const File::OpenMode MODE_BINARY = std::ios::binary;
+	const File::OpenMode MODE_ATE    = std::ios::ate;
+	const File::OpenMode MODE_TRUNC  = std::ios::trunc;
+	*/
 
 %End
   public:
@@ -44,7 +44,8 @@ class File
 	};
 
 
-	enum {
+	/*
+	unsigned enum {
 		MODE_IN,
 		MODE_OUT,
 		MODE_APP,
@@ -52,6 +53,7 @@ class File
 		MODE_ATE,
 		MODE_TRUNC
 	};
+	*/
 
 
   File();
diff --git a/source/PYTHON/EXTENSIONS/BALL/fragmentDB.sip b/source/PYTHON/EXTENSIONS/BALL/fragmentDB.sip
index 72b45a9..d70ca36 100644
--- a/source/PYTHON/EXTENSIONS/BALL/fragmentDB.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/fragmentDB.sip
@@ -11,6 +11,7 @@ class FragmentDB
 	#include <BALL/STRUCTURE/reconstructFragmentProcessor.h>
 	using namespace BALL;
 	typedef UnaryProcessor<Fragment> FragmentProcessor;
+	typedef StringHashMap<String> StringHashMapString;
 %End
   public:
   enum FragmentTypes 
@@ -44,7 +45,7 @@ class FragmentDB
   Molecule* getMoleculeCopy(const String&) const;
   Residue* getResidueCopy(const String&) const;
 	const StringHashMap<String>& getNamingStandard(const String&) const
-		throw(IllegalKey);
+		throw(StringHashMapString::IllegalKey);
 	vector<String> getAvailableNamingStandards() const;
   const String& getDefaultNamingStandard() const;
 	// BAUSTELLE
diff --git a/source/PYTHON/EXTENSIONS/BALL/molFileFactory.sip b/source/PYTHON/EXTENSIONS/BALL/molFileFactory.sip
index 9250eff..db4346c 100644
--- a/source/PYTHON/EXTENSIONS/BALL/molFileFactory.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/molFileFactory.sip
@@ -6,5 +6,10 @@ class MolFileFactory
 	using namespace BALL;
 %End
 	public:
+		static String getSupportedFormats();
+		static bool isFileExtensionSupported(String filename);
 		static GenericMolFile* open(const String&, OpenMode open_mode = std::ios::in);
+	    static GenericMolFile* open(const String&, OpenMode, String, bool forced = false);
+		static GenericMolFile* open(const String&, OpenMode, GenericMolFile*);
+
 };
diff --git a/source/PYTHON/EXTENSIONS/BALL/options.sip b/source/PYTHON/EXTENSIONS/BALL/options.sip
index ad93d2f..e6af927 100644
--- a/source/PYTHON/EXTENSIONS/BALL/options.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/options.sip
@@ -1,21 +1,25 @@
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id$
-//
 
-class IllegalKey
-	:	GeneralException
+%Exception StringHashMapString::IllegalKey(GeneralException) /PyName=StringHashMapString_IllegalKey/
 {
 %TypeHeaderCode
-	#include <BALL/COMMON/exception.h>
-	#include <BALL/DATATYPE/stringHashMap.h>
-	using namespace BALL;
-	using namespace BALL::Exception;
-	typedef StringHashMap<String>::IllegalKey IllegalKey;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+using namespace BALL;
+using namespace BALL::Exception;
+typedef StringHashMap<String> StringHashMapString;
+%End
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
+
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_StringHashMapString_IllegalKey, detail.c_str());
+    SIP_UNBLOCK_THREADS
 %End
-	public:
-	IllegalKey(const char*, int);
 };
 
 class Options
@@ -56,7 +60,7 @@ class Options
 	// methods inherited from HashMap<String, String>
 	// String& operator [] (const String&) throw();
 
-	const String& operator [] (const String&) const	throw(IllegalKey);
+	const String& operator [] (const String&) const	throw(StringHashMapString::IllegalKey);
 %MethodCode
   sipRes = new String(sipCpp->operator [] (*a0));
 %End
diff --git a/source/PYTHON/EXTENSIONS/BALL/string.sip b/source/PYTHON/EXTENSIONS/BALL/string.sip
index fc1e05a..6c6480f 100644
--- a/source/PYTHON/EXTENSIONS/BALL/string.sip
+++ b/source/PYTHON/EXTENSIONS/BALL/string.sip
@@ -221,12 +221,6 @@ class String
   int compare(const char*, int from = 0) const;
   int compare(const char*, int, int) const;
   int compare(char, int from = 0) const;
-  bool operator == (const String&) const;
-  bool operator != (const String&) const;
-  bool operator < (const String&) const;
-  bool operator <= (const String&) const;
-  bool operator >= (const String&) const;
-  bool operator > (const String&) const;
   // friend bool operator == (const char* char_ptr, const String&);
   // friend bool operator != (const char* char_ptr, const String&);
   // friend bool operator < (const char* char_ptr, const String&);
@@ -314,3 +308,10 @@ SIP_PYOBJECT __repr__();
   return 0;
 %End
 };
+
+bool operator == (const String& s1, const String& s2);
+bool operator != (const String& s1, const String& s2);
+bool operator <  (const String& s1, const String& s2);
+bool operator <= (const String& s1, const String& s2);
+bool operator >= (const String& s1, const String& s2);
+bool operator >  (const String& s1, const String& s2);
diff --git a/source/PYTHON/EXTENSIONS/TEST/Makefile.lst b/source/PYTHON/EXTENSIONS/TEST/Makefile.lst
deleted file mode 100644
index fa26fec..0000000
--- a/source/PYTHON/EXTENSIONS/TEST/Makefile.lst
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# $Id: Makefile.lst,v 1.2 2005/12/23 17:03:02 amoll Exp $
-#
-EXEEXT=.py
-
-XDR_DEPENDENT_EXECUTABLES = \
-$(TEST_PREFIX)XDRPersistenceManager_test$(EXEEXT)
-
-VIEW_DEPENDENT_EXECUTABLES=\
-
-EXECUTABLES_BASIC = \
-	$(TEST_PREFIX)ClassTest_test$(EXEEXT)\
-	$(TEST_PREFIX)VersionInfo_test$(EXEEXT)
-
-EXECUTABLES_MATHS = \
-
-EXECUTABLES_SYSTEM = \
-	$(TEST_PREFIX)SysInfo_test$(EXEEXT)
-
-EXECUTABLES_DATATYPES = \
-	$(TEST_PREFIX)RegularExpression_test$(EXEEXT)\
-	$(TEST_PREFIX)String_test1$(EXEEXT)\
-
-EXECUTABLES_CONCEPTS = \
-
-EXECUTABLES_KERNEL = \
-	$(TEST_PREFIX)Atom_test$(EXEEXT)\
-	$(TEST_PREFIX)Bond_test$(EXEEXT)\
-
-
-EXECUTABLES_MOLMEC = \
-
-EXECUTABLES_NMR = \
-
-EXECUTABLES_FORMATS = \
-
-EXECUTABLES_ENERGY = \
-
-EXECUTABLES_STRUCTURE = \
-
-EXECUTABLES_SOLVATION = \
-
-EXECUTABLES_QSAR = \
diff --git a/source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip b/source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip
index 522b0ed..7b8ba3e 100644
--- a/source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip
+++ b/source/PYTHON/EXTENSIONS/VIEW/modularWidget.sip
@@ -22,18 +22,18 @@ class ModularWidget
 	static Size countInstances();
 	static ModularWidget* getInstance(Position);
 
-  ModularWidget(const char* = "<ModularWidget>")	throw();
-	ModularWidget(const ModularWidget&) throw();
+  ModularWidget(const char* = "<ModularWidget>");
+	ModularWidget(const ModularWidget&);
  	~ModularWidget() throw();
 				
-	virtual void destroy() throw();
-	virtual void clear() throw();
+//	virtual void destroy();
+	virtual void clear();
 
 	static void registerWidget(ModularWidget*) throw(NullPointer);
 //	virtual void initializeWidget(MainControl&);
 // 	virtual void finalizeWidget(MainControl&);
 	virtual void checkMenu(MainControl&) throw();
-//	virtual void initializePreferencesTab(Preferences&)	throw();
+//	virtual void initializePreferencesTab(Preferences&);
 //	virtual void finalizePreferencesTab(Preferences&)	throw();
 	virtual void applyPreferences() throw();
   virtual void fetchPreferences(INIFile&) throw();
diff --git a/source/PYTHON/EXTENSIONS/VIEW/serverWidget.sip b/source/PYTHON/EXTENSIONS/VIEW/serverWidget.sip
index be2e9ba..2ad15f6 100644
--- a/source/PYTHON/EXTENSIONS/VIEW/serverWidget.sip
+++ b/source/PYTHON/EXTENSIONS/VIEW/serverWidget.sip
@@ -18,17 +18,25 @@ class ServerWidget
 	~ServerWidget() throw();
 	virtual void clear() throw();
 
-	class NotCompositeObject
-		:	GeneralException
+	%Exception ServerWidget::NotCompositeObject(GeneralException) /PyName=ServerWidget_NotCompositeObject/
 	{
 %TypeHeaderCode
-	#include <BALL/VIEW/KERNEL/serverWidget.h>
-	using namespace BALL;
-	using namespace BALL::VIEW;
+#include <BALL/DATATYPE/string.h>
+#include <BALL/COMMON/exception.h>
+#include <BALL/VIEW/KERNEL/serverWidget.h>
+using namespace BALL;
+using namespace BALL::VIEW;
+using namespace BALL::Exception;
 %End
-		public:
+%RaiseCode
+		String detail = 
+			(String)(sipExceptionRef.getName()) + " in line " + String(sipExceptionRef.getLine()) + " of " + sipExceptionRef.getFile()
+																				 + ": " + sipExceptionRef.getMessage();
 
-			NotCompositeObject(const char*, int) throw();
+    SIP_BLOCK_THREADS
+    PyErr_SetString(sipException_ServerWidget_NotCompositeObject, detail.c_str());
+    SIP_UNBLOCK_THREADS
+%End
 	};
 
 	void activate()	throw();
diff --git a/source/PYTHON/Makefile.win b/source/PYTHON/Makefile.win
deleted file mode 100755
index 990347a..0000000
--- a/source/PYTHON/Makefile.win
+++ /dev/null
@@ -1,30 +0,0 @@
-#----------------------------------------------------------------
-# Python Makefile
-# by Andreas Moll
-#---------------------------------------------------------------
-
-
-CC = cl -c -nologo -MD -Zm1200 -TP -EHsc -GR -Zi /D "WIN32" -Od -RTC1 -GS /D "DEBUG"
-LD = cl -nologo -MD
-LDOPTS = /link /OPT:NOREF /DEBUG /ASSEMBLYDEBUG /MAP /MAPINFO:EXPORTS /MAPINFO:LINES
-BALL_LIB = ..\..\lib\libBall.lib
-
-XLIB = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib ..\..\Windows\Contrib\ONC_RPC\librpc\oncrpc.lib
-
-
-INCL = -I ..\..\Windows\include -I ..\..\include -I ..\..\Windows\Contrib\regex-0.12 -I ..\..\Windows\Contrib\ONC_RPC -I C:\Programme\Python23\include
-
-o = .obj
-
-.c.obj:
-	$(CC) $(CFLAGS) $(DFLAGS) $(IFLAGS) $(INCL) $(*).C
-
-PYINTERPRETER = pyInterpreter.obj
-
-# default target
-all:	$(PYINTERPRETER)
- cd EXTENSIONS
- nmake  /F Makefile.win
-
-
-
diff --git a/source/QSAR/Model.C b/source/QSAR/Model.C
index d44c0e6..9318b05 100644
--- a/source/QSAR/Model.C
+++ b/source/QSAR/Model.C
@@ -1,23 +1,3 @@
-/* Model.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
@@ -77,7 +57,7 @@ namespace BALL
 
 		const string* Model::getType()
 		{
-			return &type_;
+			return &((string&)type_);
 		}
 
 
diff --git a/source/QSAR/QSARData.C b/source/QSAR/QSARData.C
index 5540ea0..38205c5 100644
--- a/source/QSAR/QSARData.C
+++ b/source/QSAR/QSARData.C
@@ -1,23 +1,3 @@
-/* QSARData.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/allModel.C b/source/QSAR/allModel.C
index 4e1a419..0965a47 100644
--- a/source/QSAR/allModel.C
+++ b/source/QSAR/allModel.C
@@ -1,23 +1,3 @@
-/* allModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/bayesModel.C b/source/QSAR/bayesModel.C
index 5f714fd..127e6c3 100644
--- a/source/QSAR/bayesModel.C
+++ b/source/QSAR/bayesModel.C
@@ -1,23 +1,3 @@
-/* bayesModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/QSAR/bayesModel.h>
 
 namespace BALL
diff --git a/source/QSAR/classificationModel.C b/source/QSAR/classificationModel.C
index 09bd2fd..8b59875 100644
--- a/source/QSAR/classificationModel.C
+++ b/source/QSAR/classificationModel.C
@@ -1,23 +1,3 @@
-/* classificationModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/classificationValidation.C b/source/QSAR/classificationValidation.C
index e01e879..776404f 100644
--- a/source/QSAR/classificationValidation.C
+++ b/source/QSAR/classificationValidation.C
@@ -1,23 +1,3 @@
-/* classificationValidation.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/configIO.C b/source/QSAR/configIO.C
index b76fcf8..2a64231 100644
--- a/source/QSAR/configIO.C
+++ b/source/QSAR/configIO.C
@@ -1,23 +1,3 @@
-/* configIO.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/QSAR/configIO.h>
 #include <BALL/QSAR/exception.h>
 #include <BALL/QSAR/registry.h>
diff --git a/source/QSAR/exception.C b/source/QSAR/exception.C
index 2302f7d..88f87ce 100644
--- a/source/QSAR/exception.C
+++ b/source/QSAR/exception.C
@@ -1,23 +1,3 @@
-/* exception.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/featureSelection.C b/source/QSAR/featureSelection.C
index 27603a1..af3cb05 100644
--- a/source/QSAR/featureSelection.C
+++ b/source/QSAR/featureSelection.C
@@ -1,23 +1,3 @@
-/* featureSelection.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/fitModel.C b/source/QSAR/fitModel.C
index bc13353..efb06a5 100644
--- a/source/QSAR/fitModel.C
+++ b/source/QSAR/fitModel.C
@@ -1,23 +1,3 @@
-/* fitModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/gpModel.C b/source/QSAR/gpModel.C
index 0a5295d..7bd8dca 100644
--- a/source/QSAR/gpModel.C
+++ b/source/QSAR/gpModel.C
@@ -1,23 +1,3 @@
-/* gpModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/kernel.C b/source/QSAR/kernel.C
index 3eef8c6..108da96 100644
--- a/source/QSAR/kernel.C
+++ b/source/QSAR/kernel.C
@@ -1,23 +1,3 @@
-/* kernel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 //  -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/kernelModel.C b/source/QSAR/kernelModel.C
index 6e23950..68d3fe3 100644
--- a/source/QSAR/kernelModel.C
+++ b/source/QSAR/kernelModel.C
@@ -1,23 +1,3 @@
-/* kernelModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/knnModel.C b/source/QSAR/knnModel.C
index 546eedf..8a750f2 100644
--- a/source/QSAR/knnModel.C
+++ b/source/QSAR/knnModel.C
@@ -1,23 +1,3 @@
-/* knnModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/QSAR/knnModel.h>
 
 using namespace std;
diff --git a/source/QSAR/kpcrModel.C b/source/QSAR/kpcrModel.C
index 3c33822..f85c18c 100644
--- a/source/QSAR/kpcrModel.C
+++ b/source/QSAR/kpcrModel.C
@@ -1,23 +1,3 @@
-/* kpcrModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/kplsModel.C b/source/QSAR/kplsModel.C
index b565a0d..4c30eeb 100644
--- a/source/QSAR/kplsModel.C
+++ b/source/QSAR/kplsModel.C
@@ -1,23 +1,3 @@
-/* kplsModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: weights_++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/latentVariableModel.C b/source/QSAR/latentVariableModel.C
index 5123f89..3b8f0ca 100644
--- a/source/QSAR/latentVariableModel.C
+++ b/source/QSAR/latentVariableModel.C
@@ -1,23 +1,3 @@
-/* latentVariableModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/QSAR/latentVariableModel.h>
 #include <iostream>
 
diff --git a/source/QSAR/ldaModel.C b/source/QSAR/ldaModel.C
index 9763b30..cb5a7a9 100644
--- a/source/QSAR/ldaModel.C
+++ b/source/QSAR/ldaModel.C
@@ -1,23 +1,3 @@
-/* ldaModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/libsvmModel.C b/source/QSAR/libsvmModel.C
index a2c99c9..042b504 100644
--- a/source/QSAR/libsvmModel.C
+++ b/source/QSAR/libsvmModel.C
@@ -1,24 +1,4 @@
-/* libsvmModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 //
diff --git a/source/QSAR/linearModel.C b/source/QSAR/linearModel.C
index 1754dff..4d6e997 100644
--- a/source/QSAR/linearModel.C
+++ b/source/QSAR/linearModel.C
@@ -1,23 +1,3 @@
-/* linearModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/logitModel.C b/source/QSAR/logitModel.C
index a387ef1..6ed2fc9 100644
--- a/source/QSAR/logitModel.C
+++ b/source/QSAR/logitModel.C
@@ -1,23 +1,3 @@
-/* logitModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/mlrModel.C b/source/QSAR/mlrModel.C
index 514b7fb..2d32eaf 100644
--- a/source/QSAR/mlrModel.C
+++ b/source/QSAR/mlrModel.C
@@ -1,24 +1,4 @@
-/* mlrModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 // 
diff --git a/source/QSAR/modelFactory.C b/source/QSAR/modelFactory.C
index ce120d2..24e8500 100644
--- a/source/QSAR/modelFactory.C
+++ b/source/QSAR/modelFactory.C
@@ -1,23 +1,3 @@
-/* modelFactory.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/nBModel.C b/source/QSAR/nBModel.C
index 126f938..f774911 100644
--- a/source/QSAR/nBModel.C
+++ b/source/QSAR/nBModel.C
@@ -1,23 +1,3 @@
-/* nBModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/nonlinearModel.C b/source/QSAR/nonlinearModel.C
index cd8fcd5..64906d0 100644
--- a/source/QSAR/nonlinearModel.C
+++ b/source/QSAR/nonlinearModel.C
@@ -1,23 +1,3 @@
-/* nonlinearModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/oplsModel.C b/source/QSAR/oplsModel.C
index 30616ef..7b79640 100644
--- a/source/QSAR/oplsModel.C
+++ b/source/QSAR/oplsModel.C
@@ -1,24 +1,4 @@
-/* oplsModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 //
diff --git a/source/QSAR/pcrModel.C b/source/QSAR/pcrModel.C
index a1764b2..2fa5657 100644
--- a/source/QSAR/pcrModel.C
+++ b/source/QSAR/pcrModel.C
@@ -1,23 +1,3 @@
-/* pcrModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/plsModel.C b/source/QSAR/plsModel.C
index 22ab9bf..7a5b64b 100644
--- a/source/QSAR/plsModel.C
+++ b/source/QSAR/plsModel.C
@@ -1,24 +1,4 @@
-/* plsModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-  // -*- Mode: weights_++; tab-width: 2; -*-
+// -*- Mode: weights_++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 //
diff --git a/source/QSAR/registry.C b/source/QSAR/registry.C
index 01c4130..49a5f72 100644
--- a/source/QSAR/registry.C
+++ b/source/QSAR/registry.C
@@ -1,23 +1,3 @@
-/* registry.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/QSAR/registry.h>
 
 #include <BALL/QSAR/QSARData.h>
diff --git a/source/QSAR/regressionModel.C b/source/QSAR/regressionModel.C
index ea5b864..83a5a9b 100644
--- a/source/QSAR/regressionModel.C
+++ b/source/QSAR/regressionModel.C
@@ -1,23 +1,3 @@
-/* regressionModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/regressionValidation.C b/source/QSAR/regressionValidation.C
index fbc20a3..a3da2a1 100644
--- a/source/QSAR/regressionValidation.C
+++ b/source/QSAR/regressionValidation.C
@@ -1,23 +1,3 @@
-/* regressionValidation.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/rrModel.C b/source/QSAR/rrModel.C
index 6d33ed2..0a6a18b 100644
--- a/source/QSAR/rrModel.C
+++ b/source/QSAR/rrModel.C
@@ -1,24 +1,4 @@
-/* rrModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 // 
diff --git a/source/QSAR/snBModel.C b/source/QSAR/snBModel.C
index d530468..03c28d1 100644
--- a/source/QSAR/snBModel.C
+++ b/source/QSAR/snBModel.C
@@ -1,23 +1,3 @@
-/* snBModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/statistics.C b/source/QSAR/statistics.C
index 0c129d6..3975570 100755
--- a/source/QSAR/statistics.C
+++ b/source/QSAR/statistics.C
@@ -1,23 +1,3 @@
-/* statistics.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/svmModel.C b/source/QSAR/svmModel.C
index e79fd6d..3427473 100644
--- a/source/QSAR/svmModel.C
+++ b/source/QSAR/svmModel.C
@@ -1,23 +1,3 @@
-/* svmModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/QSAR/svrModel.C b/source/QSAR/svrModel.C
index 8692cce..1986ad7 100644
--- a/source/QSAR/svrModel.C
+++ b/source/QSAR/svrModel.C
@@ -1,24 +1,4 @@
-/* svrModel.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // -*- Mode: C++; tab-width: 2; -*-
+// -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
 //
diff --git a/source/QSAR/validation.C b/source/QSAR/validation.C
index 1ac19cc..5067488 100644
--- a/source/QSAR/validation.C
+++ b/source/QSAR/validation.C
@@ -1,23 +1,3 @@
-/* validation.C
- * 
- * Copyright (C) 2009 Marcel Schumann
- * 
- * This file is part of QuEasy -- A Toolbox for Automated QSAR Model
- * Construction and Validation.
- * QuEasy is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- * 
- * QuEasy is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
diff --git a/source/SCORING/COMMON/diffGridBasedScoring.C b/source/SCORING/COMMON/diffGridBasedScoring.C
index b9d077d..7f7ec75 100644
--- a/source/SCORING/COMMON/diffGridBasedScoring.C
+++ b/source/SCORING/COMMON/diffGridBasedScoring.C
@@ -1,21 +1,3 @@
-/* diffGridBasedScoring.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMMON/diffScoringFunction.C b/source/SCORING/COMMON/diffScoringFunction.C
index c43a664..e80a41d 100644
--- a/source/SCORING/COMMON/diffScoringFunction.C
+++ b/source/SCORING/COMMON/diffScoringFunction.C
@@ -1,21 +1,3 @@
-/* diffScoringFunction.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMMON/gridBasedScoring.C b/source/SCORING/COMMON/gridBasedScoring.C
index e842336..cc73cd5 100644
--- a/source/SCORING/COMMON/gridBasedScoring.C
+++ b/source/SCORING/COMMON/gridBasedScoring.C
@@ -1,21 +1,3 @@
-/* gridBasedScoring.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMMON/scoreGridSet.C b/source/SCORING/COMMON/scoreGridSet.C
index 170c1e8..cc4a605 100644
--- a/source/SCORING/COMMON/scoreGridSet.C
+++ b/source/SCORING/COMMON/scoreGridSet.C
@@ -1,21 +1,3 @@
-/* scoreGridSet.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMMON/scoringComponent.C b/source/SCORING/COMMON/scoringComponent.C
index 0aa2b20..75f9dfb 100644
--- a/source/SCORING/COMMON/scoringComponent.C
+++ b/source/SCORING/COMMON/scoringComponent.C
@@ -1,21 +1,3 @@
-/* scoringComponent.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMMON/scoringOptimizer.C b/source/SCORING/COMMON/scoringOptimizer.C
index 2c6e06d..4b62a9c 100644
--- a/source/SCORING/COMMON/scoringOptimizer.C
+++ b/source/SCORING/COMMON/scoringOptimizer.C
@@ -1,21 +1,3 @@
-/* scoringOptimizer.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/CHPI.C b/source/SCORING/COMPONENTS/CHPI.C
index 77f9f4e..49eee15 100644
--- a/source/SCORING/COMPONENTS/CHPI.C
+++ b/source/SCORING/COMPONENTS/CHPI.C
@@ -1,26 +1,6 @@
-/* CHPI.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id: CHPI.C,v 1.2.10.1 2007/08/07 16:16:16 bertsch Exp $
-// CH---pi interaction for the SLICK energy function
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/PB.C b/source/SCORING/COMPONENTS/PB.C
index 3fe9b53..67d7a10 100644
--- a/source/SCORING/COMPONENTS/PB.C
+++ b/source/SCORING/COMPONENTS/PB.C
@@ -1,20 +1,3 @@
-/* PB.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/PLP.C b/source/SCORING/COMPONENTS/PLP.C
index b9c7f59..0c49818 100644
--- a/source/SCORING/COMPONENTS/PLP.C
+++ b/source/SCORING/COMPONENTS/PLP.C
@@ -1,21 +1,3 @@
-/* PLP.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 // ----------------------------------------------------
diff --git a/source/SCORING/COMPONENTS/advElectrostatic.C b/source/SCORING/COMPONENTS/advElectrostatic.C
index 608f844..98ef125 100644
--- a/source/SCORING/COMPONENTS/advElectrostatic.C
+++ b/source/SCORING/COMPONENTS/advElectrostatic.C
@@ -1,21 +1,3 @@
-/* advElectrostatic.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/aromaticRingStacking.C b/source/SCORING/COMPONENTS/aromaticRingStacking.C
index bb1c015..b1c1c2a 100644
--- a/source/SCORING/COMPONENTS/aromaticRingStacking.C
+++ b/source/SCORING/COMPONENTS/aromaticRingStacking.C
@@ -1,21 +1,3 @@
-/* aromaticRingStacking.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/burialDepth.C b/source/SCORING/COMPONENTS/burialDepth.C
index c718672..c330792 100644
--- a/source/SCORING/COMPONENTS/burialDepth.C
+++ b/source/SCORING/COMPONENTS/burialDepth.C
@@ -1,21 +1,3 @@
-/* burialDepth.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/buriedPolar.C b/source/SCORING/COMPONENTS/buriedPolar.C
index a9b2309..ac2850b 100644
--- a/source/SCORING/COMPONENTS/buriedPolar.C
+++ b/source/SCORING/COMPONENTS/buriedPolar.C
@@ -1,22 +1,3 @@
-/* buriedPolar.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-// $Id: buriedPolar.C,v 1.4 2006/05/21 17:38:39 anker Exp $
 // Molecular Mechanics: Fresno force field, buried polar component
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/electrostatic.C b/source/SCORING/COMPONENTS/electrostatic.C
index 3fb7730..31dcf1c 100644
--- a/source/SCORING/COMPONENTS/electrostatic.C
+++ b/source/SCORING/COMPONENTS/electrostatic.C
@@ -1,21 +1,3 @@
-/* electrostatic.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/fragmentationalSolvation.C b/source/SCORING/COMPONENTS/fragmentationalSolvation.C
index f1f04f8..b391795 100644
--- a/source/SCORING/COMPONENTS/fragmentationalSolvation.C
+++ b/source/SCORING/COMPONENTS/fragmentationalSolvation.C
@@ -1,21 +1,3 @@
-/* fragmentationalSolvation.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/fresnoTypes.C b/source/SCORING/COMPONENTS/fresnoTypes.C
index f9a138a..7b67b2d 100644
--- a/source/SCORING/COMPONENTS/fresnoTypes.C
+++ b/source/SCORING/COMPONENTS/fresnoTypes.C
@@ -1,21 +1,3 @@
-/* fresnoTypes.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/hydrogenBond.C b/source/SCORING/COMPONENTS/hydrogenBond.C
index eaf2694..69c0eee 100644
--- a/source/SCORING/COMPONENTS/hydrogenBond.C
+++ b/source/SCORING/COMPONENTS/hydrogenBond.C
@@ -1,22 +1,3 @@
-/* hydrogenBond.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-// $Id: hydrogenBond.C,v 1.4 2006/05/21 17:32:10 anker Exp $
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/lipophilic.C b/source/SCORING/COMPONENTS/lipophilic.C
index d23e344..be474cc 100644
--- a/source/SCORING/COMPONENTS/lipophilic.C
+++ b/source/SCORING/COMPONENTS/lipophilic.C
@@ -1,21 +1,3 @@
-/* lipophilic.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Slick-development Team, Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/polarity.C b/source/SCORING/COMPONENTS/polarity.C
index 6016dbe..de1072e 100644
--- a/source/SCORING/COMPONENTS/polarity.C
+++ b/source/SCORING/COMPONENTS/polarity.C
@@ -1,21 +1,3 @@
-/* polarity.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/rotationalEntropy.C b/source/SCORING/COMPONENTS/rotationalEntropy.C
index cb0c839..16c4c10 100755
--- a/source/SCORING/COMPONENTS/rotationalEntropy.C
+++ b/source/SCORING/COMPONENTS/rotationalEntropy.C
@@ -1,21 +1,3 @@
-/* rotationalEntropy.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/solvation.C b/source/SCORING/COMPONENTS/solvation.C
index 4bdba10..dbddcb8 100644
--- a/source/SCORING/COMPONENTS/solvation.C
+++ b/source/SCORING/COMPONENTS/solvation.C
@@ -1,21 +1,3 @@
-/* solvation.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/COMPONENTS/vanDerWaals.C b/source/SCORING/COMPONENTS/vanDerWaals.C
index 38b55e5..ecdd1f3 100644
--- a/source/SCORING/COMPONENTS/vanDerWaals.C
+++ b/source/SCORING/COMPONENTS/vanDerWaals.C
@@ -1,21 +1,3 @@
-/* vanDerWaals.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/FUNCTIONS/MMScoring.C b/source/SCORING/FUNCTIONS/MMScoring.C
index 112c691..3e30451 100644
--- a/source/SCORING/FUNCTIONS/MMScoring.C
+++ b/source/SCORING/FUNCTIONS/MMScoring.C
@@ -1,21 +1,3 @@
-/* MMScoring.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/FUNCTIONS/PBScoring.C b/source/SCORING/FUNCTIONS/PBScoring.C
index e439384..39f1090 100644
--- a/source/SCORING/FUNCTIONS/PBScoring.C
+++ b/source/SCORING/FUNCTIONS/PBScoring.C
@@ -1,22 +1,4 @@
-/* PBScoring.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
- // ----------------------------------------------------
+// ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
 // ----------------------------------------------------
diff --git a/source/SCORING/FUNCTIONS/PLPScoring.C b/source/SCORING/FUNCTIONS/PLPScoring.C
index b6ab353..b8ba02e 100755
--- a/source/SCORING/FUNCTIONS/PLPScoring.C
+++ b/source/SCORING/FUNCTIONS/PLPScoring.C
@@ -1,21 +1,3 @@
-/* PLPScoring.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/FUNCTIONS/gridedMM.C b/source/SCORING/FUNCTIONS/gridedMM.C
index ba7d3fa..91cb94f 100755
--- a/source/SCORING/FUNCTIONS/gridedMM.C
+++ b/source/SCORING/FUNCTIONS/gridedMM.C
@@ -1,20 +1,3 @@
-/* gridedMM.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
 
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
diff --git a/source/SCORING/FUNCTIONS/gridedPLP.C b/source/SCORING/FUNCTIONS/gridedPLP.C
index caca080..6ed82c9 100644
--- a/source/SCORING/FUNCTIONS/gridedPLP.C
+++ b/source/SCORING/FUNCTIONS/gridedPLP.C
@@ -1,21 +1,3 @@
-/* gridedPLP.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/FUNCTIONS/rescoring.C b/source/SCORING/FUNCTIONS/rescoring.C
index 07ff77a..8051833 100755
--- a/source/SCORING/FUNCTIONS/rescoring.C
+++ b/source/SCORING/FUNCTIONS/rescoring.C
@@ -1,21 +1,3 @@
-/* rescoring.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 #include <BALL/SCORING/FUNCTIONS/rescoring.h>
 #include <BALL/SCORING/FUNCTIONS/MMScoring.h>
 #include <BALL/SCORING/COMPONENTS/aromaticRingStacking.h>
diff --git a/source/SCORING/FUNCTIONS/rescoring1D.C b/source/SCORING/FUNCTIONS/rescoring1D.C
index c8dabff..2d979f9 100755
--- a/source/SCORING/FUNCTIONS/rescoring1D.C
+++ b/source/SCORING/FUNCTIONS/rescoring1D.C
@@ -1,21 +1,3 @@
-/* rescoring1D.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/FUNCTIONS/rescoring3D.C b/source/SCORING/FUNCTIONS/rescoring3D.C
index fccadda..4a0ae84 100644
--- a/source/SCORING/FUNCTIONS/rescoring3D.C
+++ b/source/SCORING/FUNCTIONS/rescoring3D.C
@@ -1,21 +1,3 @@
-/* rescoring3D.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
 // ----------------------------------------------------
 // $Maintainer: Marcel Schumann $
 // $Authors: Marcel Schumann $
diff --git a/source/SCORING/FUNCTIONS/rescoring4D.C b/source/SCORING/FUNCTIONS/rescoring4D.C
index bedbc5d..3f80c56 100644
--- a/source/SCORING/FUNCTIONS/rescoring4D.C
+++ b/source/SCORING/FUNCTIONS/rescoring4D.C
@@ -1,22 +1,3 @@
-/* rescoring4D.C
- *
- * Copyright (C) 2011 Marcel Schumann
- *
- * This program free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-
 #include <BALL/SCORING/FUNCTIONS/rescoring4D.h>
 #include <BALL/SCORING/COMPONENTS/aromaticRingStacking.h>
 #include <BALL/SCORING/COMPONENTS/polarity.h>
diff --git a/source/STRUCTURE/assignBondOrderProcessor.C b/source/STRUCTURE/assignBondOrderProcessor.C
index e73a530..9756a71 100644
--- a/source/STRUCTURE/assignBondOrderProcessor.C
+++ b/source/STRUCTURE/assignBondOrderProcessor.C
@@ -8,6 +8,7 @@
 // BALL includes
 #include <BALL/kernel.h>
 #include <BALL/STRUCTURE/assignBondOrderProcessor.h>
+#include <BALL/STRUCTURE/connectedComponentsProcessor.h>
 #include <BALL/SYSTEM/timer.h>
 #include <BALL/KERNEL/PTE.h>
 #include <BALL/KERNEL/forEach.h>
@@ -364,6 +365,16 @@ cout << endl;
 		if (ac.countBonds() == 0)
 			return Processor::CONTINUE;
 
+		// check if single connected component, otherwise treedecomposition crashes
+		ConnectedComponentsProcessor ccp;
+		ac.apply(ccp);
+		if (ccp.getNumberOfConnectedComponents() > 1)
+		{
+			Log.error() << "Error: Given AtomContainer contains more than one connected component, but only one is expected! Abort. " <<
+			               __FILE__ << " " << __LINE__<< std::endl;
+			return Processor::ABORT;
+		}
+
 		// Is the processor in a valid state?
 		if (readOptions_() && valid_)
 		{
diff --git a/source/STRUCTURE/binaryFingerprintMethods.C b/source/STRUCTURE/binaryFingerprintMethods.C
index 48fc769..8fe6728 100644
--- a/source/STRUCTURE/binaryFingerprintMethods.C
+++ b/source/STRUCTURE/binaryFingerprintMethods.C
@@ -10,7 +10,7 @@
 #include <BALL/SYSTEM/timer.h>
 
 #include <boost/foreach.hpp>
-
+#include <boost/unordered_map.hpp>
 
 using namespace std;
 using namespace boost;
@@ -1334,6 +1334,7 @@ void BinaryFingerprintMethods::pairwiseSimilaritiesThread(const unsigned int thr
 	LongSize index;
 	LongSize row_index, col_index;
 	
+	unsigned int count = 0;
 	while (getNextComparisonIndex(index))
 	{
 		// Reset common counts matrix to 0
@@ -1342,6 +1343,19 @@ void BinaryFingerprintMethods::pairwiseSimilaritiesThread(const unsigned int thr
 			memset(cc_matrix[m], '\0', cc_matrix_size_);
 		}
 		
+		if (thread_id == 0)
+		{
+			if (count == 100 && verbosity_ > 0)
+			{
+				double perc = 100.0 * double((n_comparisons_backup_ - index) /  double(n_comparisons_backup_));
+				
+				cerr << "\r++ Status: " << perc << " %          ";
+				count = 0;
+			}
+			
+			++count;
+		}
+		
 		// Calculate indices of next InvertedIndex pair to compare
 		arrayToUpperTriangluarMatrix(row_index, col_index, index);
 		
@@ -1351,6 +1365,11 @@ void BinaryFingerprintMethods::pairwiseSimilaritiesThread(const unsigned int thr
 		// Calculate similarities
 		(this->*pairwiseSimilaritiesBase)(row_index, col_index, t_data);
 	}
+	
+	if (thread_id == 0 && verbosity_ > 0)
+	{
+		cerr << endl;
+	}
 }
 
 
@@ -1387,6 +1406,7 @@ bool BinaryFingerprintMethods::pairwiseSimilarities(const vector<unsigned int>&
 	
 	LongSize n_iids = lib_iindices_.size();
 	n_comparisons_ = (n_iids * n_iids + n_iids) / 2;
+	n_comparisons_backup_ = n_comparisons_;
 	
 	unsigned int n_threads = n_threads_;
 	if (n_comparisons_ < n_threads_)
@@ -1584,13 +1604,13 @@ bool BinaryFingerprintMethods::connectedComponents(const vector<unsigned int>& s
 	{
 		
 		// STEP 1: Get connected components and member indices
-		unordered_map<unsigned int, unordered_map<unsigned int, unsigned int> > ccs_tmp;
-		unordered_map<unsigned int, unordered_map<unsigned int, unsigned int> >::iterator ccs_iter;
+		boost::unordered_map<unsigned int, boost::unordered_map<unsigned int, unsigned int> > ccs_tmp;
+		boost::unordered_map<unsigned int, boost::unordered_map<unsigned int, unsigned int> >::iterator ccs_iter;
 		BOOST_FOREACH(Vertex current_vertex, vertices(sim_graph))
 		{
 			if (ccs_tmp.find(ds->find_set(current_vertex)) == ccs_tmp.end())
 			{
-				ccs_tmp[ds->find_set(current_vertex)] = unordered_map<unsigned int, unsigned int>();
+				ccs_tmp[ds->find_set(current_vertex)] = boost::unordered_map<unsigned int, unsigned int>();
 			}
 			
 // 			ccs_tmp[ds->find_set(current_vertex)][current_vertex] = ccs_tmp[ds->find_set(current_vertex)].size();
@@ -1608,7 +1628,7 @@ bool BinaryFingerprintMethods::connectedComponents(const vector<unsigned int>& s
 		}
 		
 		// STEP 3: Write information in return data structures
-		unordered_map<unsigned int, unsigned int>::iterator cc_iter;
+		boost::unordered_map<unsigned int, unsigned int>::iterator cc_iter;
 		for (size_iter=cc_sizes.begin(); size_iter!=cc_sizes.end(); ++size_iter)
 		{
 			ccs.push_back(vector<unsigned int>(size_iter->first, 0));
@@ -1697,7 +1717,7 @@ void BinaryFingerprintMethods::cutoffSearchThread(const unsigned int thread_id)
 	unsigned short** cc_matrix = t_data->cc_matrix;
 	File outfile(t_data->outfile_name, File::MODE_OUT);
 	
-	for (unsigned int i=t_data->first; i!=t_data->last; ++i)
+	for (unsigned int i=t_data->first; i<=t_data->last; ++i)
 	{
 		for (unsigned int j=0; j!=query_iindices_.size(); ++j)
 		{
@@ -1810,18 +1830,27 @@ bool BinaryFingerprintMethods::cutoffSearch(const float cutoff, const String& ou
 	Timer* timer = new Timer();
 	timer->start();
 	
+	unsigned int current_index = 0;
 	for (unsigned int i=0; i!=n_threads_; ++i)
 	{
+		// Set lib_iindices start index for thread i
+		thread_data_[i].first = current_index;
+
+		// Increment index for lib_iindides depending on thread number
 		if (i < to_increment)
 		{
-			thread_data_[i].first = i * (batch_size + 1);
-			thread_data_[i].last = thread_data_[i].first + (batch_size + 1);
+			current_index += batch_size;
 		}
 		else
 		{
-			thread_data_[i].first = i * (batch_size);
-			thread_data_[i].last = thread_data_[i].first + (batch_size);
+			current_index += batch_size - 1;
 		}
+
+		// Set lib_iindices end index for thread i
+		thread_data_[i].last = current_index;
+
+		// Increment index for lib_iindides
+		++current_index;
 		
 		threads_[i] = thread(boost::bind(&BinaryFingerprintMethods::cutoffSearchThread, this, i));
 	}
@@ -1985,7 +2014,7 @@ bool BinaryFingerprintMethods::averageLinkageClustering(const vector<unsigned in
 		// ----------------------------------------------------------------------
 		if (verbosity_ >= 10)
 		{
-			Log << "++ RNN parallel method stored data" << endl;
+			Log << "++ RNN parallel method (stored data)" << endl;
 		}
 		
 		for (unsigned int i=0; i!=n_molecules; ++i)
@@ -2036,7 +2065,7 @@ bool BinaryFingerprintMethods::averageLinkageClustering(const vector<unsigned in
 		// ----------------------------------------------------------------------
 		if (verbosity_ >= 10)
 		{
-			Log << "++ NNChain method(stored matrix" << endl;
+			Log << "++ NNChain method (stored matrix)" << endl;
 		}
 		
 		// NN Chain from scratch. First calculate pairwise similarity matrix.
@@ -2884,171 +2913,90 @@ void BinaryFingerprintMethods::averageLinkageParallel(Cluster*& root)
 
 void BinaryFingerprintMethods::NNChainCore(Cluster*& root)
 {
-	if (threads_ == NULL)
+	if (verbosity_ >= 10)
 	{
-		createThreadData(blocksize_, 0, 0);
+		Log << "++ Starting NNChain calculations" << endl;
 	}
 	
-	if (vec_actives_.size() > 2)
+	if (threads_ == NULL)
 	{
-		initNNChain();
-		nextNearestNeighbour();
-		moveNearestNeighbour();
+		createThreadData(blocksize_, 0, 0);
 	}
-	else
+	
+	if (vec_actives_.size() == 0)
 	{
-		if (vec_actives_.size() == 2)
-		{
-			initNNChain();
-			nextNearestNeighbour();
-			moveNearestNeighbour();
-			finalizeNNChain(root);
-		}
-		else
-		{
-			if (vec_actives_.size() == 1)
-			{
-				root = *vec_actives_.begin();
-				vec_actives_.clear();
-			}
-			else
-			{
-				root = NULL;
-			}
-		}
-		
+		root = NULL;
 		return;
 	}
 	
+	// Indicates if rnn found
+	bool rnn;
 	
-	// ------------------------------
-	// NNChain size         == 2
-	// Active Clusters size >= 1
-	// ------------------------------
-	while (vec_actives_.size())
+	// Empty NNChain at the beginning
+	nn_chain_size_ = 0;
+	
+	// Counting available clusters
+	unsigned int n_clusters = vec_actives_.size();
+	
+	// While there are clusters to merge
+	while (n_clusters > 1)
 	{
-		// ------------------------------
-		// NNChain size         >= 2
-		// Active Clusters size >= 1
-		// ------------------------------
-		
-		// Find next nearest neighbour
-		nextNearestNeighbour();
-		
-		if (fabs(current_nn_sim_ - nn_chain_tip_->predecessor_sim) <= precision_)
+		// Check if NNChain is empty
+		if (nn_chain_size_ == 0)
 		{
-			// NNChain tip and its predecessor are not reciprocal nearest neighbours
-			
-			// ------------------------------
-			// NNChain size         >= 2
-			// Active Clusters size >= 1
-			// ------------------------------
-			
-			moveNearestNeighbour();
+			// Yes - so initialize
+			nn_chain_tip_ = *vec_actives_.rbegin();
+			nn_chain_tip_->predecessor = NULL;
+			nn_chain_tip_->predecessor_sim = -1.0;
+			nn_chain_tip_->predecessor_sim_sum = -1.0;
 			
-			// ------------------------------
-			// NNChain size         >= 3
-			// Active Clusters size >= 0
-			// ------------------------------
+			nn_chain_size_ = 1;
+			vec_actives_.pop_back();
 		}
-		else
+		
+		rnn = false;
+		
+		while (!rnn)
 		{
-			if (current_nn_sim_ < nn_chain_tip_->predecessor_sim)
+			// Find nearest neighbour to nn_chain_tip_
+			nextNearestNeighbour();
+			
+			// Check if nn_chain_tip_ is more similar to nearest neighbour than to its predecessor
+			if (fabs(current_nn_sim_ - nn_chain_tip_->predecessor_sim) <= precision_)
 			{
-				// NNChain tip and its predecessor are reciprocal nearest neighbours
-				
-				// ------------------------------
-				// NNChain size         >= 2
-				// Active Clusters size >= 1
-				// ------------------------------
-				
-				// Merge RNN pair
-				mergeClusters(nn_chain_tip_, nn_chain_tip_->predecessor, nn_chain_tip_->predecessor_sim_sum);
-				
-				// ------------------------------
-				// NNChain size         >= 0
-				// Active Clusters size >= 2
-				// ------------------------------
-				
-				if (nn_chain_size_ < 2)
-				{
-					if (nn_chain_size_ == 1)
-					{
-						// ------------------------------
-						// NNChain size         == 1
-						// Active Clusters size >= 2
-						// ------------------------------
-						
-						nextNearestNeighbour();
-						moveNearestNeighbour();
-						
-						// ------------------------------
-						// NNChain size         == 2
-						// Active Clusters size >= 1
-						// ------------------------------
-					}
-					else
-					{
-						// ------------------------------
-						// NNChain size         == 0
-						// Active Clusters size >= 2
-						// ------------------------------
-						
-						initNNChain();
-						
-						// ------------------------------
-						// NNChain size         == 1
-						// Active Clusters size >= 1
-						// ------------------------------
-						
-						nextNearestNeighbour();
-						moveNearestNeighbour();
-						
-						// ------------------------------
-						// NNChain size         == 2
-						// Active Clusters size >= 0
-						// ------------------------------
-					}
-				}
-				
-				// ------------------------------
-				// NNChain size         >= 2
-				// Active Clusters size >= 0
-				// ------------------------------
+				// Equally similar - so append to NNChain
+				moveNearestNeighbour();
 			}
 			else
 			{
-				// NNChain tip and its predecessor are not reciprocal nearest neighbours
-				
-				// ------------------------------
-				// NNChain size         >= 2
-				// Active Clusters size >= 1
-				// ------------------------------
-				
-				moveNearestNeighbour();
-				
-				// ------------------------------
-				// NNChain size         >= 3
-				// Active Clusters size >= 0
-				// ------------------------------
+				if (current_nn_sim_ < nn_chain_tip_->predecessor_sim)
+				{
+					// Less similar - thus RNN pair at the head of the NNChain
+					rnn = true;
+				}
+				else
+				{
+					// More similar - so append to NNChain
+					moveNearestNeighbour();
+				}
 			}
 		}
 		
-		// ------------------------------
-		// NNChain size         >= 2
-		// Active Clusters size >= 0
-		// ------------------------------
+		// Merge RNN pair heading the NNChain
+		mergeClusters(nn_chain_tip_, nn_chain_tip_->predecessor, nn_chain_tip_->predecessor_sim_sum);
+		
+		// One cluster less to merge ...
+		n_clusters -= 1;
 	}
 	
-	// ------------------------------
-	// NNChain size         >= 2
-	// Active Clusters size == 0
-	// ------------------------------
-	
-	// Finalize NNChain
-	finalizeNNChain(root);
+	// Done. 
+	// Root cluster is the last remaining cluster
+	root = vec_actives_[0];
+	vec_actives_.clear();
 	
 	destroyThreadData();
+	
+	return;
 }
 
 
@@ -3249,17 +3197,6 @@ void BinaryFingerprintMethods::enumerateClusterMembers(Cluster* cl, unsigned int
 }
 
 
-void BinaryFingerprintMethods::initNNChain()
-{
-	nn_chain_tip_ = *vec_actives_.rbegin();
-	nn_chain_tip_->predecessor = NULL;
-	nn_chain_tip_->predecessor_sim_sum = -1.0;
-	
-	nn_chain_size_ = 1;
-	vec_actives_.pop_back();
-}
-
-
 void BinaryFingerprintMethods::nextNearestNeighbour()
 {
 	current_nn_sim_ = -1.0;
@@ -3322,56 +3259,11 @@ void BinaryFingerprintMethods::moveNearestNeighbour()
 }
 
 
-void BinaryFingerprintMethods::finalizeNNChain(Cluster*& root)
-{
-	// ------------------------------
-	// NNChain size         >= 2
-	// Active Clusters size == 0
-	// ------------------------------
-	nextNearestNeighbour();
-	mergeClusters(nn_chain_tip_, nn_chain_tip_->predecessor, nn_chain_tip_->predecessor_sim_sum);
-	
-	// ------------------------------
-	// NNChain size         >= 0
-	// Active Clusters size == 1
-	// ------------------------------
-	
-	while (nn_chain_size_!=0)
-	{
-		// ------------------------------
-		// NNChain size         >= 1
-		// Active Clusters size == 1
-		// ------------------------------
-		nextNearestNeighbour();
-		moveNearestNeighbour();
-		
-		// ------------------------------
-		// NNChain size         >= 2
-		// Active Clusters size == 0
-		// ------------------------------
-		mergeClusters(nn_chain_tip_, nn_chain_tip_->predecessor, nn_chain_tip_->predecessor_sim_sum);
-		
-		// ------------------------------
-		// NNChain size         >= 0
-		// Active Clusters size == 1
-		// ------------------------------
-	}
-	
-	// ------------------------------
-	// NNChain size         == 0
-	// Active Clusters size == 1
-	// ------------------------------
-	
-	root = *vec_actives_.begin();
-	vec_actives_.clear();
-}
-
-
 void BinaryFingerprintMethods::switchStorageMethod()
 {
 	if (verbosity_ >= 10)
 	{
-		Log << "++ switch to stored matrix method" << endl;
+		Log << "++ Switch to stored matrix method" << endl;
 	}
 	
 	// Create cluster indices to address the similarity matrix
diff --git a/source/STRUCTURE/logP.C b/source/STRUCTURE/logP.C
index bff838c..cf36cef 100644
--- a/source/STRUCTURE/logP.C
+++ b/source/STRUCTURE/logP.C
@@ -1,5 +1,7 @@
 #include <BALL/STRUCTURE/logP.h>
 
+using namespace std;
+
 namespace BALL
 {
 	LogP::LogP()
diff --git a/source/STRUCTURE/numericalSAS.C b/source/STRUCTURE/numericalSAS.C
index 11ee1a7..a729120 100644
--- a/source/STRUCTURE/numericalSAS.C
+++ b/source/STRUCTURE/numericalSAS.C
@@ -109,9 +109,8 @@ namespace BALL
 		const_cast<AtomContainer&>(fragment).apply(bpp);
 
 		// and a hash grid containing all atoms
-		HashGrid3<Atom const*> atom_grid(bpp.getLower()-Vector3(max_radius+epsilon), 
-				bpp.getUpper()-bpp.getLower()+Vector3(max_radius+epsilon), 
-				2*max_radius+epsilon);
+		Vector3 grid_origin = bpp.getLower() - Vector3(max_radius + epsilon);
+		HashGrid3<Atom const*> atom_grid(grid_origin, bpp.getUpper() - grid_origin + Vector3(max_radius + epsilon), 2 * max_radius + epsilon);
 
 		for (AtomConstIterator at_it = fragment.beginAtom(); +at_it; ++at_it)
 		{
diff --git a/source/STRUCTURE/residueChecker.C b/source/STRUCTURE/residueChecker.C
index 8b2862e..b629c95 100644
--- a/source/STRUCTURE/residueChecker.C
+++ b/source/STRUCTURE/residueChecker.C
@@ -55,12 +55,12 @@ namespace BALL
 		return tests_.getBit((Position)t);
 	}
 
-	void ResidueChecker::enable(ResidueChecker::TestType t) 
+	void ResidueChecker::enable(ResidueChecker::TestType t, bool enable)
 	{
-		tests_.setBit((Position)t);
+		tests_.setBit((Position)t, enable);
 	}
-	
-	void ResidueChecker::disable(ResidueChecker::TestType t) 
+
+	void ResidueChecker::disable(ResidueChecker::TestType t)
 	{
 		tests_.setBit((Position)t, false);
 	}
diff --git a/source/STRUCTURE/smartsParserLexer.l b/source/STRUCTURE/smartsParserLexer.l
index d6bf9e8..8f6339a 100755
--- a/source/STRUCTURE/smartsParserLexer.l
+++ b/source/STRUCTURE/smartsParserLexer.l
@@ -145,5 +145,7 @@ void SmartsParser_delBuffer()
 
 void SmartsParser_destroy()
 {
+#ifdef BALL_HAS_YYLEX_DESTROY
 	SmartsParserlex_destroy();
+#endif
 }
diff --git a/source/STRUCTURE/smilesParserLexer.l b/source/STRUCTURE/smilesParserLexer.l
index 7aef708..d650908 100644
--- a/source/STRUCTURE/smilesParserLexer.l
+++ b/source/STRUCTURE/smilesParserLexer.l
@@ -96,5 +96,7 @@ void SmilesParser_delBuffer()
 
 void SmilesParser_destroy()
 {
+#ifdef BALL_HAS_YYLEX_DESTROY
 	SmilesParserlex_destroy();
+#endif
 }
diff --git a/source/SYSTEM/MPISupport.C b/source/SYSTEM/MPISupport.C
index 9dc79df..4d3ea38 100644
--- a/source/SYSTEM/MPISupport.C
+++ b/source/SYSTEM/MPISupport.C
@@ -153,7 +153,7 @@ namespace BALL
 	void MPISupport::sendSystem(const System& system, bool broadcast, int receiver)
 	{
 		// First, convert the System into a string using the XDRManager
-		ostringstream persistent_system;
+		std::ostringstream persistent_system;
 		XDRPersistenceManager pm(persistent_system);
 		pm << system;
 
@@ -163,7 +163,7 @@ namespace BALL
 
 	System* MPISupport::receiveSystem(bool broadcast, int source)
 	{
-		istringstream is;
+		std::istringstream is;
 		receivePersistenceStream_(is, TAG_SYSTEM, broadcast, source);
 		XDRPersistenceManager pm(is);
 
@@ -177,7 +177,7 @@ namespace BALL
 	void MPISupport::sendOptions(const Options& options, bool broadcast, int receiver)
 	{
 		// First, convert the Options into a string using the XDRManager
-		ostringstream persistent_options;
+		std::ostringstream persistent_options;
 		//XDRPersistenceManager pm(persistent_options);
 		TextPersistenceManager pm(persistent_options);
 		options.write(pm);
@@ -188,7 +188,7 @@ namespace BALL
 
 	Options* MPISupport::receiveOptions(bool broadcast, int source)
 	{
-		istringstream is;
+		std::istringstream is;
 		receivePersistenceStream_(is, TAG_OPTIONS, broadcast, source);
 		//XDRPersistenceManager pm(is);
 		TextPersistenceManager pm(is);
@@ -300,7 +300,7 @@ namespace BALL
 	}
 
 	
-	void MPISupport::sendPersistenceStream_(const ostringstream& stream, int tag, bool broadcast, int receiver)
+	void MPISupport::sendPersistenceStream_(const std::ostringstream& stream, int tag, bool broadcast, int receiver)
 	{
 		// should we broadcast or send directed?
 		if (broadcast)
@@ -375,8 +375,8 @@ namespace BALL
 
 		// Prepare the Text - Stuff...
 		// TODO: This should work _much_ more efficiently somehow...
-		ostringstream received_stream;
-		std::copy(streambuf.begin(), streambuf.end(), ostream_iterator<char>(received_stream));
+		std::ostringstream received_stream;
+		std::copy(streambuf.begin(), streambuf.end(), std::ostream_iterator<char>(received_stream));
 		in.str(received_stream.str());
 	}
 
diff --git a/source/SYSTEM/fileSystem.C b/source/SYSTEM/fileSystem.C
index c14d6b1..f6f6216 100644
--- a/source/SYSTEM/fileSystem.C
+++ b/source/SYSTEM/fileSystem.C
@@ -214,6 +214,19 @@ namespace BALL
 		}
 	}
 
+	String FileSystem::fileExtension(const String& filename)
+	{
+		String base_name = baseName(filename);
+		Position idx = (Position)base_name.find_last_of(".");
+
+		if (idx != String::EndPos && (idx + 1) < base_name.size())
+		{
+			return base_name(idx + 1);
+		}
+
+		return "";
+	}
+
 	String FileSystem::path(const String& filename)
 	{
 		Position idx = (Position)filename.find_last_of(PATH_SEPARATOR);
diff --git a/source/TEST/CMakeLists.txt b/source/TEST/CMakeLists.txt
index d95adda..b3b0f18 100644
--- a/source/TEST/CMakeLists.txt
+++ b/source/TEST/CMakeLists.txt
@@ -51,12 +51,7 @@ ENDIF ()
 SET(ALL_TESTS "")
 FOREACH(group ${BALL_TESTS})
 	FOREACH(test ${${group}})
-		IF (WIN32)
-			# Workaround for the stupid MSVC
-			ADD_EXECUTABLE(${test} ${test}.C stringStub.C)
-		ELSE()
-			ADD_EXECUTABLE(${test} ${test}.C)
-		ENDIF()
+		ADD_EXECUTABLE(${test} ${test}.C)
 		TARGET_LINK_LIBRARIES(${test} BALL ${BALLTEST_SUPPORT_LIBRARIES})
 		SET_PROPERTY(TARGET ${test} PROPERTY FOLDER ${group})
 		IF (NOT BALL_TEST_VERBOSE)
@@ -79,12 +74,7 @@ SET_TESTS_PROPERTIES (
 
 IF (BALL_HAS_VIEW)
 	FOREACH(test ${VIEW_TESTS})
-		IF (WIN32)
-			# Workaround for the stupid MSVC
-			ADD_EXECUTABLE(${test} ${test}.C stringStub.C)
-		ELSE()
-			ADD_EXECUTABLE(${test} ${test}.C)
-		ENDIF()
+		ADD_EXECUTABLE(${test} ${test}.C)
 		TARGET_LINK_LIBRARIES(${test} BALL VIEW ${BALLTEST_SUPPORT_LIBRARIES})
 		SET_PROPERTY(TARGET ${test} PROPERTY FOLDER BALL_VIEW_TESTS)
 		IF (NOT BALL_TEST_VERBOSE)
diff --git a/source/TEST/FileSystem_test.C b/source/TEST/FileSystem_test.C
index bbfb7e9..646e64e 100644
--- a/source/TEST/FileSystem_test.C
+++ b/source/TEST/FileSystem_test.C
@@ -68,6 +68,15 @@ CHECK(baseName(const String& filename))
 	TEST_EQUAL(FileSystem::baseName("test"), "test")
 RESULT
 
+CHECK(fileExtension(const String& filename))
+	String filename = "test" + PS + "basename.sfx";
+	TEST_EQUAL(FileSystem::fileExtension(filename), "sfx")
+	TEST_EQUAL(FileSystem::fileExtension(PS), "")
+	TEST_EQUAL(FileSystem::fileExtension(PS + "."), "")
+	TEST_EQUAL(FileSystem::fileExtension(""), "")
+	TEST_EQUAL(FileSystem::fileExtension("test"), "")
+RESULT
+
 CHECK(path(const String& filename))
 	String filename = PS + "test" + PS + PS + "TEST" + PS + "basename.sfx";
 	TEST_EQUAL(FileSystem::path(filename), PS + "test" + PS + PS + "TEST" + PS)
diff --git a/source/TEST/HMOFile_test.C b/source/TEST/HMOFile_test.C
new file mode 100644
index 0000000..037502e
--- /dev/null
+++ b/source/TEST/HMOFile_test.C
@@ -0,0 +1,201 @@
+// -*- Mode: C++; tab-width: 2; -*-
+// vi: set ts=2:
+//
+
+#include <BALL/CONCEPT/classTest.h>
+#include <BALLTestConfig.h>
+
+///////////////////////////
+
+#include <BALL/FORMAT/HMOFile.h>
+#include <BALL/KERNEL/atom.h>
+#include <BALL/KERNEL/molecule.h>
+
+///////////////////////////
+
+START_TEST(HMOFile)
+
+/////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////
+
+using namespace BALL;
+
+HMOFile* cf = 0;
+CHECK(HMOFile())
+	cf = new HMOFile;
+	TEST_NOT_EQUAL(cf, 0)
+RESULT
+
+
+CHECK(~HMOFile())
+	delete cf;
+RESULT
+
+
+CHECK(HMOFile(const String& filename, File::OpenMode open_mode = std::ios::in))
+	HMOFile f(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+	TEST_EXCEPTION(Exception::FileNotFound, HMOFile f2("invalid.hmo"))
+RESULT
+
+CHECK(bool open(const String& name, File::OpenMode open_mode))
+	HMOFile f2;
+	bool f2_result = f2.open(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+	TEST_EQUAL(f2_result, true)
+
+	HMOFile f3;
+	TEST_EXCEPTION(Exception::FileNotFound, f3.open(BALL_TEST_DATA_PATH(file_does_not.exist), std::ios::in));
+RESULT
+
+CHECK(clear())
+	HMOFile f(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+	Surface S;
+	f.read(S);
+	f.clear();
+
+	TEST_EQUAL(f.getName(), "")
+	TEST_EQUAL(f.getCharges().size(), 0)
+	TEST_EQUAL(f.getComments().size(), 0)
+RESULT
+
+CHECK(bool operator == (const HMOFile& file))
+	HMOFile f(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+	HMOFile f2(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+	HMOFile f3;
+
+	TEST_EQUAL(f == f, true)
+	TEST_EQUAL(f == f2, true)
+	TEST_EQUAL(f == f3, false)
+RESULT
+
+HMOFile f(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+CHECK(virtual bool read(Surface& surface))
+	Surface S;
+
+	bool result = f.read(S);
+	TEST_EQUAL(result, true)
+
+	TEST_EQUAL(f.getComments().size(), 1)
+	TEST_EQUAL(f.getComments()[0], "# HYPERMESH for the solvent excluded surface of N.hin; Generated by ./createBEMMesh")
+
+	TEST_EQUAL(S.vertex.size(), 642)
+	TEST_REAL_EQUAL(S.vertex[3].x, -14.4721)
+	TEST_REAL_EQUAL(S.vertex[3].y,  10.5146)
+	TEST_REAL_EQUAL(S.vertex[3].z,  8.94427)
+
+	TEST_EQUAL(S.triangle.size(), 1280)
+	TEST_EQUAL(S.triangle[5].v1, 418)
+	TEST_EQUAL(S.triangle[5].v2, 419)
+	TEST_EQUAL(S.triangle[5].v3, 420)
+
+	TEST_EQUAL(f.getCharges().size(), 1)
+	HMOFile::HMOCharge& c = f.getCharges()[0];
+
+	TEST_REAL_EQUAL(c.value, 1)
+	TEST_REAL_EQUAL(c.position.x, 0)
+	TEST_REAL_EQUAL(c.position.y, 0)
+	TEST_REAL_EQUAL(c.position.z, 0)
+
+	Surface S2;
+	HMOFile f_no_charge(BALL_TEST_DATA_PATH(HMOFile_test_no_charge.hmo), std::ios::in);
+	result = f_no_charge.read(S2);
+	TEST_EQUAL(result, true)
+
+	TEST_EQUAL(f_no_charge.getComments().size(), 1)
+	TEST_EQUAL(f_no_charge.getComments()[0], "# HYPERMESH file written by BALL::HMOFile")
+
+	TEST_EQUAL(S2.vertex.size(), 642)
+	TEST_REAL_EQUAL(S2.vertex[3].x, -14.4721)
+	TEST_REAL_EQUAL(S2.vertex[3].y,  10.5146)
+	TEST_REAL_EQUAL(S2.vertex[3].z,  8.94427)
+
+	TEST_EQUAL(S2.triangle.size(), 1280)
+	TEST_EQUAL(S2.triangle[5].v1, 418)
+	TEST_EQUAL(S2.triangle[5].v2, 419)
+	TEST_EQUAL(S2.triangle[5].v3, 420)
+
+	TEST_EQUAL(f_no_charge.hasCharges(), false)
+	TEST_EQUAL(f_no_charge.getCharges().size(), 0)
+
+RESULT
+
+f.clear();
+f.open(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+CHECK(bool hasCharges() const)
+	TEST_EQUAL(f.hasCharges(), false)
+	Surface S;
+	f.read(S);
+	TEST_EQUAL(f.hasCharges(), true)
+RESULT
+
+CHECK(std::vector<HMOFile::HMOCharge>& getCharges())
+	std::vector<HMOFile::HMOCharge>& charges = f.getCharges();
+	TEST_EQUAL(charges.size(), 1)
+RESULT
+
+CHECK(std::vector<HMOFile::HMOCharge> const& getCharges() const)
+	HMOFile const& f_const = f;
+	std::vector<HMOFile::HMOCharge> const& charges = f_const.getCharges();
+	TEST_EQUAL(charges.size(), 1)
+RESULT
+
+f.clear();
+f.open(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+CHECK(bool hasComments() const)
+	TEST_EQUAL(f.hasComments(), false)
+	Surface S;
+	f.read(S);
+	TEST_EQUAL(f.hasComments(), true)
+RESULT
+
+CHECK(std::vector<String>& getComments())
+	std::vector<String>& comments = f.getComments();
+	TEST_EQUAL(comments.size(), 1)
+RESULT
+
+CHECK(std::vector<String> const& getComments() const)
+	HMOFile const& f_const = f;
+	std::vector<String> const& comments = f_const.getComments();
+	TEST_EQUAL(f.getComments().size(), 1)
+RESULT
+
+CHECK(virtual bool write(Surface const& surface))
+	HMOFile f_in(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+	Surface S;
+	f_in.read(S);
+
+	String filename;
+	NEW_TMP_FILE(filename);
+	HMOFile f_out(filename, std::ios::out);
+
+	f_out.write(S);
+	f_out.close();
+
+	TEST_FILE_REGEXP(filename.c_str(), BALL_TEST_DATA_PATH(HMOFile_test_no_charge.hmo))
+RESULT
+
+CHECK(virtual bool write(Surface const& surface, AtomContainer const& ac))
+	HMOFile f_in(BALL_TEST_DATA_PATH(HMOFile_test.hmo), std::ios::in);
+	Surface S;
+	f_in.read(S);
+
+	Molecule m;
+
+	Atom a;
+	a.setPosition(Vector3(0,0,0));
+	a.setCharge(1);
+
+	m.insert(a);
+
+	String filename;
+	NEW_TMP_FILE(filename);
+	HMOFile f_out(filename, std::ios::out);
+	f_out.getComments().push_back("# HYPERMESH for the solvent excluded surface of N.hin; Generated by ./createBEMMesh");
+
+	f_out.write(S, m);
+	f_out.close();
+
+	TEST_FILE_REGEXP(filename.c_str(), BALL_TEST_DATA_PATH(HMOFile_test.hmo))
+RESULT
+/////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////
+END_TEST
diff --git a/source/TEST/Makefile.lst b/source/TEST/Makefile.lst
deleted file mode 100644
index 830579e..0000000
--- a/source/TEST/Makefile.lst
+++ /dev/null
@@ -1,291 +0,0 @@
-#
-# $Id: Makefile.lst,v 1.35.4.9 2007/05/14 19:02:39 oliver Exp $
-#
-# Author:
-#  Oliver Kohlbacher
-#
-
-EXECUTABLES_BASIC = \
-$(TEST_PREFIX)ClassTest_test$(EXEEXT)\
-$(TEST_PREFIX)Debug_test$(EXEEXT)\
-$(TEST_PREFIX)RegularExpression_test$(EXEEXT)\
-$(TEST_PREFIX)GlobalTypes_test$(EXEEXT)\
-$(TEST_PREFIX)Limits_test$(EXEEXT)\
-$(TEST_PREFIX)VersionInfo_test$(EXEEXT)\
-$(TEST_PREFIX)RTTI_test$(EXEEXT)
-
-
-EXECUTABLES_MATHS = \
-$(TEST_PREFIX)MathsCommon_test$(EXEEXT)\
-$(TEST_PREFIX)AnalyticalGeometry_test$(EXEEXT)\
-$(TEST_PREFIX)Angle_test$(EXEEXT)\
-$(TEST_PREFIX)Vector2_test$(EXEEXT)\
-$(TEST_PREFIX)Vector3_test$(EXEEXT)\
-$(TEST_PREFIX)Vector4_test$(EXEEXT)\
-$(TEST_PREFIX)Quaternion_test$(EXEEXT)\
-$(TEST_PREFIX)Matrix44_test$(EXEEXT)\
-$(TEST_PREFIX)NumericalIntegrator_test$(EXEEXT)\
-$(TEST_PREFIX)Line3_test$(EXEEXT)\
-$(TEST_PREFIX)Circle3_test$(EXEEXT)\
-$(TEST_PREFIX)SimpleBox3_test$(EXEEXT)\
-$(TEST_PREFIX)Box3_test$(EXEEXT)\
-$(TEST_PREFIX)Plane3_test$(EXEEXT)\
-$(TEST_PREFIX)Sphere3_test$(EXEEXT)\
-$(TEST_PREFIX)Surface_test$(EXEEXT)\
-$(TEST_PREFIX)Function_test$(EXEEXT)\
-$(TEST_PREFIX)PiecewiseFunction_test$(EXEEXT)\
-$(TEST_PREFIX)PiecewisePolynomial_test$(EXEEXT)
-
-EXECUTABLES_SYSTEM = \
-$(TEST_PREFIX)BinaryFileAdaptor_test$(EXEEXT)\
-$(TEST_PREFIX)Directory_test$(EXEEXT)\
-$(TEST_PREFIX)FileSystem_test$(EXEEXT)\
-$(TEST_PREFIX)File_test$(EXEEXT)\
-$(TEST_PREFIX)Path_test$(EXEEXT)\
-$(TEST_PREFIX)PreciseTime_test$(EXEEXT)\
-$(TEST_PREFIX)Sysinfo_test$(EXEEXT)\
-$(TEST_PREFIX)Timer_test$(EXEEXT)\
-$(TEST_PREFIX)TimeStamp_test$(EXEEXT)\
-$(TEST_PREFIX)TransformationManager_test$(EXEEXT)
-
-EXECUTABLES_DATATYPES = \
-$(TEST_PREFIX)Bit_test$(EXEEXT)\
-$(TEST_PREFIX)BitVector_test$(EXEEXT)\
-$(TEST_PREFIX)Contour_test$(EXEEXT)\
-$(TEST_PREFIX)ContourLine_test$(EXEEXT)\
-$(TEST_PREFIX)List_test$(EXEEXT)\
-$(TEST_PREFIX)Hash_test$(EXEEXT)\
-$(TEST_PREFIX)HashMap_test$(EXEEXT)\
-$(TEST_PREFIX)StringHashMap_test$(EXEEXT)\
-$(TEST_PREFIX)HashSet_test$(EXEEXT)\
-$(TEST_PREFIX)HashGrid3_test$(EXEEXT)\
-$(TEST_PREFIX)HashGridBox3_test$(EXEEXT)\
-$(TEST_PREFIX)HashGrid3DataIteratorTraits_test$(EXEEXT)\
-$(TEST_PREFIX)HashGrid3BoxIteratorTraits_test$(EXEEXT)\
-$(TEST_PREFIX)HashGrid3DataItem_test$(EXEEXT)\
-$(TEST_PREFIX)HashGrid3NeighborBoxItem_test$(EXEEXT)\
-$(TEST_PREFIX)Options_test$(EXEEXT)\
-$(TEST_PREFIX)String_test1$(EXEEXT)\
-$(TEST_PREFIX)String_test2$(EXEEXT)\
-$(TEST_PREFIX)String_test3$(EXEEXT)\
-$(TEST_PREFIX)String_test4$(EXEEXT)\
-$(TEST_PREFIX)Substring_test$(EXEEXT)\
-$(TEST_PREFIX)Triple_test$(EXEEXT)\
-$(TEST_PREFIX)Quadruple_test$(EXEEXT)\
-$(TEST_PREFIX)RegularData1D_test$(EXEEXT)\
-$(TEST_PREFIX)RegularData2D_test$(EXEEXT)\
-$(TEST_PREFIX)RegularData3D_test$(EXEEXT)\
-$(TEST_PREFIX)ContourSurface_test$(EXEEXT)
-
-EXECUTABLES_CONCEPTS = \
-$(TEST_PREFIX)LogStream_test$(EXEEXT)\
-$(TEST_PREFIX)AutoDeletable_test$(EXEEXT)\
-$(TEST_PREFIX)Factory_test$(EXEEXT)\
-$(TEST_PREFIX)Object_test$(EXEEXT)\
-$(TEST_PREFIX)PersistentObject_test$(EXEEXT)\
-$(TEST_PREFIX)PersistenceManager_test$(EXEEXT)\
-$(TEST_PREFIX)TextPersistenceManager_test$(EXEEXT)\
-$(TEST_PREFIX)Selectable_test$(EXEEXT)\
-$(TEST_PREFIX)NamedProperty_test$(EXEEXT)\
-$(TEST_PREFIX)PropertyManager_test$(EXEEXT)\
-$(TEST_PREFIX)Composite_test1$(EXEEXT)\
-$(TEST_PREFIX)Composite_test2$(EXEEXT)\
-$(TEST_PREFIX)CompositeCompositeIteratorTraits_test$(EXEEXT)\
-$(TEST_PREFIX)CompositeChildcompositeIteratorTraits_test$(EXEEXT)\
-$(TEST_PREFIX)CompositeAncestorIteratorTraits_test$(EXEEXT)\
-$(TEST_PREFIX)Embeddable_test$(EXEEXT)\
-$(TEST_PREFIX)BaseIterator_test$(EXEEXT)\
-$(TEST_PREFIX)ConstForwardIterator_test$(EXEEXT)\
-$(TEST_PREFIX)ForwardIterator_test$(EXEEXT)\
-$(TEST_PREFIX)ConstBidirectionalIterator_test$(EXEEXT)\
-$(TEST_PREFIX)BidirectionalIterator_test$(EXEEXT)\
-$(TEST_PREFIX)ConstRandomAccessIterator_test$(EXEEXT)\
-$(TEST_PREFIX)RandomAccessIterator_test$(EXEEXT)
-
-EXECUTABLES_KERNEL = \
-$(TEST_PREFIX)PTE_test$(EXEEXT)\
-$(TEST_PREFIX)Atom_test$(EXEEXT)\
-$(TEST_PREFIX)AtomStaticAtomAttributes_test$(EXEEXT)\
-$(TEST_PREFIX)AtomAttributeVector_test$(EXEEXT)\
-$(TEST_PREFIX)Bond_test$(EXEEXT)\
-$(TEST_PREFIX)AtomContainer_test$(EXEEXT)\
-$(TEST_PREFIX)Fragment_test$(EXEEXT)\
-$(TEST_PREFIX)Chain_test$(EXEEXT)\
-$(TEST_PREFIX)Molecule_test$(EXEEXT)\
-$(TEST_PREFIX)SecondaryStructure_test$(EXEEXT)\
-$(TEST_PREFIX)System_test$(EXEEXT)\
-$(TEST_PREFIX)Protein_test$(EXEEXT)\
-$(TEST_PREFIX)PDBAtom_test$(EXEEXT)\
-$(TEST_PREFIX)NucleicAcid_test$(EXEEXT)\
-$(TEST_PREFIX)Nucleotide_test$(EXEEXT)\
-$(TEST_PREFIX)Residue_test$(EXEEXT)\
-$(TEST_PREFIX)Expression_test$(EXEEXT)\
-$(TEST_PREFIX)ExpressionParser_test$(EXEEXT)\
-$(TEST_PREFIX)ExpressionPredicate_test$(EXEEXT)\
-$(TEST_PREFIX)ExpressionTree_test$(EXEEXT)\
-$(TEST_PREFIX)KernelPredicate_test$(EXEEXT)\
-$(TEST_PREFIX)Selector_test$(EXEEXT)\
-$(TEST_PREFIX)RuleEvaluator_test$(EXEEXT)\
-$(TEST_PREFIX)StandardPredicates_test$(EXEEXT)\
-$(TEST_PREFIX)DefaultProcessors_test$(EXEEXT)\
-$(TEST_PREFIX)FragmentDB_test$(EXEEXT)\
-$(TEST_PREFIX)NormalizeNamesProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)ForEach_test$(EXEEXT)\
-$(TEST_PREFIX)GlobalKernel_test$(EXEEXT)\
-$(TEST_PREFIX)CompositeIteratorTraits_test$(EXEEXT)\
-$(TEST_PREFIX)AtomIterator_test$(EXEEXT)\
-$(TEST_PREFIX)AtomBondIteratorTraits_test$(EXEEXT)\
-$(TEST_PREFIX)Extractors_test$(EXEEXT)
-
-EXECUTABLES_MOLMEC = \
-$(TEST_PREFIX)Gradient_test$(EXEEXT)\
-$(TEST_PREFIX)AtomVector_test$(EXEEXT)\
-$(TEST_PREFIX)MolmecSupport_test$(EXEEXT)\
-$(TEST_PREFIX)SnapShot_test$(EXEEXT)\
-$(TEST_PREFIX)SnapShotManager_test$(EXEEXT)\
-$(TEST_PREFIX)ForceField_test$(EXEEXT)\
-$(TEST_PREFIX)AmberFF_test$(EXEEXT)\
-$(TEST_PREFIX)MMFF94_test$(EXEEXT)\
-$(TEST_PREFIX)CharmmFF_test$(EXEEXT)\
-$(TEST_PREFIX)EnergyMinimizer_test$(EXEEXT)\
-$(TEST_PREFIX)LineSearch_test$(EXEEXT)\
-$(TEST_PREFIX)SteepestDescentMinimizer_test$(EXEEXT)\
-$(TEST_PREFIX)ConjugateGradientMinimizer_test$(EXEEXT)\
-$(TEST_PREFIX)StrangLBFGSMinimizer_test$(EXEEXT)\
-$(TEST_PREFIX)ShiftedLVMMMinimizer_test$(EXEEXT)\
-$(TEST_PREFIX)AtomTypes_test$(EXEEXT)
-
-EXECUTABLES_NMR = \
-$(TEST_PREFIX)AssignShiftProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)RandomCoilShiftProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)AnisotropyShiftProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)ClearShiftProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)CreateSpectrumProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)EFShiftProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)HaighMallionShiftProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)JohnsonBoveyShiftProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)ShiftModel_test$(EXEEXT)\
-$(TEST_PREFIX)ShiftModule_test$(EXEEXT)\
-$(TEST_PREFIX)Spectrum_test$(EXEEXT)\
-$(TEST_PREFIX)Peak_test$(EXEEXT)\
-$(TEST_PREFIX)PeakList_test$(EXEEXT)
-
-EXECUTABLES_FORMATS = \
-$(TEST_PREFIX)LineBasedFile_test$(EXEEXT)\
-$(TEST_PREFIX)BinaryFileAdaptor_test$(EXEEXT)\
-$(TEST_PREFIX)Bruker1DFile_test$(EXEEXT)\
-$(TEST_PREFIX)Bruker2DFile_test$(EXEEXT)\
-$(TEST_PREFIX)INIFile_test$(EXEEXT)\
-$(TEST_PREFIX)JCAMPFile_test$(EXEEXT)\
-$(TEST_PREFIX)KCFFile_test$(EXEEXT)\
-$(TEST_PREFIX)Parameters_test$(EXEEXT)\
-$(TEST_PREFIX)ParameterSection_test$(EXEEXT)\
-$(TEST_PREFIX)ResourceFile_test$(EXEEXT)\
-$(TEST_PREFIX)GenericMolFile_test$(EXEEXT)\
-$(TEST_PREFIX)HINFile_test$(EXEEXT)\
-$(TEST_PREFIX)MOLFile_test$(EXEEXT)\
-$(TEST_PREFIX)SDFile_test$(EXEEXT)\
-$(TEST_PREFIX)MOL2File_test$(EXEEXT)\
-$(TEST_PREFIX)NMRStarFile_test$(EXEEXT)\
-$(TEST_PREFIX)DCDFile_test$(EXEEXT)\
-$(TEST_PREFIX)PDBRecords_test$(EXEEXT)\
-$(TEST_PREFIX)PDBInfo_test$(EXEEXT)\
-$(TEST_PREFIX)PDBFile_test$(EXEEXT)\
-$(TEST_PREFIX)TrajectoryFile_test$(EXEEXT)\
-$(TEST_PREFIX)XYZFile_test$(EXEEXT)\
-$(TEST_PREFIX)CCP4File_test$(EXEEXT)\
-$(TEST_PREFIX)SCWRLRotamerFile_test$(EXEEXT)
-
-EXECUTABLES_ENERGY = \
-$(TEST_PREFIX)AtomicContactEnergy_test$(EXEEXT)\
-$(TEST_PREFIX)ComposedEnergyProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)EnergyProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)OoiEnergy_test$(EXEEXT)
-
-EXECUTABLES_STRUCTURE = \
-$(TEST_PREFIX)Enumerator_test$(EXEEXT)\
-$(TEST_PREFIX)BindingPocketProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)EnumeratorIndex_test$(EXEEXT)\
-$(TEST_PREFIX)AnalyticalSES_test$(EXEEXT)\
-$(TEST_PREFIX)MolecularGraph_test$(EXEEXT)\
-$(TEST_PREFIX)NumericalSAS_test$(EXEEXT)\
-$(TEST_PREFIX)PeptideBuilder_test$(EXEEXT)\
-$(TEST_PREFIX)PeptideCapProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)Peptides_test$(EXEEXT)\
-$(TEST_PREFIX)RadialDistributionFunction_test$(EXEEXT)\
-$(TEST_PREFIX)RDFIntegrator_test$(EXEEXT)\
-$(TEST_PREFIX)RDFParameter_test$(EXEEXT)\
-$(TEST_PREFIX)RDFSection_test$(EXEEXT)\
-$(TEST_PREFIX)ReconstructFragmentProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)ResidueChecker_test$(EXEEXT)\
-$(TEST_PREFIX)SmilesParser_test$(EXEEXT)\
-$(TEST_PREFIX)AtomBijection_test$(EXEEXT)\
-$(TEST_PREFIX)SmartsParser_test$(EXEEXT)\
-$(TEST_PREFIX)SmartsMatcher_test$(EXEEXT)\
-$(TEST_PREFIX)StructureMapper_test$(EXEEXT)\
-$(TEST_PREFIX)TransformationProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)TranslationProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)SurfaceProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)SecondaryStructureProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)UCK_test$(EXEEXT)\
-$(TEST_PREFIX)BuildBondsProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)DockResult_test$(EXEEXT)\
-$(TEST_PREFIX)MoleculeAssembler_test$(EXEEXT)\
-$(TEST_PREFIX)SDGenerator_test$(EXEEXT)\
-$(TEST_PREFIX)RingAnalyser_test$(EXEEXT)\
-$(TEST_PREFIX)ResidueRotamerSet_test$(EXEEXT)\
-$(TEST_PREFIX)RotamerLibrary_test$(EXEEXT)\
-$(TEST_PREFIX)ConnectedComponentsProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)AssignBondOrderProcessor_test$(EXEEXT)
-
-EXECUTABLES_SOLVATION = \
-$(TEST_PREFIX)PoissonBoltzmann_test$(EXEEXT)\
-$(TEST_PREFIX)SolventDescriptor_test$(EXEEXT)\
-$(TEST_PREFIX)SolventParameter_test$(EXEEXT)\
-$(TEST_PREFIX)ClaverieParameter_test$(EXEEXT)\
-$(TEST_PREFIX)ReissCavFreeEnergyProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)UhligCavFreeEnergyProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)PCMCavFreeEnergyProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)PierottiCavFreeEnergyProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)Pair6_12RDFIntegrator_test$(EXEEXT)\
-$(TEST_PREFIX)Pair6_12InteractionEnergyProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)PairExpInteractionEnergyProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)PairExpRDFIntegrator_test$(EXEEXT)\
-$(TEST_PREFIX)PARSE_test$(EXEEXT)
-
-EXECUTABLES_QSAR = \
-$(TEST_PREFIX)AromaticityProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)ConnectivityBase_test$(EXEEXT)\
-$(TEST_PREFIX)ConnectivityDescriptors_test$(EXEEXT)\
-$(TEST_PREFIX)Descriptor_test$(EXEEXT)\
-$(TEST_PREFIX)PartialChargeProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)PartialChargeBase_test$(EXEEXT)\
-$(TEST_PREFIX)PartialChargeDescriptors_test$(EXEEXT)\
-$(TEST_PREFIX)RingPerceptionProcessor_test$(EXEEXT)\
-$(TEST_PREFIX)SimpleBase_test$(EXEEXT)\
-$(TEST_PREFIX)SimpleDescriptors_test$(EXEEXT)\
-$(TEST_PREFIX)SurfaceBase_test$(EXEEXT)\
-$(TEST_PREFIX)SurfaceDescriptors_test$(EXEEXT)
-
-XDR_DEPENDENT_EXECUTABLES = \
-$(TEST_PREFIX)XDRPersistenceManager_test$(EXEEXT)
-
-VIEW_DEPENDENT_EXECUTABLES= \
-$(TEST_PREFIX)BallAndStickModel_test$(EXEEXT)\
-$(TEST_PREFIX)AddCartoonModel_test$(EXEEXT)\
-$(TEST_PREFIX)LabelModel_test$(EXEEXT)\
-$(TEST_PREFIX)LineModel_test$(EXEEXT)\
-$(TEST_PREFIX)SurfaceModel_test$(EXEEXT)\
-$(TEST_PREFIX)HBondModel_test$(EXEEXT)\
-$(TEST_PREFIX)ColorRGBA_test$(EXEEXT)
-
-GSL_DEPENDENT_EXECUTABLES= \
-$(TEST_PREFIX)RMSDMinimizer_test$(EXEEXT)
-
-SQL_DEPENDENT_EXECUTABLES= \
-$(TEST_PREFIX)DBInterface_test$(EXEEXT)
-
-ifeq ($(BALL_HAS_VIEW),true)
-	ASIO_DEPENDENT_EXECUTABLES= \
-	$(TEST_PREFIX)Socket_test$(EXEEXT)
-endif
diff --git a/source/TEST/NMRStarFile_test.C b/source/TEST/NMRStarFile_test.C
index 7011e77..0421cc5 100644
--- a/source/TEST/NMRStarFile_test.C
+++ b/source/TEST/NMRStarFile_test.C
@@ -356,7 +356,7 @@ CHECK(BALLToBMRBMapper)
 	NMRStarFile::BALLToBMRBMapper mapper2(chain2, nmr_file2, "dockerin");
 	
 	TEST_EQUAL(*mapper2.getChain() == chain2, true)	
-	TEST_EQUAL(*mapper.getNMRStarFile() == nmr_file2, true)
+	TEST_EQUAL(*mapper2.getNMRStarFile() == nmr_file2, true)
 	TEST_EQUAL(mapper2.getNMRAtomDataSet() != NULL, true)
 
 	mapper2.setChain(chain);
diff --git a/source/TEST/PDBFile_test.C b/source/TEST/PDBFile_test.C
index d262e04..059384b 100644
--- a/source/TEST/PDBFile_test.C
+++ b/source/TEST/PDBFile_test.C
@@ -25,8 +25,8 @@ namespace BALL
 		}
 
 		// make protected members public for testing
-		PDBFile::writeRawRecord_;
-		PDBFile::writeRecord_;
+		using PDBFile::writeRawRecord_;
+		using PDBFile::writeRecord_;
 	};
 	
 
diff --git a/source/TEST/PoseClustering_test.C b/source/TEST/PoseClustering_test.C
index 5407e52..20e7cd4 100644
--- a/source/TEST/PoseClustering_test.C
+++ b/source/TEST/PoseClustering_test.C
@@ -122,6 +122,7 @@ CHECK(compute() - general)
 	TEST_EQUAL(pc.getNumberOfClusters(), 3)
 	TEST_EQUAL(pc.getClusterSize(0), 4)
 	TEST_REAL_EQUAL(pc.getClusterScore(0), 7.4983)
+	TEST_REAL_EQUAL(pc.computeCompleteLinkageRMSD(0, pc.options, false), 7.4983)
 	std::set<Index> c0 = pc.getCluster(0);
 	TEST_EQUAL((c0.find(0)!=c0.end()), true)
 	TEST_EQUAL((c0.find(3)!=c0.end()), true)
@@ -129,6 +130,7 @@ CHECK(compute() - general)
 
 	TEST_EQUAL(pc.getClusterSize(2), 2)
 	TEST_REAL_EQUAL(pc.getClusterScore(2), 2.65794)
+	TEST_REAL_EQUAL(pc.computeCompleteLinkageRMSD(2, pc.options, false), 2.65794)
 	std::set<Index> c2 = pc.getCluster(2);
 	TEST_EQUAL((c2.find(6)!=c2.end()), true)
 	TEST_EQUAL((c2.find(7)!=c2.end()), true)
@@ -160,7 +162,7 @@ CHECK(PoseClustering::Option::CLUSTER_METHOD with RMSD_TYPE = SNAPSHOT_RMSD)
 	TEST_EQUAL(pc.getNumberOfClusters(), 1)
 	TEST_REAL_EQUAL(pc.getClusterScore(0), 60.6787)
 
-	//pc.printClusterRMSDs();
+	//pc.printClusterScores();
 
 	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 4.00);
 	pc.compute();
@@ -203,15 +205,15 @@ CHECK(PoseClustering::Option::CLUSTER_METHOD with RMSD_TYPE = SNAPSHOT_RMSD)
 	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
 	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0.00);
 	pc.compute();
-	TEST_EQUAL(pc.getNumberOfClusters(), 0)
+	TEST_EQUAL(pc.getNumberOfClusters(), 8)
 
-	/*TODO: implement as tool!
 	// TEST
-	File f("test.gv", std::ios::out);
-	pc.exportWardClusterTree(f);
+	/*
+	File f("test2.gv", std::ios::out);
+	pc.exportWardClusterTreeToGraphViz(f);
 	f.close();
 	// END TEST	
-	// */
+	*/
 
 	std::vector<std::set<Index> > clusters = pc.extractClustersForThreshold(0.5);
 	TEST_EQUAL(clusters.size(), 8)
@@ -224,10 +226,10 @@ CHECK(PoseClustering::Option::CLUSTER_METHOD with RMSD_TYPE = SNAPSHOT_RMSD)
 	TEST_EQUAL(pc.getClusterSize(0), 2)
 	PRECISION(1e-4)
 	TEST_REAL_EQUAL(pc.getClusterScore(0), 1.86212)
-	TEST_EQUAL(pc.getClusterSize(1), 4)
-	TEST_REAL_EQUAL(pc.getClusterScore(1), 5.26936)
-	TEST_EQUAL(pc.getClusterSize(2),2)
-	TEST_REAL_EQUAL(pc.getClusterScore(2), 1.87944)
+	TEST_EQUAL(pc.getClusterSize(1), 2)
+	TEST_REAL_EQUAL(pc.getClusterScore(1), 1.87944)
+	TEST_EQUAL(pc.getClusterSize(2), 4)
+	TEST_REAL_EQUAL(pc.getClusterScore(2), 5.26936)
 
 	clusters = pc.extractClustersForThreshold(68);
 	TEST_EQUAL(clusters.size(), 1)
@@ -269,7 +271,7 @@ CHECK(PoseClustering::Option::CLUSTER_METHOD with RMSD_TYPE = CENTER_OF_MASS_DIS
 	TEST_EQUAL(pc.getClusterScore(1) < 3., true)
 	TEST_EQUAL(pc.getClusterScore(2) < 3., true)
 	TEST_EQUAL(pc.getClusterScore(3) < 3., true)
-	//pc.printClusterRMSDs();
+	//pc.printClusterScores();
 
 	//               - CLINK_DEFAYS
 	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::CLINK_DEFAYS);
@@ -315,28 +317,28 @@ CHECK(PoseClustering::Option::CLUSTER_METHOD with RMSD_TYPE = CENTER_OF_MASS_DIS
 	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
 	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0.00);
 	pc.compute();
-	TEST_EQUAL(pc.getNumberOfClusters(), 0)
+	TEST_EQUAL(pc.getNumberOfClusters(), 8)
 
 	pc.extractClustersForThreshold(2.4);
 	TEST_EQUAL(pc.getNumberOfClusters(), 3)
-	TEST_EQUAL(pc.getClusterSize(0), 2)
+	TEST_EQUAL(pc.getClusterSize(0), 4)
 	PRECISION(1e-3)
-	TEST_REAL_EQUAL(pc.getClusterScore(0),  1.54954e-05)
+	TEST_REAL_EQUAL(pc.getClusterScore(0),  2.34918)
 	PRECISION(1e-5)
 
-	TEST_REAL_EQUAL(pc.getClusterScore(1), 2.34918)
+	TEST_REAL_EQUAL(pc.getClusterScore(1), 1.09569e-05)
 	TEST_REAL_EQUAL(pc.getClusterScore(2), 0.945311)
 
-	pc.extractClustersForThreshold(60);
+	pc.extractClustersForThreshold(50.7);
 	TEST_EQUAL(pc.getNumberOfClusters(), 2)
-	TEST_EQUAL(pc.getClusterSize(0), 2)
+	TEST_EQUAL(pc.getClusterSize(0), 4)
 	PRECISION(1e-3)
-	TEST_REAL_EQUAL(pc.getClusterScore(0), 1.54954e-05)
-	TEST_REAL_EQUAL(pc.getClusterScore(1), 42.8763)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 50.6247)
+	TEST_REAL_EQUAL(pc.getClusterScore(1), 2.34918)
 
-	pc.extractClustersForThreshold(64.3);
+	pc.extractClustersForThreshold(59);
 	TEST_EQUAL(pc.getNumberOfClusters(), 1)
-	TEST_REAL_EQUAL(pc.getClusterScore(0), 64.2998)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 58.395)
 	PRECISION(1e-5)
 RESULT
 
@@ -411,39 +413,39 @@ CHECK(PoseClustering::Option::CLUSTER_METHOD with RMSD_TYPE = RIGID_RMSD)
 	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
 	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0.00);
 	pc.compute();
-	TEST_EQUAL(pc.getNumberOfClusters(), 0)
+	TEST_EQUAL(pc.getNumberOfClusters(), 55)
 
 	std::vector<std::set<Index> > clusters = pc.extractClustersForThreshold(15);
-//pc.printClusterRMSDs();
+//pc.printClusterScores();
 
-	TEST_EQUAL(clusters.size(), 18)
-	TEST_EQUAL(pc.getNumberOfClusters(), 18)
+	TEST_EQUAL(clusters.size(), 20)
+	TEST_EQUAL(pc.getNumberOfClusters(), 20)
 
 	PRECISION(1e-3)
-	TEST_EQUAL(pc.getClusterSize(0), 2)
-	TEST_REAL_EQUAL(pc.getClusterScore(0), 4.03438)
-	TEST_EQUAL(pc.getClusterSize(3), 4)
-	TEST_REAL_EQUAL(pc.getClusterScore(3), 10.3887)
-	TEST_EQUAL(pc.getClusterSize(7), 4)
-	TEST_REAL_EQUAL(pc.getClusterScore(7), 14.8254)
-
-	c0 = pc.getCluster(5);
-	TEST_EQUAL(pc.getClusterSize(5), 6)
-	TEST_REAL_EQUAL(pc.getClusterScore(5), 9.53159)
+	TEST_EQUAL(pc.getClusterSize(0), 4)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 10.2837)
+	TEST_EQUAL(pc.getClusterSize(3), 2)
+	TEST_REAL_EQUAL(pc.getClusterScore(3), 5.3962)
+	TEST_EQUAL(pc.getClusterSize(7), 2)
+	TEST_REAL_EQUAL(pc.getClusterScore(7), 4.39475)
+
+	std::set<Index> c19 = pc.getCluster(19);
+	TEST_EQUAL(pc.getClusterSize(19), 6)
+	TEST_REAL_EQUAL(pc.getClusterScore(19), 9.53159)
 	PRECISION(1e-5)
 
-	TEST_EQUAL((c0.find(0)!=c0.end()), true)
-	TEST_EQUAL((c0.find(7)!=c0.end()), true)
-	TEST_EQUAL((c0.find(8)!=c0.end()), true)
-	TEST_EQUAL((c0.find(19)!=c0.end()), true)
-	TEST_EQUAL((c0.find(46)!=c0.end()), true)
-	TEST_EQUAL((c0.find(47)!=c0.end()), true)
+	TEST_EQUAL((c19.find(0)  != c19.end()), true)
+	TEST_EQUAL((c19.find(7)  != c19.end()), true)
+	TEST_EQUAL((c19.find(8)  != c19.end()), true)
+	TEST_EQUAL((c19.find(19) != c19.end()), true)
+	TEST_EQUAL((c19.find(46) != c19.end()), true)
+	TEST_EQUAL((c19.find(47) != c19.end()), true)
 
 	clusters = pc.extractClustersForThreshold(5.0);
 
 	TEST_EQUAL(pc.getNumberOfClusters(), 36)
-	TEST_EQUAL(pc.getClusterSize(13), 4)
-	std::set<Index> c1 = pc.getCluster(13);
+	TEST_EQUAL(pc.getClusterSize(20), 4)
+	std::set<Index> c1 = pc.getCluster(20);
 	TEST_EQUAL((c1.find(31) != c1.end()), true)
 	TEST_EQUAL((c1.find(32) != c1.end()), true)
 	TEST_EQUAL((c1.find(51) != c1.end()), true)
@@ -552,13 +554,13 @@ CHECK(PoseClustering::refineClustering)
 	pc3.compute();
 
 	TEST_EQUAL(pc3.getNumberOfClusters(), 23)
-	TEST_EQUAL(pc3.getClusterSize(2), 2)
+	TEST_EQUAL(pc3.getClusterSize(2), 4)
 	refined_options = pc3.options;
 	refined_options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 5);
 	pc3.refineClustering(refined_options);
 
 	TEST_EQUAL(pc3.getNumberOfClusters(), 30)
-	TEST_EQUAL(pc3.getClusterSize(2), 2)
+	TEST_EQUAL(pc3.getClusterSize(2), 4)
 
 RESULT
 
@@ -737,7 +739,7 @@ CHECK(getReducedConformationSet())
 	pc_nnw.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 15.00);
 
 	pc_nnw.compute();
-	TEST_EQUAL(pc_nnw.getNumberOfClusters(), 18)
+	TEST_EQUAL(pc_nnw.getNumberOfClusters(), 20)
 
 	boost::shared_ptr<ConformationSet> cs_nnw = pc_nnw.getReducedConformationSet();
 	TEST_EQUAL(cs_nnw->size(),  pc_nnw.getNumberOfClusters())
@@ -753,7 +755,10 @@ CHECK(getReducedConformationSet())
 	// should be larger than PoseClustering::Option::DISTANCE_THRESHOLD	
 	//TODO: not really what we want to do: Ward distance vs RMSD
 	TEST_EQUAL(mapper_nnw.calculateRMSD() >= pc_nnw.options.getReal(PoseClustering::Option::DISTANCE_THRESHOLD), true)
-	TEST_REAL_EQUAL(pc_nnw.getScore(sys17, sys_nnw, pc_nnw.options), 99.05)
+
+	PRECISION(1e-3)
+	TEST_REAL_EQUAL(pc_nnw.getScore(sys17, sys_nnw, pc_nnw.options), 98.7483)
+	PRECISION(1e-5)
 
 RESULT
 
@@ -829,7 +834,7 @@ CHECK(getClusterRepresentative(Index i))
 	pc_nnw.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 15.00);
 
 	pc_nnw.compute();
-	TEST_EQUAL(pc_nnw.getNumberOfClusters(), 18)
+	TEST_EQUAL(pc_nnw.getNumberOfClusters(), 20)
 
 	boost::shared_ptr<System> sys18 = pc_nnw.getClusterRepresentative(17);
 	TEST_EQUAL(sys18->getProtein(0)->countAtoms(), sys.getProtein(0)->countAtoms())
@@ -837,7 +842,7 @@ CHECK(getClusterRepresentative(Index i))
 	TEST_EQUAL(sys5->getProtein(0)->countAtoms(), 454)
 
 	PRECISION(1e-1)
-	TEST_REAL_EQUAL(pc_nnw.getScore(*sys18, *sys5, pc_nnw.options), 88.8203)
+	TEST_REAL_EQUAL(pc_nnw.getScore(*sys18, *sys5, pc_nnw.options), 73.7363)
 	PRECISION(1e-5)
 
 RESULT
@@ -931,22 +936,22 @@ CHECK(getClusterConformationSet(Index i))
 
 	pc_nnw.compute();
 
-	boost::shared_ptr<ConformationSet> cs2_nnw = pc_nnw.getClusterConformationSet(2);
-	TEST_EQUAL(cs2_nnw->size(), 2)
+	boost::shared_ptr<ConformationSet> cs0_nnw = pc_nnw.getClusterConformationSet(0);
+	TEST_EQUAL(cs0_nnw->size(), 2)
 
 	boost::shared_ptr<ConformationSet> cs1_nnw = pc_nnw.getClusterConformationSet(1);
-	TEST_EQUAL(cs1_nnw->size(), 4)
+	TEST_EQUAL(cs1_nnw->size(), 2)
 
-	boost::shared_ptr<ConformationSet> cs0_nnw = pc_nnw.getClusterConformationSet(0);
-	TEST_EQUAL(cs0_nnw->size(), 2)
+	boost::shared_ptr<ConformationSet> cs2_nnw = pc_nnw.getClusterConformationSet(2);
+	TEST_EQUAL(cs2_nnw->size(), 4)
 
 	TEST_EQUAL(sys.getProtein(0)->countAtoms(), cs2_nnw->getSystem().getProtein(0)->countAtoms())
 
 	// different clusters
 	System sys2_nnw(cs2_nnw->getSystem());
-	(*cs2_nnw)[1].applySnapShot(sys2_nnw);
+	(*cs2_nnw)[2].applySnapShot(sys2_nnw);
 	System sys1_nnw(cs1_nnw->getSystem());
-	(*cs1_nnw)[2].applySnapShot(sys1_nnw);
+	(*cs1_nnw)[1].applySnapShot(sys1_nnw);
 
 	StructureMapper mapper_nnw(sys2_nnw, sys1_nnw);
   mapper_nnw.calculateDefaultBijection();
@@ -961,10 +966,10 @@ CHECK(getClusterConformationSet(Index i))
 	(*cs1_nnw)[0].applySnapShot(sys2_nnw);
 	// should be smaller than PoseClustering::Option::DISTANCE_THRESHOLD
 	PRECISION(1e-1)
-  TEST_REAL_EQUAL(mapper_nnw.calculateRMSD(), 2.996)
+  TEST_REAL_EQUAL(mapper_nnw.calculateRMSD(), 2.84235)
 	//TODO: not really what we want to do: Ward distance vs RMSD
   TEST_EQUAL(mapper_nnw.calculateRMSD() < pc_nnw.options.getReal(PoseClustering::Option::DISTANCE_THRESHOLD), true)
-	TEST_REAL_EQUAL(pc_nnw.getScore(sys2_nnw, sys1_nnw, pc_nnw.options), 2.97102)
+	TEST_REAL_EQUAL(pc_nnw.getScore(sys2_nnw, sys1_nnw, pc_nnw.options), 2.675794)
 	PRECISION(1e-5)
 
 RESULT
@@ -1158,7 +1163,7 @@ CHECK(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL::PROPERTY_BASED_ATOM_BIJECTIO
 	pc_nncw.setConformationSet(&cs2);
 
 	pc_nncw.compute();
-	TEST_EQUAL(pc_nncw.getNumberOfClusters(), 0)
+	TEST_EQUAL(pc_nncw.getNumberOfClusters(), 2)
 
 	pc_nncw.extractClustersForThreshold(70);
 	TEST_EQUAL(pc_nncw.getNumberOfClusters(), 2)
@@ -1169,7 +1174,53 @@ CHECK(PoseClustering::Option::RMSD_LEVEL_OF_DETAIL::PROPERTY_BASED_ATOM_BIJECTIO
 RESULT
 
 
-CHECK(extractNBestClusters(Size n))
+CHECK(computeCompleteLinkageRMSD())
+
+	PDBFile pdb(BALL_TEST_DATA_PATH(PoseClustering_test.pdb));
+	System sys;
+	pdb.read(sys);
+	ConformationSet cs2;
+	cs2.setup(sys);
+	cs2.readDCDFile(BALL_TEST_DATA_PATH(PoseClustering_test2.dcd));
+	cs2.resetScoring();
+	PoseClustering pc(&cs2, 10.00);
+
+	pc.compute();
+	TEST_EQUAL(pc.getNumberOfClusters(), 3)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 7.4983)
+	TEST_REAL_EQUAL(pc.computeCompleteLinkageRMSD(0, pc.options, false), 7.4983)
+	Options temp_options = pc.options;
+	temp_options[PoseClustering::Option::RMSD_TYPE] = PoseClustering::RIGID_RMSD;
+	TEST_REAL_EQUAL(pc.computeCompleteLinkageRMSD(0, temp_options, true), 7.37874)
+	temp_options[PoseClustering::Option::RMSD_TYPE] = PoseClustering::CENTER_OF_MASS_DISTANCE;
+	TEST_REAL_EQUAL(pc.computeCompleteLinkageRMSD(0, temp_options, true), 3.52106)
+	TEST_REAL_EQUAL(pc.getClusterScore(2), 2.65794)
+	TEST_REAL_EQUAL(pc.computeCompleteLinkageRMSD(2, pc.options, false), 2.65794)
+
+	// SNAPSHOT_RMSD -- NN-ChainWard 
+	pc.options.setInteger(PoseClustering::Option::RMSD_TYPE, PoseClustering::SNAPSHOT_RMSD);
+	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
+	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 100.00);
+
+	pc.compute();
+	TEST_EQUAL(pc.getNumberOfClusters(), 1)
+
+	PRECISION(1e-2)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 67.8968)
+	// NOTE: Ward score and RMSD do not have to be the same!
+	TEST_REAL_EQUAL(pc.computeCompleteLinkageRMSD(0, pc.options, true),  60.6787)
+	// TODO: find out how to catch an error in tests
+	/*try {
+		TEST_REAL_EQUAL(pc.computeCompleteLinkageRMSD(2, pc.options, false), 0)
+	}catch(...)
+	{
+	}*/
+	PRECISION(1e-5)
+
+RESULT
+
+
+CHECK(extractNBestClusters(Size n, Size i))
 	PDBFile pdb(BALL_TEST_DATA_PATH(PoseClustering_test.pdb));
 	System sys;
 	pdb.read(sys);
@@ -1191,7 +1242,16 @@ CHECK(extractNBestClusters(Size n))
 	TEST_EQUAL(result.size(), 4)
 	TEST_EQUAL(pc.getNumberOfClusters(), 4)
 
-	// TODO: find out how to catch an error
+	result = pc.extractNBestClusters(4);
+	TEST_EQUAL(result.size(), 4)
+	TEST_EQUAL(pc.getNumberOfClusters(), 4)
+
+	result = pc.filterClusters(3);
+	TEST_EQUAL(result.size(), 1)
+	TEST_EQUAL(pc.getNumberOfClusters(), 1)
+
+
+	// TODO: find out how to catch an error in tests
 //	result = pc.extractNBestClusters(pc.getNumberOfPoses()+1);
 //	result = pc.extractNBestClusters(-1);
 	result = pc.extractNBestClusters(0);
@@ -1201,6 +1261,14 @@ CHECK(extractNBestClusters(Size n))
 	TEST_EQUAL(result.size(), 8)
 	TEST_EQUAL(pc.getNumberOfClusters(), 8)
 
+	result = pc.extractNBestClusters(pc.getNumberOfPoses());
+	TEST_EQUAL(result.size(), 8)
+	TEST_EQUAL(pc.getNumberOfClusters(), 8)
+
+	result = pc.filterClusters(2);
+	TEST_EQUAL(result.size(), 0)
+	TEST_EQUAL(pc.getNumberOfClusters(), 0)
+
 	result = pc.extractNBestClusters(1);
 	TEST_EQUAL(result.size(), 1)
 	TEST_EQUAL(pc.getNumberOfClusters(), 1)
@@ -1208,12 +1276,305 @@ CHECK(extractNBestClusters(Size n))
 RESULT
 
 
+
+CHECK(extractClustersForThreshold(Size n, Size i))
+	PDBFile pdb(BALL_TEST_DATA_PATH(PoseClustering_test.pdb));
+	System sys;
+	pdb.read(sys);
+
+	PoseClustering pc;
+	pc.setBaseSystemAndTransformations(sys, BALL_TEST_DATA_PATH(PoseClustering_test.txt));
+	pc.options.setInteger(PoseClustering::Option::RMSD_TYPE, PoseClustering::RIGID_RMSD);
+
+	//               - NEAREST_NEIGHBOR_CHAIN_WARD	
+	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
+	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0.00);
+	pc.compute();
+	TEST_EQUAL(pc.getNumberOfClusters(), 55)
+
+	std::vector<std::set<Index> > clusters = pc.extractClustersForThreshold(15);
+	TEST_EQUAL(clusters.size(), 20)
+	TEST_EQUAL(pc.getNumberOfClusters(), 20)
+
+	std::vector<std::set<Index> > clusters_2 = pc.extractClustersForThreshold(15, 2);
+	TEST_EQUAL(clusters_2.size(), 20)
+	TEST_EQUAL(pc.getNumberOfClusters(), 20)
+
+	std::vector<std::set<Index> > clusters_5 = pc.extractClustersForThreshold(15, 5);
+	TEST_EQUAL(clusters_5.size(), 1)
+	TEST_EQUAL(pc.getNumberOfClusters(), 1)
+
+	PRECISION(1e-3)
+	TEST_EQUAL(pc.getClusterSize(0), 6)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 9.53159)
+
+	std::set<Index> c0 = pc.getCluster(0);
+	TEST_EQUAL(pc.getClusterSize(0), 6)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 9.53159)
+	PRECISION(1e-5)
+
+	TEST_EQUAL((c0.find(0)  != c0.end()), true)
+	TEST_EQUAL((c0.find(7)  != c0.end()), true)
+	TEST_EQUAL((c0.find(8)  != c0.end()), true)
+	TEST_EQUAL((c0.find(19) != c0.end()), true)
+	TEST_EQUAL((c0.find(46) != c0.end()), true)
+	TEST_EQUAL((c0.find(47) != c0.end()), true)
+
+	////////////////////////////////////////////////
+	clusters = pc.extractClustersForThreshold(5.0);
+
+	TEST_EQUAL(pc.getNumberOfClusters(), 36)
+	TEST_EQUAL(pc.getClusterSize(20), 4)
+	std::set<Index> c1 = pc.getCluster(20);
+	TEST_EQUAL((c1.find(31) != c1.end()), true)
+	TEST_EQUAL((c1.find(32) != c1.end()), true)
+	TEST_EQUAL((c1.find(51) != c1.end()), true)
+	TEST_EQUAL((c1.find(52) != c1.end()), true)
+	clusters = pc.extractClustersForThreshold(5.0);
+
+	TEST_EQUAL(pc.getNumberOfClusters(), 36)
+	TEST_EQUAL(pc.getClusterSize(20), 4)
+
+	std::set<Index> c2 = pc.getCluster(20);
+	TEST_EQUAL((c1.find(31) != c1.end()), true)
+	TEST_EQUAL((c1.find(32) != c1.end()), true)
+	TEST_EQUAL((c1.find(51) != c1.end()), true)
+	TEST_EQUAL((c1.find(52) != c1.end()), true)
+
+	///////////////////////////////////////////////
+	pc.extractClustersForThreshold(1.5);
+
+	TEST_EQUAL(pc.getNumberOfClusters(), 53)
+
+	pc.extractClustersForThreshold(1.5, 2);
+
+	TEST_EQUAL(pc.getNumberOfClusters(), 2)
+
+RESULT
+
+
+CHECK(serializeWardClusterTree(std::ostream& out))
+	String filename;
+
+	//filename = "PoseClustering_wardtree.dat";
+	NEW_TMP_FILE(filename)
+  File temp_tree(filename, std::ios::out);
+
+	PoseClustering pc;
+	pc.options.setInteger(PoseClustering::Option::RMSD_TYPE, PoseClustering::CENTER_OF_MASS_DISTANCE);
+	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
+	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0.00);
+
+	PDBFile pdb(BALL_TEST_DATA_PATH(PoseClustering_test.pdb));
+	System sys;
+	pdb.read(sys);
+	ConformationSet cs2;
+	cs2.setup(sys);
+	cs2.readDCDFile(BALL_TEST_DATA_PATH(PoseClustering_test2.dcd));
+	cs2.resetScoring();
+
+	pc.setConformationSet(&cs2);
+	pc.compute();
+
+	//pc.extractClustersForThreshold(2.4); //0.5
+	pc.serializeWardClusterTree(temp_tree);
+
+	TEST_FILE(filename.c_str(), BALL_TEST_DATA_PATH(PoseClustering_wardtree.dat))
+RESULT
+
+
+CHECK(deserializeWardClusterTree(std::istream& out))
+	File tree(BALL_TEST_DATA_PATH(PoseClustering_wardtree.dat));
+	PoseClustering pc;
+	pc.options.set(PoseClustering::Option::RMSD_TYPE, PoseClustering::SNAPSHOT_RMSD);
+	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
+	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0);
+
+	pc.deserializeWardClusterTree(tree);
+	std::vector<std::set<Index> > clusters = pc.extractClustersForThreshold(0.5);
+	TEST_EQUAL(clusters.size(), 6)
+	TEST_EQUAL(pc.getNumberOfClusters(), 6)
+	TEST_EQUAL(pc.getClusterScore(0), 0.)
+
+	pc.extractClustersForThreshold(2.4);
+	TEST_EQUAL(pc.getNumberOfClusters(), 3)
+	TEST_EQUAL(pc.getClusterSize(0), 4)
+	PRECISION(1e-3)
+	TEST_REAL_EQUAL(pc.getClusterScore(0),  2.34918)
+	PRECISION(1e-5)
+
+	TEST_REAL_EQUAL(pc.getClusterScore(1), 1.09569e-05)
+	TEST_REAL_EQUAL(pc.getClusterScore(2), 0.945311)
+
+	pc.extractClustersForThreshold(50.7);
+	TEST_EQUAL(pc.getNumberOfClusters(), 2)
+	TEST_EQUAL(pc.getClusterSize(0), 4)
+	PRECISION(1e-3)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 50.6247)
+	TEST_REAL_EQUAL(pc.getClusterScore(1), 2.34918)
+
+	pc.extractClustersForThreshold(59);
+	TEST_EQUAL(pc.getNumberOfClusters(), 1)
+	TEST_REAL_EQUAL(pc.getClusterScore(0), 58.395)
+	PRECISION(1e-5)
+
+RESULT
+
+
+CHECK(deserialize/serialize WardClusterTree(std::ostream& out))
+
+	String filename;
+  NEW_TMP_FILE(filename)
+  File temp_tree(filename, std::ios::out);
+
+	PDBFile pdb(BALL_TEST_DATA_PATH(PoseClustering_test.pdb));
+	System sys;
+	pdb.read(sys);
+
+	PoseClustering pc;
+	pc.setBaseSystemAndTransformations(sys, BALL_TEST_DATA_PATH(PoseClustering_test.txt));
+	pc.options.setInteger(PoseClustering::Option::RMSD_TYPE, PoseClustering::RIGID_RMSD);
+
+	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
+	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0.00);
+	pc.compute();
+	TEST_EQUAL(pc.getNumberOfClusters(), 55)
+
+	std::vector<std::set<Index> > clusters = pc.extractClustersForThreshold(15);
+	TEST_EQUAL(clusters.size(), 20)
+	TEST_EQUAL(pc.getNumberOfClusters(), 20)
+	pc.serializeWardClusterTree(temp_tree);
+
+
 /*
-CHECK convertTransformations2Snaphots_();
-CHECK convertSnaphots2Transformations_();
+	PoseClustering pc;
+	pc.options.setInteger(PoseClustering::Option::RMSD_TYPE, PoseClustering::CENTER_OF_MASS_DISTANCE);
+	PDBFile pdb(BALL_TEST_DATA_PATH(PoseClustering_test.pdb));
+	System sys;
+	pdb.read(sys);
+	ConformationSet cs2;
+	cs2.setup(sys);
+	cs2.readDCDFile(BALL_TEST_DATA_PATH(PoseClustering_test2.dcd));
+	cs2.resetScoring();
+	pc.setConformationSet(&cs2);
+
+	//               - NEAREST_NEIGHBOR_CHAIN_WARD
+	pc.options.set(PoseClustering::Option::CLUSTER_METHOD, PoseClustering::NEAREST_NEIGHBOR_CHAIN_WARD);
+	pc.options.setReal(PoseClustering::Option::DISTANCE_THRESHOLD, 0.00);
+	pc.compute();
+	TEST_EQUAL(pc.getNumberOfClusters(), 0)
+
+	pc.extractClustersForThreshold(2.4);
+	pc.exportWardClusterTreeToGraphViz(temp_tree);
 
 */
 
+	temp_tree.reopen(std::ios::in);
+
+	PoseClustering pc2;
+	pc2.options = pc.options;
+	pc2.deserializeWardClusterTree(temp_tree);
+
+	pc2.extractClustersForThreshold(15);
+
+	PRECISION(1e-3)
+	TEST_EQUAL(pc2.getClusterSize(0), 4)
+	TEST_REAL_EQUAL(pc2.getClusterScore(0), 10.2837)
+	TEST_EQUAL(pc2.getClusterSize(3), 2)
+	TEST_REAL_EQUAL(pc2.getClusterScore(3), 5.3962)
+	TEST_EQUAL(pc2.getClusterSize(7), 2)
+	TEST_REAL_EQUAL(pc2.getClusterScore(7), 4.39475)
+
+	std::set<Index> c19 = pc2.getCluster(19);
+	TEST_EQUAL(pc2.getClusterSize(19), 6)
+	TEST_REAL_EQUAL(pc2.getClusterScore(19), 9.53159)
+	PRECISION(1e-5)
+
+	TEST_EQUAL((c19.find(0)  != c19.end()), true)
+	TEST_EQUAL((c19.find(7)  != c19.end()), true)
+	TEST_EQUAL((c19.find(8)  != c19.end()), true)
+	TEST_EQUAL((c19.find(19) != c19.end()), true)
+	TEST_EQUAL((c19.find(46) != c19.end()), true)
+	TEST_EQUAL((c19.find(47) != c19.end()), true)
+
+	clusters = pc2.extractClustersForThreshold(5.0);
+
+	TEST_EQUAL(pc2.getNumberOfClusters(), 36)
+	TEST_EQUAL(pc2.getClusterSize(20), 4)
+	std::set<Index> c1 = pc2.getCluster(20);
+	TEST_EQUAL((c1.find(31) != c1.end()), true)
+	TEST_EQUAL((c1.find(32) != c1.end()), true)
+	TEST_EQUAL((c1.find(51) != c1.end()), true)
+	TEST_EQUAL((c1.find(52) != c1.end()), true)
+
+	clusters = pc2.extractClustersForThreshold(1.5);
+
+	TEST_EQUAL(pc2.getNumberOfClusters(), 53)
+
+/*
+	pc2.extractClustersForThreshold(2.4);
+
+	TEST_EQUAL(pc2.getNumberOfClusters(), 3)
+	TEST_EQUAL(pc2.getClusterSize(0), 4)
+	PRECISION(1e-3)
+	TEST_REAL_EQUAL(pc2.getClusterScore(0),  2.34918)
+	PRECISION(1e-5)
+
+	TEST_REAL_EQUAL(pc2.getClusterScore(1), 1.09569e-05)
+	TEST_REAL_EQUAL(pc2.getClusterScore(2), 0.945311)
+
+	pc.extractClustersForThreshold(50.7);
+	TEST_EQUAL(pc2.getNumberOfClusters(), 2)
+	TEST_EQUAL(pc2.getClusterSize(0), 4)
+	PRECISION(1e-3)
+	TEST_REAL_EQUAL(pc2.getClusterScore(0), 50.6247)
+	TEST_REAL_EQUAL(pc2.getClusterScore(1), 2.34918)
+
+	pc.extractClustersForThreshold(59);
+	TEST_EQUAL(pc2.getNumberOfClusters(), 1)
+	TEST_REAL_EQUAL(pc2.getClusterScore(0), 58.395)
+	PRECISION(1e-5)
+	*/
+RESULT
+
+
+//CHECK convertTransformations2Snaphots_();
+
+CHECK (convertSnaphots2Transformations())
+	PDBFile pdb(BALL_TEST_DATA_PATH(PoseClustering_test.pdb));
+	System sys;
+	pdb.read(sys);
+	ConformationSet cs2;
+	cs2.setup(sys);
+	cs2.readDCDFile(BALL_TEST_DATA_PATH(PoseClustering_test2.dcd));
+	cs2.resetScoring();
+	PoseClustering pc(&cs2, 10.00);
+
+	pc.convertSnaphots2Transformations();
+
+	String filename;
+	NEW_TMP_FILE(filename)
+	LineBasedFile file(filename, std::ios::out);
+
+	std::vector< PoseClustering::PosePointer > poses = pc.getPoses();
+	for (Size i=0; i<poses.size(); i++)
+	{
+		Eigen::Matrix3f const & rot    = poses[i].trafo->rotation;
+		Eigen::Vector3f const & transl = poses[i].trafo->translation;
+		file << "A A " << " 0.0 "
+			   << rot(0) << " " << rot(1) << " " << rot(2) << " " << transl[0] << " "
+				 << rot(3) << " " << rot(4) << " " << rot(5) << " " << transl[1] << " "
+				 << rot(6) << " " << rot(7) << " " << rot(8) << " " << transl[2]
+				 << std::endl;
+	}
+
+	TEST_FILE(filename.c_str(), BALL_TEST_DATA_PATH(PoseClustering_transformFile.dat))
+
+
+RESULT
+
+
+
 /////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////
 END_TEST
diff --git a/source/TEST/SCWRLRotamerFile_test.C b/source/TEST/SCWRLRotamerFile_test.C
index b869842..3b77076 100644
--- a/source/TEST/SCWRLRotamerFile_test.C
+++ b/source/TEST/SCWRLRotamerFile_test.C
@@ -20,7 +20,7 @@ START_TEST(SCWRLRotamerFile)
 using namespace BALL;
 using namespace std;
 
-SCWRLRotamerFile*	file_ptr = 0;
+SCWRLRotamerFile* file_ptr = 0;
 CHECK(SCWRLRotamerFile::SCWRLRotamerFile())
 	file_ptr = new SCWRLRotamerFile;
 	TEST_NOT_EQUAL(file_ptr, 0)
@@ -35,18 +35,34 @@ RESULT
 CHECK(SCWRLRotamerFile::SCWRLRotamerFile(const String& filename, File::OpenMode open_mode))
 	SCWRLRotamerFile* f = new SCWRLRotamerFile(BALL_TEST_DATA_PATH(SCWRLRotamerFile_test1.lib)); // bb dep file
 	TEST_NOT_EQUAL(f, 0)
-  delete f;
+	delete f;
 RESULT
 
-CHECK(void SCWRLRotamerFile::operator >> (RotamerLibrary& library) throw())
-  SCWRLRotamerFile f(BALL_TEST_DATA_PATH(SCWRLRotamerFile_test1.lib)); // bb dep file
+CHECK(void SCWRLRotamerFile::read >> (RotamerLibrary& library) throw() -- bbdep file)
+	SCWRLRotamerFile f(BALL_TEST_DATA_PATH(SCWRLRotamerFile_test1.lib));// bb depep file
 	RotamerLibrary lib;
-  lib.clear();
+	lib.clear();
 	f >> lib;
 	TEST_EQUAL(lib.getNumberOfRotamers(), 4107);
 RESULT
 
-CHECK(void SCWRLRotamerFile::operator >> (RotamerLibrary& library) throw())
+
+CHECK(void readSCWRLBackboneIndependentLibraryFile(RotamerLibrary& library))
+	SCWRLRotamerFile f(BALL_TEST_DATA_PATH(SCWRLRotamerFile_test2.lib)); //bb indndep file
+	RotamerLibrary lib;
+	f.readSCWRLBackboneIndependentLibraryFile(lib);
+	TEST_EQUAL(lib.getNumberOfRotamers(), 110);
+RESULT
+
+CHECK(void readSCWRLBackboneDependentLibraryFile(RotamerLibrary& library))
+	SCWRLRotamerFile f(BALL_TEST_DATA_PATH(SCWRLRotamerFile_test1.lib)); // bb depep file
+	RotamerLibrary lib;
+	lib.clear();
+	f.readSCWRLBackboneDependentLibraryFile(lib);
+	TEST_EQUAL(lib.getNumberOfRotamers(), 4107);
+RESULT
+
+CHECK(void SCWRLRotamerFile::operator >> (RotamerLibrary& library) throw() -- bbdep file)
   SCWRLRotamerFile f(BALL_TEST_DATA_PATH(SCWRLRotamerFile_test2.lib)); // bb indep file
   RotamerLibrary lib;
   f >> lib;
diff --git a/source/TEST/Socket_test.C b/source/TEST/Socket_test.C
index 4d2a11e..1b69460 100644
--- a/source/TEST/Socket_test.C
+++ b/source/TEST/Socket_test.C
@@ -60,6 +60,7 @@ CHECK([EXTRA] simple asynchronous socket transmission to/from threaded server)
 	{
 		sleepFor(100);
 		port = server.getPort();
+		++retries;
 	}
 
 	TEST_NOT_EQUAL(port, 0);
@@ -94,6 +95,7 @@ CHECK([EXTRA] simple synchronous socket transmission to/from threaded server)
 	{
 		sleepFor(100);
 		port = server.getPort();
+		++retries;
 	}
 
 	TEST_NOT_EQUAL(port, 0);
diff --git a/source/TEST/cmake/BALLTestExecutables.cmake b/source/TEST/cmake/BALLTestExecutables.cmake
index 35f3ad3..b12798c 100644
--- a/source/TEST/cmake/BALLTestExecutables.cmake
+++ b/source/TEST/cmake/BALLTestExecutables.cmake
@@ -260,6 +260,7 @@ SET(BALL_FORMATS_TESTS
 	Bruker2DFile_test
 	CCP4File_test
 	DockResultFile_test
+	HMOFile_test
 	INIFile_test
 	JCAMPFile_test
 	KCFFile_test
diff --git a/source/TEST/data/HMOFile_test.hmo b/source/TEST/data/HMOFile_test.hmo
new file mode 100644
index 0000000..7fde5af
--- /dev/null
+++ b/source/TEST/data/HMOFile_test.hmo
@@ -0,0 +1,1936 @@
+# HYPERMESH for the solvent excluded surface of N.hin; Generated by ./createBEMMesh
+
+BEG_NODL_DATA
+	642
+	1 0 0 20
+	2 17.8885 0 8.94427
+	3 5.52786 17.013 8.94427
+	4 -14.4721 10.5146 8.94427
+	5 -14.4721 -10.5146 8.94427
+	6 5.52786 -17.013 8.94427
+	7 14.4721 10.5146 -8.94427
+	8 -5.52786 17.013 -8.94427
+	9 -17.8885 0 -8.94427
+	10 -5.52786 -17.013 -8.94427
+	11 14.4721 -10.5146 -8.94427
+	12 0 0 -20
+	13 3.24919 10 17.013
+	14 10.5146 0 17.013
+	15 13.7638 10 10.5146
+	16 -8.50651 6.18034 17.013
+	17 -5.25732 16.1803 10.5146
+	18 -8.50651 -6.18034 17.013
+	19 -17.013 0 10.5146
+	20 3.24919 -10 17.013
+	21 -5.25732 -16.1803 10.5146
+	22 13.7638 -10 10.5146
+	23 19.0211 6.18034 0
+	24 11.7557 16.1803 0
+	25 0 20 0
+	26 5.25732 16.1803 -10.5146
+	27 -11.7557 16.1803 0
+	28 -19.0211 6.18034 0
+	29 -13.7638 10 -10.5146
+	30 -19.0211 -6.18034 0
+	31 -11.7557 -16.1803 0
+	32 -13.7638 -10 -10.5146
+	33 0 -20 0
+	34 11.7557 -16.1803 0
+	35 5.25732 -16.1803 -10.5146
+	36 19.0211 -6.18034 0
+	37 17.013 0 -10.5146
+	38 8.50651 6.18034 -17.013
+	39 -3.24919 10 -17.013
+	40 -10.5146 0 -17.013
+	41 -3.24919 -10 -17.013
+	42 8.50651 -6.18034 -17.013
+	43 4.56217 14.0409 13.4922
+	44 5.46533 0 19.2388
+	45 16.4524 5.19784 10.1144
+	46 -11.9439 8.67777 13.4922
+	47 0.140625 17.2534 10.1144
+	48 -11.9439 -8.67777 13.4922
+	49 -16.3655 5.46533 10.1144
+	50 4.56217 -14.0409 13.4922
+	51 -10.2551 -13.8756 10.1144
+	52 10.0275 -14.0409 10.1144
+	53 19.1851 3.21244 4.64909
+	54 13.6328 13.8756 -4.64909
+	55 -2.87329 19.2388 -4.64909
+	56 10.2551 13.8756 -10.1144
+	57 -8.98372 17.2534 -4.64909
+	58 -19.1851 3.21244 -4.64909
+	59 -10.0275 14.0409 -10.1144
+	60 -19.1851 -3.21244 -4.64909
+	61 -8.98372 -17.2534 -4.64909
+	62 -16.4524 -5.19784 -10.1144
+	63 -2.87329 -19.2388 -4.64909
+	64 13.6328 -13.8756 -4.64909
+	65 -0.140625 -17.2534 -10.1144
+	66 19.1851 -3.21244 4.64909
+	67 16.3655 -5.46533 -10.1144
+	68 11.9439 8.67777 -13.4922
+	69 -1.68888 5.19784 -19.2388
+	70 -5.46533 0 -19.2388
+	71 -1.68888 -5.19784 -19.2388
+	72 4.42155 -3.21244 -19.2388
+	73 1.68888 5.19784 19.2388
+	74 14.7635 0 13.4922
+	75 10.0275 14.0409 10.1144
+	76 -4.42155 3.21244 19.2388
+	77 -10.2551 13.8756 10.1144
+	78 -4.42155 -3.21244 19.2388
+	79 -16.3655 -5.46533 10.1144
+	80 1.68888 -5.19784 19.2388
+	81 0.140625 -17.2534 10.1144
+	82 16.4524 -5.19784 10.1144
+	83 17.4093 8.67777 -4.64909
+	84 8.98372 17.2534 4.64909
+	85 2.87329 19.2388 4.64909
+	86 -0.140625 17.2534 -10.1144
+	87 -13.6328 13.8756 4.64909
+	88 -17.4093 8.67777 4.64909
+	89 -16.4524 5.19784 -10.1144
+	90 -17.4093 -8.67777 4.64909
+	91 -13.6328 -13.8756 4.64909
+	92 -10.0275 -14.0409 -10.1144
+	93 2.87329 -19.2388 4.64909
+	94 8.98372 -17.2534 4.64909
+	95 10.2551 -13.8756 -10.1144
+	96 17.4093 -8.67777 -4.64909
+	97 16.3655 5.46533 -10.1144
+	98 4.42155 3.21244 -19.2388
+	99 -4.56217 14.0409 -13.4922
+	100 -14.7635 0 -13.4922
+	101 -4.56217 -14.0409 -13.4922
+	102 11.9439 -8.67777 -13.4922
+	103 7.23607 5.25731 17.8885
+	104 12.7639 5.25731 14.4721
+	105 8.94427 10.5146 14.4721
+	106 -2.76393 8.50651 17.8885
+	107 -7.23607 11.7557 14.4721
+	108 -1.05573 13.7638 14.4721
+	109 -8.94427 0 17.8885
+	110 -13.4164 -3.2492 14.4721
+	111 -13.4164 3.2492 14.4721
+	112 -2.76393 -8.50651 17.8885
+	113 -1.05573 -13.7638 14.4721
+	114 -7.23607 -11.7557 14.4721
+	115 7.23607 -5.25731 17.8885
+	116 8.94427 -10.5146 14.4721
+	117 12.7639 -5.25731 14.4721
+	118 17.2361 8.50651 5.52786
+	119 16.1803 11.7557 0
+	120 13.4164 13.7638 5.52786
+	121 6.18034 19.0211 0
+	122 2.76393 19.0211 -5.52786
+	123 8.94427 17.013 -5.52786
+	124 -2.76393 19.0211 5.52786
+	125 -6.18034 19.0211 0
+	126 -8.94427 17.013 5.52786
+	127 -16.1803 11.7557 0
+	128 -17.2361 8.50651 -5.52786
+	129 -13.4164 13.7638 -5.52786
+	130 -18.9443 3.2492 5.52786
+	131 -20 0 0
+	132 -18.9443 -3.2492 5.52786
+	133 -16.1803 -11.7557 0
+	134 -13.4164 -13.7638 -5.52786
+	135 -17.2361 -8.50651 -5.52786
+	136 -8.94427 -17.013 5.52786
+	137 -6.18034 -19.0211 0
+	138 -2.76393 -19.0211 5.52786
+	139 6.18034 -19.0211 0
+	140 8.94427 -17.013 -5.52786
+	141 2.76393 -19.0211 -5.52786
+	142 20 0 0
+	143 18.9443 -3.2492 -5.52786
+	144 18.9443 3.2492 -5.52786
+	145 13.4164 -13.7638 5.52786
+	146 16.1803 -11.7557 0
+	147 17.2361 -8.50651 5.52786
+	148 7.23607 11.7557 -14.4721
+	149 2.76393 8.50651 -17.8885
+	150 1.05573 13.7638 -14.4721
+	151 -8.94427 10.5146 -14.4721
+	152 -7.23607 5.25731 -17.8885
+	153 -12.7639 5.25731 -14.4721
+	154 -12.7639 -5.25731 -14.4721
+	155 -7.23607 -5.25731 -17.8885
+	156 -8.94427 -10.5146 -14.4721
+	157 1.05573 -13.7638 -14.4721
+	158 2.76393 -8.50651 -17.8885
+	159 7.23607 -11.7557 -14.4721
+	160 13.4164 3.2492 -14.4721
+	161 8.94427 0 -17.8885
+	162 13.4164 -3.2492 -14.4721
+	163 5.09372 15.6769 11.3265
+	164 2.75904 0 19.8088
+	165 17.3362 2.62401 9.62134
+	166 -13.3355 9.68883 11.3265
+	167 2.8616 17.2986 9.62133
+	168 -13.3355 -9.68883 11.3265
+	169 -15.5677 8.06711 9.62133
+	170 5.09372 -15.6769 11.3265
+	171 -12.4829 -12.3128 9.62133
+	172 7.85276 -15.6769 9.62133
+	173 18.7157 1.62173 6.86229
+	174 14.1881 12.3128 -6.86229
+	175 -4.24113 18.3009 -6.86229
+	176 12.4829 12.3128 -9.62133
+	177 -7.32583 17.2986 -6.86229
+	178 -18.7157 1.62173 -6.86229
+	179 -7.85276 15.6769 -9.62133
+	180 -18.7157 -1.62173 -6.86229
+	181 -7.32583 -17.2986 -6.86229
+	182 -17.3362 -2.62401 -9.62134
+	183 -4.24113 -18.3009 -6.86229
+	184 14.1881 -12.3128 -6.86229
+	185 -2.8616 -17.2986 -9.62133
+	186 18.7157 -1.62173 6.86229
+	187 15.5677 -8.06711 -9.62133
+	188 13.3355 9.68883 -11.3265
+	189 -0.852591 2.62401 -19.8088
+	190 -2.75904 0 -19.8088
+	191 -0.852591 -2.62401 -19.8088
+	192 2.23211 -1.62173 -19.8088
+	193 0.852591 2.62401 19.8088
+	194 16.4836 0 11.3265
+	195 7.85276 15.6769 9.62133
+	196 -2.23211 1.62173 19.8088
+	197 -12.4829 12.3128 9.62133
+	198 -2.23211 -1.62173 19.8088
+	199 -15.5677 -8.06711 9.62133
+	200 0.852591 -2.62401 19.8088
+	201 2.8616 -17.2986 9.62133
+	202 17.3362 -2.62401 9.62134
+	203 16.0946 9.68883 -6.86229
+	204 7.32583 17.2986 6.86229
+	205 4.24113 18.3009 6.86229
+	206 -2.8616 17.2986 -9.62133
+	207 -14.1881 12.3128 6.86229
+	208 -16.0946 9.68883 6.86229
+	209 -17.3362 2.62401 -9.62134
+	210 -16.0946 -9.68883 6.86229
+	211 -14.1881 -12.3128 6.86229
+	212 -7.85276 -15.6769 -9.62133
+	213 4.24113 -18.3009 6.86229
+	214 7.32583 -17.2986 6.86229
+	215 12.4829 -12.3128 -9.62133
+	216 16.0946 -9.68883 -6.86229
+	217 15.5677 8.06711 -9.62133
+	218 2.23211 1.62173 -19.8088
+	219 -5.09372 15.6769 -11.3265
+	220 -16.4836 0 -11.3265
+	221 -5.09372 -15.6769 -11.3265
+	222 13.3355 -9.68883 -11.3265
+	223 5.30798 7.72375 17.6683
+	224 11.7844 2.66142 15.9388
+	225 11.4956 10.3852 12.6491
+	226 0.245654 9.3686 17.6683
+	227 -7.96941 9.07981 15.9388
+	228 -3.19587 15.1587 12.6491
+	229 -8.83416 3.12869 17.6683
+	230 -11.0981 -4.77354 15.9388
+	231 -15.4044 1.64485 12.6491
+	232 -5.70547 -7.43496 17.6683
+	233 1.1104 -12.03 15.9388
+	234 -6.32456 -14.1421 12.6491
+	235 8.98598 -2.66142 17.6683
+	236 6.17273 -10.3852 15.9388
+	237 13.4292 -7.72375 12.6491
+	238 15.6932 9.3686 8.12123
+	239 17.8201 9.07981 0
+	240 12.7429 15.1587 2.79838
+	241 9.07981 17.8201 0
+	242 1.39919 19.7538 -2.79838
+	243 7.18931 16.8036 -8.12123
+	244 -4.06062 17.8201 8.12123
+	245 -3.12869 19.7538 0
+	246 -10.479 16.8036 2.79838
+	247 -14.1421 14.1421 0
+	248 -18.3546 7.43496 -2.79838
+	249 -13.7595 12.03 -8.12123
+	250 -18.2028 1.64485 8.12123
+	251 -19.7538 3.12869 0
+	252 -19.2193 -4.77354 2.79838
+	253 -17.8201 -9.07981 0
+	254 -12.7429 -15.1587 -2.79838
+	255 -15.6932 -9.3686 -8.12123
+	256 -7.18931 -16.8036 8.12123
+	257 -9.07981 -17.8201 0
+	258 -1.39919 -19.7538 2.79838
+	259 3.12869 -19.7538 0
+	260 10.479 -16.8036 -2.79838
+	261 4.06062 -17.8201 -8.12123
+	262 19.7538 3.12869 0
+	263 19.2193 -4.77354 -2.79838
+	264 18.2028 1.64485 -8.12123
+	265 13.7595 -12.03 8.12123
+	266 14.1421 -14.1421 0
+	267 18.3546 -7.43496 2.79838
+	268 6.32456 14.1421 -12.6491
+	269 5.70547 7.43496 -17.6683
+	270 -1.1104 12.03 -15.9388
+	271 -11.4956 10.3852 -12.6491
+	272 -5.30798 7.72375 -17.6683
+	273 -11.7844 2.66142 -15.9388
+	274 -13.4292 -7.72375 -12.6491
+	275 -8.98598 -2.66142 -17.6683
+	276 -6.17273 -10.3852 -15.9388
+	277 3.19587 -15.1587 -12.6491
+	278 -0.245654 -9.3686 -17.6683
+	279 7.96941 -9.07981 -15.9388
+	280 15.4044 1.64485 -12.6491
+	281 8.83416 3.12869 -17.6683
+	282 11.0981 -4.77354 -15.9388
+	283 3.94339 12.1365 15.3998
+	284 8.06711 0 18.3009
+	285 15.2539 7.67228 10.4141
+	286 -10.3239 7.50077 15.3998
+	287 -2.58304 16.8782 10.4141
+	288 -10.3239 -7.50077 15.3998
+	289 -16.8504 2.75904 10.4141
+	290 3.94339 -12.1365 15.3998
+	291 -7.83106 -15.173 10.4141
+	292 12.0105 -12.1365 10.4141
+	293 19.2875 4.74173 2.34698
+	294 12.8168 15.173 -2.34698
+	295 -1.45051 19.8088 -2.34698
+	296 7.83106 15.173 -10.4141
+	297 -10.4698 16.8782 -2.34698
+	298 -19.2875 4.74173 -2.34698
+	299 -12.0105 12.1365 -10.4141
+	300 -19.2875 -4.74173 -2.34698
+	301 -10.4698 -16.8782 -2.34698
+	302 -15.2539 -7.67228 -10.4141
+	303 -1.45051 -19.8088 -2.34698
+	304 12.8168 -15.173 -2.34698
+	305 2.58304 -16.8782 -10.4141
+	306 19.2875 -4.74173 2.34698
+	307 16.8504 -2.75904 -10.4141
+	308 10.3239 7.50077 -15.3998
+	309 -2.49287 7.67228 -18.3009
+	310 -8.06711 0 -18.3009
+	311 -2.49287 -7.67228 -18.3009
+	312 6.52643 -4.74173 -18.3009
+	313 2.49287 7.67228 18.3009
+	314 12.7611 0 15.3998
+	315 12.0105 12.1365 10.4141
+	316 -6.52643 4.74173 18.3009
+	317 -7.83106 15.173 10.4141
+	318 -6.52643 -4.74173 18.3009
+	319 -16.8504 -2.75904 10.4141
+	320 2.49287 -7.67228 18.3009
+	321 -2.58304 -16.8782 10.4141
+	322 15.2539 -7.67228 10.4141
+	323 18.391 7.50077 -2.34698
+	324 10.4698 16.8782 2.34698
+	325 1.45051 19.8088 2.34698
+	326 2.58304 16.8782 -10.4141
+	327 -12.8168 15.173 2.34698
+	328 -18.391 7.50077 2.34698
+	329 -15.2539 7.67228 -10.4141
+	330 -18.391 -7.50077 2.34698
+	331 -12.8168 -15.173 2.34698
+	332 -12.0105 -12.1365 -10.4141
+	333 1.45051 -19.8088 2.34698
+	334 10.4698 -16.8782 2.34698
+	335 7.83106 -15.173 -10.4141
+	336 18.391 -7.50077 -2.34698
+	337 16.8504 2.75904 -10.4141
+	338 6.52643 4.74173 -18.3009
+	339 -3.94339 12.1365 -15.3998
+	340 -12.7611 0 -15.3998
+	341 -3.94339 -12.1365 -15.3998
+	342 10.3239 -7.50077 -15.3998
+	343 8.98598 2.66142 17.6683
+	344 13.4292 7.72375 12.6491
+	345 6.17273 10.3852 15.9388
+	346 -5.70547 7.43496 17.6683
+	347 -6.32456 14.1421 12.6491
+	348 1.1104 12.03 15.9388
+	349 -8.83416 -3.12869 17.6683
+	350 -15.4044 -1.64485 12.6491
+	351 -11.0981 4.77354 15.9388
+	352 0.245654 -9.3686 17.6683
+	353 -3.19587 -15.1587 12.6491
+	354 -7.96941 -9.07981 15.9388
+	355 5.30798 -7.72375 17.6683
+	356 11.4956 -10.3852 12.6491
+	357 11.7844 -2.66142 15.9388
+	358 18.3546 7.43496 2.79838
+	359 14.1421 14.1421 0
+	360 13.7595 12.03 8.12123
+	361 3.12869 19.7538 0
+	362 4.06062 17.8201 -8.12123
+	363 10.479 16.8036 -2.79838
+	364 -1.39919 19.7538 2.79838
+	365 -9.07981 17.8201 0
+	366 -7.18931 16.8036 8.12123
+	367 -17.8201 9.07981 0
+	368 -15.6932 9.3686 -8.12123
+	369 -12.7429 15.1587 -2.79838
+	370 -19.2193 4.77354 2.79838
+	371 -19.7538 -3.12869 0
+	372 -18.2028 -1.64485 8.12123
+	373 -14.1421 -14.1421 0
+	374 -13.7595 -12.03 -8.12123
+	375 -18.3546 -7.43496 -2.79838
+	376 -10.479 -16.8036 2.79838
+	377 -3.12869 -19.7538 0
+	378 -4.06062 -17.8201 8.12123
+	379 9.07981 -17.8201 0
+	380 7.18931 -16.8036 -8.12123
+	381 1.39919 -19.7538 -2.79838
+	382 19.7538 -3.12869 0
+	383 18.2028 -1.64485 -8.12123
+	384 19.2193 4.77354 -2.79838
+	385 12.7429 -15.1587 2.79838
+	386 17.8201 -9.07981 0
+	387 15.6932 -9.3686 8.12123
+	388 7.96941 9.07981 -15.9388
+	389 -0.245654 9.3686 -17.6683
+	390 3.19587 15.1587 -12.6491
+	391 -6.17273 10.3852 -15.9388
+	392 -8.98598 2.66142 -17.6683
+	393 -13.4292 7.72375 -12.6491
+	394 -11.7844 -2.66142 -15.9388
+	395 -5.30798 -7.72375 -17.6683
+	396 -11.4956 -10.3852 -12.6491
+	397 -1.1104 -12.03 -15.9388
+	398 5.70547 -7.43496 -17.6683
+	399 6.32456 -14.1421 -12.6491
+	400 11.0981 4.77354 -15.9388
+	401 8.83416 -3.12869 -17.6683
+	402 15.4044 -1.64485 -12.6491
+	403 10.1346 5.3281 16.3982
+	404 11.0002 7.99214 14.667
+	405 8.19909 7.99214 16.3982
+	406 -5.06732 10.2675 16.3982
+	407 -4.20172 12.9316 14.667
+	408 -1.93555 11.2851 16.3982
+	409 -11.3309 -1.64647 16.3982
+	410 -13.597 0 14.667
+	411 -11.3309 1.64647 16.3982
+	412 -1.93555 -11.2851 16.3982
+	413 -4.20172 -12.9316 14.667
+	414 -5.06732 -10.2675 16.3982
+	415 8.19909 -7.99214 16.3982
+	416 11.0002 -7.99214 14.667
+	417 10.1346 -5.3281 16.3982
+	418 16.9332 10.2675 2.80114
+	419 14.9976 12.9316 2.80114
+	420 15.5326 11.2851 5.60229
+	421 4.53235 19.2772 -2.80114
+	422 5.93292 18.2596 -5.60229
+	423 7.66412 18.2596 -2.80114
+	424 -4.53235 19.2772 2.80114
+	425 -7.66412 18.2596 2.80114
+	426 -5.93292 18.2596 5.60229
+	427 -16.9332 10.2675 -2.80114
+	428 -15.5326 11.2851 -5.60229
+	429 -14.9976 12.9316 -2.80114
+	430 -19.7343 1.64647 2.80114
+	431 -19.7343 -1.64647 2.80114
+	432 -19.1993 0 5.60229
+	433 -14.9976 -12.9316 -2.80114
+	434 -15.5326 -11.2851 -5.60229
+	435 -16.9332 -10.2675 -2.80114
+	436 -7.66412 -18.2596 2.80114
+	437 -4.53235 -19.2772 2.80114
+	438 -5.93292 -18.2596 5.60229
+	439 7.66412 -18.2596 -2.80114
+	440 5.93292 -18.2596 -5.60229
+	441 4.53235 -19.2772 -2.80114
+	442 19.7343 -1.64647 -2.80114
+	443 19.1993 0 -5.60229
+	444 19.7343 1.64647 -2.80114
+	445 14.9976 -12.9316 2.80114
+	446 16.9332 -10.2675 2.80114
+	447 15.5326 -11.2851 5.60229
+	448 5.06732 10.2675 -16.3982
+	449 1.93555 11.2851 -16.3982
+	450 4.20172 12.9316 -14.667
+	451 -8.19909 7.99214 -16.3982
+	452 -10.1346 5.3281 -16.3982
+	453 -11.0002 7.99214 -14.667
+	454 -10.1346 -5.3281 -16.3982
+	455 -8.19909 -7.99214 -16.3982
+	456 -11.0002 -7.99214 -14.667
+	457 1.93555 -11.2851 -16.3982
+	458 5.06732 -10.2675 -16.3982
+	459 4.20172 -12.9316 -14.667
+	460 11.3309 1.64647 -16.3982
+	461 11.3309 -1.64647 -16.3982
+	462 13.597 0 -14.667
+	463 7.3908 14.2256 11.9586
+	464 9.58402 12.4048 12.4205
+	465 6.82308 12.4048 14.1268
+	466 3.62416 2.63311 19.4918
+	467 4.50864 5.28166 18.7557
+	468 6.4164 2.65585 18.7557
+	469 15.8133 2.63311 11.9586
+	470 13.9061 2.65585 14.1268
+	471 14.7593 5.28166 12.4205
+	472 -11.2455 11.425 11.9586
+	473 -8.83604 12.9482 12.4205
+	474 -9.68921 10.3224 14.1268
+	475 -1.38431 4.26046 19.4918
+	476 -3.62991 5.92009 18.7557
+	477 -0.543089 6.92306 18.7557
+	478 2.38233 15.853 11.9586
+	479 -0.462287 15.669 12.4205
+	480 1.77136 14.0462 14.1268
+	481 -14.3409 -7.16457 11.9586
+	482 -15.045 -4.40234 12.4205
+	483 -12.8113 -6.02518 14.1268
+	484 -4.47971 0 19.4918
+	485 -6.75205 -1.62284 18.7557
+	486 -6.75205 1.62284 18.7557
+	487 -14.3409 7.16457 11.9586
+	488 -15.045 4.40234 12.4205
+	489 -12.8113 6.02518 14.1268
+	490 2.38233 -15.853 11.9586
+	491 -0.462287 -15.669 12.4205
+	492 1.77136 -14.0462 14.1268
+	493 -1.38431 -4.26046 19.4918
+	494 -0.543089 -6.92306 18.7557
+	495 -3.62991 -5.92009 18.7557
+	496 -11.2455 -11.425 11.9586
+	497 -8.83604 -12.9482 12.4205
+	498 -9.68921 -10.3224 14.1268
+	499 15.8133 -2.63311 11.9586
+	500 14.7593 -5.28166 12.4205
+	501 13.9061 -2.65585 14.1268
+	502 3.62416 -2.63311 19.4918
+	503 4.50864 -5.28166 18.7557
+	504 6.4164 -2.65585 18.7557
+	505 7.3908 -14.2256 11.9586
+	506 9.58402 -12.4048 12.4205
+	507 6.82308 -12.4048 14.1268
+	508 9.63065 15.853 7.47886
+	509 11.3159 15.669 5.14112
+	510 11.8432 14.0462 7.90205
+	511 18.0531 4.26046 7.47886
+	512 18.399 5.92009 5.14112
+	513 17.0185 6.92306 7.90205
+	514 15.7252 11.425 -4.71024
+	515 16.9685 10.3224 -2.34859
+	516 15.0608 12.9482 -2.34859
+	517 -1.52678 18.4861 -7.47886
+	518 1.32522 18.3249 -7.90205
+	519 -0.0552445 19.3279 -5.14112
+	520 6.00649 18.4861 4.71024
+	521 4.57365 19.3279 2.34859
+	522 7.66047 18.3249 2.34859
+	523 12.1011 14.0581 -7.47886
+	524 9.69897 15.6041 -7.90205
+	525 11.4053 15.6041 -5.14112
+	526 -12.1011 14.0581 7.47886
+	527 -11.4053 15.6041 5.14112
+	528 -9.69897 15.6041 7.90205
+	529 1.52678 18.4861 7.47886
+	530 0.0552445 19.3279 5.14112
+	531 -1.32522 18.3249 7.90205
+	532 -6.00649 18.4861 -4.71024
+	533 -7.66047 18.3249 -2.34859
+	534 -4.57365 19.3279 -2.34859
+	535 -18.0531 4.26046 -7.47886
+	536 -17.0185 6.92306 -7.90205
+	537 -18.399 5.92009 -5.14112
+	538 -15.7252 11.425 4.71024
+	539 -16.9685 10.3224 2.34859
+	540 -15.0608 12.9482 2.34859
+	541 -9.63065 15.853 -7.47886
+	542 -11.8432 14.0462 -7.90205
+	543 -11.3159 15.669 -5.14112
+	544 -17.1095 -7.16457 7.47886
+	545 -18.3648 -6.02518 5.14112
+	546 -17.8375 -4.40234 7.90205
+	547 -17.1095 7.16457 7.47886
+	548 -18.3648 6.02518 5.14112
+	549 -17.8375 4.40234 7.90205
+	550 -19.4374 0 -4.71025
+	551 -19.7952 -1.62284 -2.34859
+	552 -19.7952 1.62284 -2.34859
+	553 -9.63065 -15.853 -7.47886
+	554 -11.8432 -14.0462 -7.90205
+	555 -11.3159 -15.669 -5.14112
+	556 -15.7252 -11.425 4.71024
+	557 -15.0608 -12.9482 2.34859
+	558 -16.9685 -10.3224 2.34859
+	559 -18.0531 -4.26046 -7.47886
+	560 -17.0185 -6.92306 -7.90205
+	561 -18.399 -5.92009 -5.14112
+	562 1.52678 -18.4861 7.47886
+	563 0.0552445 -19.3279 5.14112
+	564 -1.32522 -18.3249 7.90205
+	565 -12.1011 -14.0581 7.47886
+	566 -11.4053 -15.6041 5.14112
+	567 -9.69897 -15.6041 7.90205
+	568 -6.00649 -18.4861 -4.71024
+	569 -4.57365 -19.3279 -2.34859
+	570 -7.66047 -18.3249 -2.34859
+	571 12.1011 -14.0581 -7.47886
+	572 9.69897 -15.6041 -7.90205
+	573 11.4053 -15.6041 -5.14112
+	574 6.00649 -18.4861 4.71024
+	575 7.66047 -18.3249 2.34859
+	576 4.57365 -19.3279 2.34859
+	577 -1.52678 -18.4861 -7.47886
+	578 1.32522 -18.3249 -7.90205
+	579 -0.0552445 -19.3279 -5.14112
+	580 17.1095 7.16457 -7.47886
+	581 17.8375 4.40234 -7.90205
+	582 18.3648 6.02518 -5.14112
+	583 19.4374 0 4.71025
+	584 19.7952 -1.62284 2.34859
+	585 19.7952 1.62284 2.34859
+	586 17.1095 -7.16457 -7.47886
+	587 18.3648 -6.02518 -5.14112
+	588 17.8375 -4.40234 -7.90205
+	589 18.0531 -4.26046 7.47886
+	590 17.0185 -6.92306 7.90205
+	591 18.399 -5.92009 5.14112
+	592 9.63065 -15.853 7.47886
+	593 11.3159 -15.669 5.14112
+	594 11.8432 -14.0462 7.90205
+	595 15.7252 -11.425 -4.71024
+	596 16.9685 -10.3224 -2.34859
+	597 15.0608 -12.9482 -2.34859
+	598 11.2455 11.425 -11.9586
+	599 9.68921 10.3224 -14.1268
+	600 8.83604 12.9482 -12.4205
+	601 1.38431 4.26046 -19.4918
+	602 3.62991 5.92009 -18.7557
+	603 0.543089 6.92306 -18.7557
+	604 -2.38233 15.853 -11.9586
+	605 -1.77136 14.0462 -14.1268
+	606 0.462287 15.669 -12.4205
+	607 -7.3908 14.2256 -11.9586
+	608 -6.82308 12.4048 -14.1268
+	609 -9.58402 12.4048 -12.4205
+	610 -3.62416 2.63311 -19.4918
+	611 -6.4164 2.65585 -18.7557
+	612 -4.50864 5.28166 -18.7557
+	613 -15.8133 2.63311 -11.9586
+	614 -13.9061 2.65585 -14.1268
+	615 -14.7593 5.28166 -12.4205
+	616 -15.8133 -2.63311 -11.9586
+	617 -13.9061 -2.65585 -14.1268
+	618 -14.7593 -5.28166 -12.4205
+	619 -3.62416 -2.63311 -19.4918
+	620 -4.50864 -5.28166 -18.7557
+	621 -6.4164 -2.65585 -18.7557
+	622 -7.3908 -14.2256 -11.9586
+	623 -6.82308 -12.4048 -14.1268
+	624 -9.58402 -12.4048 -12.4205
+	625 -2.38233 -15.853 -11.9586
+	626 -1.77136 -14.0462 -14.1268
+	627 0.462287 -15.669 -12.4205
+	628 1.38431 -4.26046 -19.4918
+	629 3.62991 -5.92009 -18.7557
+	630 0.543089 -6.92306 -18.7557
+	631 11.2455 -11.425 -11.9586
+	632 9.68921 -10.3224 -14.1268
+	633 8.83604 -12.9482 -12.4205
+	634 14.3409 -7.16457 -11.9586
+	635 12.8113 -6.02518 -14.1268
+	636 15.045 -4.40234 -12.4205
+	637 4.47971 0 -19.4918
+	638 6.75205 1.62284 -18.7557
+	639 6.75205 -1.62284 -18.7557
+	640 14.3409 7.16457 -11.9586
+	641 15.045 4.40234 -12.4205
+	642 12.8113 6.02518 -14.1268
+END_NODL_DATA
+
+BEG_ELEM_DATA
+	1280 0 0 1280 0 0 0 0 0 0 0 0 0
+	1	1 103	403 404 405
+	2	1 103	406 408 407
+	3	1 103	409 411 410
+	4	1 103	412 414 413
+	5	1 103	415 416 417
+	6	1 103	418 419 420
+	7	1 103	421 423 422
+	8	1 103	424 425 426
+	9	1 103	427 429 428
+	10	1 103	430 431 432
+	11	1 103	433 435 434
+	12	1 103	436 437 438
+	13	1 103	439 441 440
+	14	1 103	442 443 444
+	15	1 103	445 446 447
+	16	1 103	448 449 450
+	17	1 103	451 452 453
+	18	1 103	454 455 456
+	19	1 103	457 458 459
+	20	1 103	460 462 461
+	21	1 103	463 465 464
+	22	1 103	466 468 467
+	23	1 103	469 471 470
+	24	1 103	472 474 473
+	25	1 103	475 477 476
+	26	1 103	478 479 480
+	27	1 103	481 483 482
+	28	1 103	484 486 485
+	29	1 103	487 488 489
+	30	1 103	490 492 491
+	31	1 103	493 495 494
+	32	1 103	496 497 498
+	33	1 103	499 501 500
+	34	1 103	502 503 504
+	35	1 103	505 506 507
+	36	1 103	508 510 509
+	37	1 103	511 512 513
+	38	1 103	514 516 515
+	39	1 103	517 519 518
+	40	1 103	520 522 521
+	41	1 103	523 524 525
+	42	1 103	526 528 527
+	43	1 103	529 530 531
+	44	1 103	532 533 534
+	45	1 103	535 537 536
+	46	1 103	538 540 539
+	47	1 103	541 542 543
+	48	1 103	544 546 545
+	49	1 103	547 548 549
+	50	1 103	550 551 552
+	51	1 103	553 555 554
+	52	1 103	556 558 557
+	53	1 103	559 560 561
+	54	1 103	562 564 563
+	55	1 103	565 566 567
+	56	1 103	568 569 570
+	57	1 103	571 573 572
+	58	1 103	574 576 575
+	59	1 103	577 578 579
+	60	1 103	580 582 581
+	61	1 103	583 584 585
+	62	1 103	586 588 587
+	63	1 103	589 590 591
+	64	1 103	592 593 594
+	65	1 103	595 596 597
+	66	1 103	598 599 600
+	67	1 103	601 603 602
+	68	1 103	604 606 605
+	69	1 103	607 608 609
+	70	1 103	610 611 612
+	71	1 103	613 615 614
+	72	1 103	616 617 618
+	73	1 103	619 620 621
+	74	1 103	622 624 623
+	75	1 103	625 626 627
+	76	1 103	628 629 630
+	77	1 103	631 633 632
+	78	1 103	634 635 636
+	79	1 103	637 638 639
+	80	1 103	640 641 642
+	81	1 103	223 405 345
+	82	1 103	224 403 343
+	83	1 103	225 404 344
+	84	1 103	226 348 408
+	85	1 103	227 346 406
+	86	1 103	228 347 407
+	87	1 103	229 351 411
+	88	1 103	230 349 409
+	89	1 103	231 350 410
+	90	1 103	232 354 414
+	91	1 103	233 352 412
+	92	1 103	234 353 413
+	93	1 103	235 417 357
+	94	1 103	236 415 355
+	95	1 103	237 416 356
+	96	1 103	238 420 360
+	97	1 103	239 418 358
+	98	1 103	240 419 359
+	99	1 103	241 363 423
+	100	1 103	242 361 421
+	101	1 103	243 362 422
+	102	1 103	244 426 366
+	103	1 103	245 424 364
+	104	1 103	246 425 365
+	105	1 103	247 369 429
+	106	1 103	248 367 427
+	107	1 103	249 368 428
+	108	1 103	250 432 372
+	109	1 103	251 430 370
+	110	1 103	252 431 371
+	111	1 103	253 375 435
+	112	1 103	254 373 433
+	113	1 103	255 374 434
+	114	1 103	256 438 378
+	115	1 103	257 436 376
+	116	1 103	258 437 377
+	117	1 103	259 381 441
+	118	1 103	260 379 439
+	119	1 103	261 380 440
+	120	1 103	262 444 384
+	121	1 103	263 442 382
+	122	1 103	264 443 383
+	123	1 103	265 447 387
+	124	1 103	266 445 385
+	125	1 103	267 446 386
+	126	1 103	268 450 390
+	127	1 103	269 448 388
+	128	1 103	270 449 389
+	129	1 103	271 453 393
+	130	1 103	272 451 391
+	131	1 103	273 452 392
+	132	1 103	274 456 396
+	133	1 103	275 454 394
+	134	1 103	276 455 395
+	135	1 103	277 459 399
+	136	1 103	278 457 397
+	137	1 103	279 458 398
+	138	1 103	280 402 462
+	139	1 103	281 400 460
+	140	1 103	282 401 461
+	141	1 103	283 345 465
+	142	1 103	225 315 464
+	143	1 103	163 463 195
+	144	1 103	223 313 467
+	145	1 103	284 343 468
+	146	1 103	164 466 193
+	147	1 103	224 314 470
+	148	1 103	285 344 471
+	149	1 103	165 469 194
+	150	1 103	227 474 286
+	151	1 103	317 473 347
+	152	1 103	166 472 197
+	153	1 103	226 477 313
+	154	1 103	316 476 346
+	155	1 103	193 475 196
+	156	1 103	283 480 348
+	157	1 103	228 479 287
+	158	1 103	163 167 478
+	159	1 103	230 483 288
+	160	1 103	319 482 350
+	161	1 103	168 481 199
+	162	1 103	229 486 316
+	163	1 103	318 485 349
+	164	1 103	196 484 198
+	165	1 103	286 489 351
+	166	1 103	231 488 289
+	167	1 103	166 169 487
+	168	1 103	233 492 290
+	169	1 103	321 491 353
+	170	1 103	170 490 201
+	171	1 103	232 495 318
+	172	1 103	320 494 352
+	173	1 103	198 493 200
+	174	1 103	288 498 354
+	175	1 103	234 497 291
+	176	1 103	168 171 496
+	177	1 103	314 357 501
+	178	1 103	237 322 500
+	179	1 103	194 499 202
+	180	1 103	235 284 504
+	181	1 103	320 355 503
+	182	1 103	164 200 502
+	183	1 103	236 290 507
+	184	1 103	292 356 506
+	185	1 103	170 172 505
+	186	1 103	315 360 510
+	187	1 103	240 324 509
+	188	1 103	195 508 204
+	189	1 103	238 285 513
+	190	1 103	293 358 512
+	191	1 103	165 173 511
+	192	1 103	239 323 515
+	193	1 103	294 359 516
+	194	1 103	174 514 203
+	195	1 103	242 519 295
+	196	1 103	326 518 362
+	197	1 103	175 517 206
+	198	1 103	241 522 324
+	199	1 103	325 521 361
+	200	1 103	204 520 205
+	201	1 103	294 525 363
+	202	1 103	243 524 296
+	203	1 103	174 176 523
+	204	1 103	317 366 528
+	205	1 103	246 327 527
+	206	1 103	197 526 207
+	207	1 103	244 287 531
+	208	1 103	325 364 530
+	209	1 103	167 205 529
+	210	1 103	245 295 534
+	211	1 103	297 365 533
+	212	1 103	175 177 532
+	213	1 103	248 537 298
+	214	1 103	329 536 368
+	215	1 103	178 535 209
+	216	1 103	247 540 327
+	217	1 103	328 539 367
+	218	1 103	207 538 208
+	219	1 103	297 543 369
+	220	1 103	249 542 299
+	221	1 103	177 179 541
+	222	1 103	319 372 546
+	223	1 103	252 330 545
+	224	1 103	199 544 210
+	225	1 103	250 289 549
+	226	1 103	328 370 548
+	227	1 103	169 208 547
+	228	1 103	251 298 552
+	229	1 103	300 371 551
+	230	1 103	178 180 550
+	231	1 103	254 555 301
+	232	1 103	332 554 374
+	233	1 103	181 553 212
+	234	1 103	253 558 330
+	235	1 103	331 557 373
+	236	1 103	210 556 211
+	237	1 103	300 561 375
+	238	1 103	255 560 302
+	239	1 103	180 182 559
+	240	1 103	321 378 564
+	241	1 103	258 333 563
+	242	1 103	201 562 213
+	243	1 103	256 291 567
+	244	1 103	331 376 566
+	245	1 103	171 211 565
+	246	1 103	257 301 570
+	247	1 103	303 377 569
+	248	1 103	181 183 568
+	249	1 103	260 573 304
+	250	1 103	335 572 380
+	251	1 103	184 571 215
+	252	1 103	259 576 333
+	253	1 103	334 575 379
+	254	1 103	213 574 214
+	255	1 103	303 579 381
+	256	1 103	261 578 305
+	257	1 103	183 185 577
+	258	1 103	323 384 582
+	259	1 103	264 337 581
+	260	1 103	203 580 217
+	261	1 103	262 293 585
+	262	1 103	306 382 584
+	263	1 103	173 186 583
+	264	1 103	263 336 587
+	265	1 103	307 383 588
+	266	1 103	187 586 216
+	267	1 103	322 387 590
+	268	1 103	267 306 591
+	269	1 103	186 202 589
+	270	1 103	265 292 594
+	271	1 103	334 385 593
+	272	1 103	172 214 592
+	273	1 103	266 304 597
+	274	1 103	336 386 596
+	275	1 103	184 216 595
+	276	1 103	268 296 600
+	277	1 103	308 388 599
+	278	1 103	176 188 598
+	279	1 103	269 338 602
+	280	1 103	309 389 603
+	281	1 103	189 601 218
+	282	1 103	326 390 606
+	283	1 103	270 339 605
+	284	1 103	206 604 219
+	285	1 103	271 299 609
+	286	1 103	339 391 608
+	287	1 103	179 219 607
+	288	1 103	272 309 612
+	289	1 103	310 392 611
+	290	1 103	189 190 610
+	291	1 103	329 393 615
+	292	1 103	273 340 614
+	293	1 103	209 613 220
+	294	1 103	274 302 618
+	295	1 103	340 394 617
+	296	1 103	182 220 616
+	297	1 103	275 310 621
+	298	1 103	311 395 620
+	299	1 103	190 191 619
+	300	1 103	332 396 624
+	301	1 103	276 341 623
+	302	1 103	212 622 221
+	303	1 103	277 305 627
+	304	1 103	341 397 626
+	305	1 103	185 221 625
+	306	1 103	278 311 630
+	307	1 103	312 398 629
+	308	1 103	191 192 628
+	309	1 103	335 399 633
+	310	1 103	279 342 632
+	311	1 103	215 631 222
+	312	1 103	307 636 402
+	313	1 103	282 635 342
+	314	1 103	187 222 634
+	315	1 103	281 638 338
+	316	1 103	312 639 401
+	317	1 103	192 218 637
+	318	1 103	280 641 337
+	319	1 103	308 642 400
+	320	1 103	188 217 640
+	321	1 103	403 405 103
+	322	1 103	403 104 404
+	323	1 103	404 105 405
+	324	1 103	406 106 408
+	325	1 103	406 407 107
+	326	1 103	407 408 108
+	327	1 103	409 109 411
+	328	1 103	409 410 110
+	329	1 103	410 411 111
+	330	1 103	412 112 414
+	331	1 103	412 413 113
+	332	1 103	413 414 114
+	333	1 103	415 417 115
+	334	1 103	415 116 416
+	335	1 103	416 117 417
+	336	1 103	418 420 118
+	337	1 103	418 119 419
+	338	1 103	419 120 420
+	339	1 103	421 121 423
+	340	1 103	421 422 122
+	341	1 103	422 423 123
+	342	1 103	424 426 124
+	343	1 103	424 125 425
+	344	1 103	425 126 426
+	345	1 103	427 127 429
+	346	1 103	427 428 128
+	347	1 103	428 429 129
+	348	1 103	430 432 130
+	349	1 103	430 131 431
+	350	1 103	431 132 432
+	351	1 103	433 133 435
+	352	1 103	433 434 134
+	353	1 103	434 435 135
+	354	1 103	436 438 136
+	355	1 103	436 137 437
+	356	1 103	437 138 438
+	357	1 103	439 139 441
+	358	1 103	439 440 140
+	359	1 103	440 441 141
+	360	1 103	442 444 142
+	361	1 103	442 143 443
+	362	1 103	443 144 444
+	363	1 103	445 447 145
+	364	1 103	445 146 446
+	365	1 103	446 147 447
+	366	1 103	448 450 148
+	367	1 103	448 149 449
+	368	1 103	449 150 450
+	369	1 103	451 453 151
+	370	1 103	451 152 452
+	371	1 103	452 153 453
+	372	1 103	454 456 154
+	373	1 103	454 155 455
+	374	1 103	455 156 456
+	375	1 103	457 459 157
+	376	1 103	457 158 458
+	377	1 103	458 159 459
+	378	1 103	460 160 462
+	379	1 103	460 461 161
+	380	1 103	461 462 162
+	381	1 103	463 43 465
+	382	1 103	463 464 75
+	383	1 103	464 465 105
+	384	1 103	466 44 468
+	385	1 103	466 467 73
+	386	1 103	467 468 103
+	387	1 103	469 45 471
+	388	1 103	469 470 74
+	389	1 103	470 471 104
+	390	1 103	472 46 474
+	391	1 103	472 473 77
+	392	1 103	473 474 107
+	393	1 103	475 73 477
+	394	1 103	475 476 76
+	395	1 103	476 477 106
+	396	1 103	478 480 43
+	397	1 103	478 47 479
+	398	1 103	479 108 480
+	399	1 103	481 48 483
+	400	1 103	481 482 79
+	401	1 103	482 483 110
+	402	1 103	484 76 486
+	403	1 103	484 485 78
+	404	1 103	485 486 109
+	405	1 103	487 489 46
+	406	1 103	487 49 488
+	407	1 103	488 111 489
+	408	1 103	490 50 492
+	409	1 103	490 491 81
+	410	1 103	491 492 113
+	411	1 103	493 78 495
+	412	1 103	493 494 80
+	413	1 103	494 495 112
+	414	1 103	496 498 48
+	415	1 103	496 51 497
+	416	1 103	497 114 498
+	417	1 103	499 74 501
+	418	1 103	499 500 82
+	419	1 103	500 501 117
+	420	1 103	502 504 44
+	421	1 103	502 80 503
+	422	1 103	503 115 504
+	423	1 103	505 507 50
+	424	1 103	505 52 506
+	425	1 103	506 116 507
+	426	1 103	508 75 510
+	427	1 103	508 509 84
+	428	1 103	509 510 120
+	429	1 103	511 513 45
+	430	1 103	511 53 512
+	431	1 103	512 118 513
+	432	1 103	514 54 516
+	433	1 103	514 515 83
+	434	1 103	515 516 119
+	435	1 103	517 55 519
+	436	1 103	517 518 86
+	437	1 103	518 519 122
+	438	1 103	520 84 522
+	439	1 103	520 521 85
+	440	1 103	521 522 121
+	441	1 103	523 525 54
+	442	1 103	523 56 524
+	443	1 103	524 123 525
+	444	1 103	526 77 528
+	445	1 103	526 527 87
+	446	1 103	527 528 126
+	447	1 103	529 531 47
+	448	1 103	529 85 530
+	449	1 103	530 124 531
+	450	1 103	532 534 55
+	451	1 103	532 57 533
+	452	1 103	533 125 534
+	453	1 103	535 58 537
+	454	1 103	535 536 89
+	455	1 103	536 537 128
+	456	1 103	538 87 540
+	457	1 103	538 539 88
+	458	1 103	539 540 127
+	459	1 103	541 543 57
+	460	1 103	541 59 542
+	461	1 103	542 129 543
+	462	1 103	544 79 546
+	463	1 103	544 545 90
+	464	1 103	545 546 132
+	465	1 103	547 549 49
+	466	1 103	547 88 548
+	467	1 103	548 130 549
+	468	1 103	550 552 58
+	469	1 103	550 60 551
+	470	1 103	551 131 552
+	471	1 103	553 61 555
+	472	1 103	553 554 92
+	473	1 103	554 555 134
+	474	1 103	556 90 558
+	475	1 103	556 557 91
+	476	1 103	557 558 133
+	477	1 103	559 561 60
+	478	1 103	559 62 560
+	479	1 103	560 135 561
+	480	1 103	562 81 564
+	481	1 103	562 563 93
+	482	1 103	563 564 138
+	483	1 103	565 567 51
+	484	1 103	565 91 566
+	485	1 103	566 136 567
+	486	1 103	568 570 61
+	487	1 103	568 63 569
+	488	1 103	569 137 570
+	489	1 103	571 64 573
+	490	1 103	571 572 95
+	491	1 103	572 573 140
+	492	1 103	574 93 576
+	493	1 103	574 575 94
+	494	1 103	575 576 139
+	495	1 103	577 579 63
+	496	1 103	577 65 578
+	497	1 103	578 141 579
+	498	1 103	580 83 582
+	499	1 103	580 581 97
+	500	1 103	581 582 144
+	501	1 103	583 585 53
+	502	1 103	583 66 584
+	503	1 103	584 142 585
+	504	1 103	586 67 588
+	505	1 103	586 587 96
+	506	1 103	587 588 143
+	507	1 103	589 591 66
+	508	1 103	589 82 590
+	509	1 103	590 147 591
+	510	1 103	592 594 52
+	511	1 103	592 94 593
+	512	1 103	593 145 594
+	513	1 103	595 597 64
+	514	1 103	595 96 596
+	515	1 103	596 146 597
+	516	1 103	598 600 56
+	517	1 103	598 68 599
+	518	1 103	599 148 600
+	519	1 103	601 69 603
+	520	1 103	601 602 98
+	521	1 103	602 603 149
+	522	1 103	604 86 606
+	523	1 103	604 605 99
+	524	1 103	605 606 150
+	525	1 103	607 609 59
+	526	1 103	607 99 608
+	527	1 103	608 151 609
+	528	1 103	610 612 69
+	529	1 103	610 70 611
+	530	1 103	611 152 612
+	531	1 103	613 89 615
+	532	1 103	613 614 100
+	533	1 103	614 615 153
+	534	1 103	616 618 62
+	535	1 103	616 100 617
+	536	1 103	617 154 618
+	537	1 103	619 621 70
+	538	1 103	619 71 620
+	539	1 103	620 155 621
+	540	1 103	622 92 624
+	541	1 103	622 623 101
+	542	1 103	623 624 156
+	543	1 103	625 627 65
+	544	1 103	625 101 626
+	545	1 103	626 157 627
+	546	1 103	628 630 71
+	547	1 103	628 72 629
+	548	1 103	629 158 630
+	549	1 103	631 95 633
+	550	1 103	631 632 102
+	551	1 103	632 633 159
+	552	1 103	634 636 67
+	553	1 103	634 102 635
+	554	1 103	635 162 636
+	555	1 103	637 639 72
+	556	1 103	637 98 638
+	557	1 103	638 161 639
+	558	1 103	640 642 68
+	559	1 103	640 97 641
+	560	1 103	641 160 642
+	561	1 103	223 103 405
+	562	1 103	345 405 105
+	563	1 103	223 345 13
+	564	1 103	343 403 103
+	565	1 103	224 104 403
+	566	1 103	224 343 14
+	567	1 103	344 404 104
+	568	1 103	225 105 404
+	569	1 103	225 344 15
+	570	1 103	226 408 106
+	571	1 103	348 108 408
+	572	1 103	226 13 348
+	573	1 103	346 106 406
+	574	1 103	227 406 107
+	575	1 103	227 16 346
+	576	1 103	347 107 407
+	577	1 103	228 407 108
+	578	1 103	228 17 347
+	579	1 103	229 411 109
+	580	1 103	351 111 411
+	581	1 103	229 16 351
+	582	1 103	349 109 409
+	583	1 103	230 409 110
+	584	1 103	230 18 349
+	585	1 103	350 110 410
+	586	1 103	231 410 111
+	587	1 103	231 19 350
+	588	1 103	232 414 112
+	589	1 103	354 114 414
+	590	1 103	232 18 354
+	591	1 103	352 112 412
+	592	1 103	233 412 113
+	593	1 103	233 20 352
+	594	1 103	353 113 413
+	595	1 103	234 413 114
+	596	1 103	234 21 353
+	597	1 103	235 115 417
+	598	1 103	357 417 117
+	599	1 103	235 357 14
+	600	1 103	355 415 115
+	601	1 103	236 116 415
+	602	1 103	236 355 20
+	603	1 103	356 416 116
+	604	1 103	237 117 416
+	605	1 103	237 356 22
+	606	1 103	238 118 420
+	607	1 103	360 420 120
+	608	1 103	238 360 15
+	609	1 103	358 418 118
+	610	1 103	239 119 418
+	611	1 103	239 358 23
+	612	1 103	359 419 119
+	613	1 103	240 120 419
+	614	1 103	240 359 24
+	615	1 103	241 423 121
+	616	1 103	363 123 423
+	617	1 103	241 24 363
+	618	1 103	361 121 421
+	619	1 103	242 421 122
+	620	1 103	242 25 361
+	621	1 103	362 122 422
+	622	1 103	243 422 123
+	623	1 103	243 26 362
+	624	1 103	244 124 426
+	625	1 103	366 426 126
+	626	1 103	244 366 17
+	627	1 103	364 424 124
+	628	1 103	245 125 424
+	629	1 103	245 364 25
+	630	1 103	365 425 125
+	631	1 103	246 126 425
+	632	1 103	246 365 27
+	633	1 103	247 429 127
+	634	1 103	369 129 429
+	635	1 103	247 27 369
+	636	1 103	367 127 427
+	637	1 103	248 427 128
+	638	1 103	248 28 367
+	639	1 103	368 128 428
+	640	1 103	249 428 129
+	641	1 103	249 29 368
+	642	1 103	250 130 432
+	643	1 103	372 432 132
+	644	1 103	250 372 19
+	645	1 103	370 430 130
+	646	1 103	251 131 430
+	647	1 103	251 370 28
+	648	1 103	371 431 131
+	649	1 103	252 132 431
+	650	1 103	252 371 30
+	651	1 103	253 435 133
+	652	1 103	375 135 435
+	653	1 103	253 30 375
+	654	1 103	373 133 433
+	655	1 103	254 433 134
+	656	1 103	254 31 373
+	657	1 103	374 134 434
+	658	1 103	255 434 135
+	659	1 103	255 32 374
+	660	1 103	256 136 438
+	661	1 103	378 438 138
+	662	1 103	256 378 21
+	663	1 103	376 436 136
+	664	1 103	257 137 436
+	665	1 103	257 376 31
+	666	1 103	377 437 137
+	667	1 103	258 138 437
+	668	1 103	258 377 33
+	669	1 103	259 441 139
+	670	1 103	381 141 441
+	671	1 103	259 33 381
+	672	1 103	379 139 439
+	673	1 103	260 439 140
+	674	1 103	260 34 379
+	675	1 103	380 140 440
+	676	1 103	261 440 141
+	677	1 103	261 35 380
+	678	1 103	262 142 444
+	679	1 103	384 444 144
+	680	1 103	262 384 23
+	681	1 103	382 442 142
+	682	1 103	263 143 442
+	683	1 103	263 382 36
+	684	1 103	383 443 143
+	685	1 103	264 144 443
+	686	1 103	264 383 37
+	687	1 103	265 145 447
+	688	1 103	387 447 147
+	689	1 103	265 387 22
+	690	1 103	385 445 145
+	691	1 103	266 146 445
+	692	1 103	266 385 34
+	693	1 103	386 446 146
+	694	1 103	267 147 446
+	695	1 103	267 386 36
+	696	1 103	268 148 450
+	697	1 103	390 450 150
+	698	1 103	268 390 26
+	699	1 103	388 448 148
+	700	1 103	269 149 448
+	701	1 103	269 388 38
+	702	1 103	389 449 149
+	703	1 103	270 150 449
+	704	1 103	270 389 39
+	705	1 103	271 151 453
+	706	1 103	393 453 153
+	707	1 103	271 393 29
+	708	1 103	391 451 151
+	709	1 103	272 152 451
+	710	1 103	272 391 39
+	711	1 103	392 452 152
+	712	1 103	273 153 452
+	713	1 103	273 392 40
+	714	1 103	274 154 456
+	715	1 103	396 456 156
+	716	1 103	274 396 32
+	717	1 103	394 454 154
+	718	1 103	275 155 454
+	719	1 103	275 394 40
+	720	1 103	395 455 155
+	721	1 103	276 156 455
+	722	1 103	276 395 41
+	723	1 103	277 157 459
+	724	1 103	399 459 159
+	725	1 103	277 399 35
+	726	1 103	397 457 157
+	727	1 103	278 158 457
+	728	1 103	278 397 41
+	729	1 103	398 458 158
+	730	1 103	279 159 458
+	731	1 103	279 398 42
+	732	1 103	280 462 160
+	733	1 103	402 162 462
+	734	1 103	280 37 402
+	735	1 103	400 160 460
+	736	1 103	281 460 161
+	737	1 103	281 38 400
+	738	1 103	401 161 461
+	739	1 103	282 461 162
+	740	1 103	282 42 401
+	741	1 103	283 465 43
+	742	1 103	345 105 465
+	743	1 103	283 13 345
+	744	1 103	315 75 464
+	745	1 103	225 464 105
+	746	1 103	225 15 315
+	747	1 103	163 43 463
+	748	1 103	195 463 75
+	749	1 103	163 195 3
+	750	1 103	313 73 467
+	751	1 103	223 467 103
+	752	1 103	223 13 313
+	753	1 103	284 468 44
+	754	1 103	343 103 468
+	755	1 103	284 14 343
+	756	1 103	164 44 466
+	757	1 103	193 466 73
+	758	1 103	164 193 1
+	759	1 103	314 74 470
+	760	1 103	224 470 104
+	761	1 103	224 14 314
+	762	1 103	285 471 45
+	763	1 103	344 104 471
+	764	1 103	285 15 344
+	765	1 103	165 45 469
+	766	1 103	194 469 74
+	767	1 103	165 194 2
+	768	1 103	286 474 46
+	769	1 103	227 107 474
+	770	1 103	227 286 16
+	771	1 103	317 77 473
+	772	1 103	347 473 107
+	773	1 103	317 347 17
+	774	1 103	166 46 472
+	775	1 103	197 472 77
+	776	1 103	166 197 4
+	777	1 103	313 477 73
+	778	1 103	226 106 477
+	779	1 103	226 313 13
+	780	1 103	316 76 476
+	781	1 103	346 476 106
+	782	1 103	316 346 16
+	783	1 103	193 73 475
+	784	1 103	196 475 76
+	785	1 103	193 196 1
+	786	1 103	283 43 480
+	787	1 103	348 480 108
+	788	1 103	283 348 13
+	789	1 103	287 479 47
+	790	1 103	228 108 479
+	791	1 103	228 287 17
+	792	1 103	163 478 43
+	793	1 103	167 47 478
+	794	1 103	163 3 167
+	795	1 103	288 483 48
+	796	1 103	230 110 483
+	797	1 103	230 288 18
+	798	1 103	319 79 482
+	799	1 103	350 482 110
+	800	1 103	319 350 19
+	801	1 103	168 48 481
+	802	1 103	199 481 79
+	803	1 103	168 199 5
+	804	1 103	316 486 76
+	805	1 103	229 109 486
+	806	1 103	229 316 16
+	807	1 103	318 78 485
+	808	1 103	349 485 109
+	809	1 103	318 349 18
+	810	1 103	196 76 484
+	811	1 103	198 484 78
+	812	1 103	196 198 1
+	813	1 103	286 46 489
+	814	1 103	351 489 111
+	815	1 103	286 351 16
+	816	1 103	289 488 49
+	817	1 103	231 111 488
+	818	1 103	231 289 19
+	819	1 103	166 487 46
+	820	1 103	169 49 487
+	821	1 103	166 4 169
+	822	1 103	290 492 50
+	823	1 103	233 113 492
+	824	1 103	233 290 20
+	825	1 103	321 81 491
+	826	1 103	353 491 113
+	827	1 103	321 353 21
+	828	1 103	170 50 490
+	829	1 103	201 490 81
+	830	1 103	170 201 6
+	831	1 103	318 495 78
+	832	1 103	232 112 495
+	833	1 103	232 318 18
+	834	1 103	320 80 494
+	835	1 103	352 494 112
+	836	1 103	320 352 20
+	837	1 103	198 78 493
+	838	1 103	200 493 80
+	839	1 103	198 200 1
+	840	1 103	288 48 498
+	841	1 103	354 498 114
+	842	1 103	288 354 18
+	843	1 103	291 497 51
+	844	1 103	234 114 497
+	845	1 103	234 291 21
+	846	1 103	168 496 48
+	847	1 103	171 51 496
+	848	1 103	168 5 171
+	849	1 103	314 501 74
+	850	1 103	357 117 501
+	851	1 103	314 14 357
+	852	1 103	322 82 500
+	853	1 103	237 500 117
+	854	1 103	237 22 322
+	855	1 103	194 74 499
+	856	1 103	202 499 82
+	857	1 103	194 202 2
+	858	1 103	284 44 504
+	859	1 103	235 504 115
+	860	1 103	235 14 284
+	861	1 103	320 503 80
+	862	1 103	355 115 503
+	863	1 103	320 20 355
+	864	1 103	164 502 44
+	865	1 103	200 80 502
+	866	1 103	164 1 200
+	867	1 103	290 50 507
+	868	1 103	236 507 116
+	869	1 103	236 20 290
+	870	1 103	292 506 52
+	871	1 103	356 116 506
+	872	1 103	292 22 356
+	873	1 103	170 505 50
+	874	1 103	172 52 505
+	875	1 103	170 6 172
+	876	1 103	315 510 75
+	877	1 103	360 120 510
+	878	1 103	315 15 360
+	879	1 103	324 84 509
+	880	1 103	240 509 120
+	881	1 103	240 24 324
+	882	1 103	195 75 508
+	883	1 103	204 508 84
+	884	1 103	195 204 3
+	885	1 103	285 45 513
+	886	1 103	238 513 118
+	887	1 103	238 15 285
+	888	1 103	293 512 53
+	889	1 103	358 118 512
+	890	1 103	293 23 358
+	891	1 103	165 511 45
+	892	1 103	173 53 511
+	893	1 103	165 2 173
+	894	1 103	323 83 515
+	895	1 103	239 515 119
+	896	1 103	239 23 323
+	897	1 103	294 516 54
+	898	1 103	359 119 516
+	899	1 103	294 24 359
+	900	1 103	174 54 514
+	901	1 103	203 514 83
+	902	1 103	174 203 7
+	903	1 103	295 519 55
+	904	1 103	242 122 519
+	905	1 103	242 295 25
+	906	1 103	326 86 518
+	907	1 103	362 518 122
+	908	1 103	326 362 26
+	909	1 103	175 55 517
+	910	1 103	206 517 86
+	911	1 103	175 206 8
+	912	1 103	324 522 84
+	913	1 103	241 121 522
+	914	1 103	241 324 24
+	915	1 103	325 85 521
+	916	1 103	361 521 121
+	917	1 103	325 361 25
+	918	1 103	204 84 520
+	919	1 103	205 520 85
+	920	1 103	204 205 3
+	921	1 103	294 54 525
+	922	1 103	363 525 123
+	923	1 103	294 363 24
+	924	1 103	296 524 56
+	925	1 103	243 123 524
+	926	1 103	243 296 26
+	927	1 103	174 523 54
+	928	1 103	176 56 523
+	929	1 103	174 7 176
+	930	1 103	317 528 77
+	931	1 103	366 126 528
+	932	1 103	317 17 366
+	933	1 103	327 87 527
+	934	1 103	246 527 126
+	935	1 103	246 27 327
+	936	1 103	197 77 526
+	937	1 103	207 526 87
+	938	1 103	197 207 4
+	939	1 103	287 47 531
+	940	1 103	244 531 124
+	941	1 103	244 17 287
+	942	1 103	325 530 85
+	943	1 103	364 124 530
+	944	1 103	325 25 364
+	945	1 103	167 529 47
+	946	1 103	205 85 529
+	947	1 103	167 3 205
+	948	1 103	295 55 534
+	949	1 103	245 534 125
+	950	1 103	245 25 295
+	951	1 103	297 533 57
+	952	1 103	365 125 533
+	953	1 103	297 27 365
+	954	1 103	175 532 55
+	955	1 103	177 57 532
+	956	1 103	175 8 177
+	957	1 103	298 537 58
+	958	1 103	248 128 537
+	959	1 103	248 298 28
+	960	1 103	329 89 536
+	961	1 103	368 536 128
+	962	1 103	329 368 29
+	963	1 103	178 58 535
+	964	1 103	209 535 89
+	965	1 103	178 209 9
+	966	1 103	327 540 87
+	967	1 103	247 127 540
+	968	1 103	247 327 27
+	969	1 103	328 88 539
+	970	1 103	367 539 127
+	971	1 103	328 367 28
+	972	1 103	207 87 538
+	973	1 103	208 538 88
+	974	1 103	207 208 4
+	975	1 103	297 57 543
+	976	1 103	369 543 129
+	977	1 103	297 369 27
+	978	1 103	299 542 59
+	979	1 103	249 129 542
+	980	1 103	249 299 29
+	981	1 103	177 541 57
+	982	1 103	179 59 541
+	983	1 103	177 8 179
+	984	1 103	319 546 79
+	985	1 103	372 132 546
+	986	1 103	319 19 372
+	987	1 103	330 90 545
+	988	1 103	252 545 132
+	989	1 103	252 30 330
+	990	1 103	199 79 544
+	991	1 103	210 544 90
+	992	1 103	199 210 5
+	993	1 103	289 49 549
+	994	1 103	250 549 130
+	995	1 103	250 19 289
+	996	1 103	328 548 88
+	997	1 103	370 130 548
+	998	1 103	328 28 370
+	999	1 103	169 547 49
+	1000	1 103	208 88 547
+	1001	1 103	169 4 208
+	1002	1 103	298 58 552
+	1003	1 103	251 552 131
+	1004	1 103	251 28 298
+	1005	1 103	300 551 60
+	1006	1 103	371 131 551
+	1007	1 103	300 30 371
+	1008	1 103	178 550 58
+	1009	1 103	180 60 550
+	1010	1 103	178 9 180
+	1011	1 103	301 555 61
+	1012	1 103	254 134 555
+	1013	1 103	254 301 31
+	1014	1 103	332 92 554
+	1015	1 103	374 554 134
+	1016	1 103	332 374 32
+	1017	1 103	181 61 553
+	1018	1 103	212 553 92
+	1019	1 103	181 212 10
+	1020	1 103	330 558 90
+	1021	1 103	253 133 558
+	1022	1 103	253 330 30
+	1023	1 103	331 91 557
+	1024	1 103	373 557 133
+	1025	1 103	331 373 31
+	1026	1 103	210 90 556
+	1027	1 103	211 556 91
+	1028	1 103	210 211 5
+	1029	1 103	300 60 561
+	1030	1 103	375 561 135
+	1031	1 103	300 375 30
+	1032	1 103	302 560 62
+	1033	1 103	255 135 560
+	1034	1 103	255 302 32
+	1035	1 103	180 559 60
+	1036	1 103	182 62 559
+	1037	1 103	180 9 182
+	1038	1 103	321 564 81
+	1039	1 103	378 138 564
+	1040	1 103	321 21 378
+	1041	1 103	333 93 563
+	1042	1 103	258 563 138
+	1043	1 103	258 33 333
+	1044	1 103	201 81 562
+	1045	1 103	213 562 93
+	1046	1 103	201 213 6
+	1047	1 103	291 51 567
+	1048	1 103	256 567 136
+	1049	1 103	256 21 291
+	1050	1 103	331 566 91
+	1051	1 103	376 136 566
+	1052	1 103	331 31 376
+	1053	1 103	171 565 51
+	1054	1 103	211 91 565
+	1055	1 103	171 5 211
+	1056	1 103	301 61 570
+	1057	1 103	257 570 137
+	1058	1 103	257 31 301
+	1059	1 103	303 569 63
+	1060	1 103	377 137 569
+	1061	1 103	303 33 377
+	1062	1 103	181 568 61
+	1063	1 103	183 63 568
+	1064	1 103	181 10 183
+	1065	1 103	304 573 64
+	1066	1 103	260 140 573
+	1067	1 103	260 304 34
+	1068	1 103	335 95 572
+	1069	1 103	380 572 140
+	1070	1 103	335 380 35
+	1071	1 103	184 64 571
+	1072	1 103	215 571 95
+	1073	1 103	184 215 11
+	1074	1 103	333 576 93
+	1075	1 103	259 139 576
+	1076	1 103	259 333 33
+	1077	1 103	334 94 575
+	1078	1 103	379 575 139
+	1079	1 103	334 379 34
+	1080	1 103	213 93 574
+	1081	1 103	214 574 94
+	1082	1 103	213 214 6
+	1083	1 103	303 63 579
+	1084	1 103	381 579 141
+	1085	1 103	303 381 33
+	1086	1 103	305 578 65
+	1087	1 103	261 141 578
+	1088	1 103	261 305 35
+	1089	1 103	183 577 63
+	1090	1 103	185 65 577
+	1091	1 103	183 10 185
+	1092	1 103	323 582 83
+	1093	1 103	384 144 582
+	1094	1 103	323 23 384
+	1095	1 103	337 97 581
+	1096	1 103	264 581 144
+	1097	1 103	264 37 337
+	1098	1 103	203 83 580
+	1099	1 103	217 580 97
+	1100	1 103	203 217 7
+	1101	1 103	293 53 585
+	1102	1 103	262 585 142
+	1103	1 103	262 23 293
+	1104	1 103	306 584 66
+	1105	1 103	382 142 584
+	1106	1 103	306 36 382
+	1107	1 103	173 583 53
+	1108	1 103	186 66 583
+	1109	1 103	173 2 186
+	1110	1 103	336 96 587
+	1111	1 103	263 587 143
+	1112	1 103	263 36 336
+	1113	1 103	307 588 67
+	1114	1 103	383 143 588
+	1115	1 103	307 37 383
+	1116	1 103	187 67 586
+	1117	1 103	216 586 96
+	1118	1 103	187 216 11
+	1119	1 103	322 590 82
+	1120	1 103	387 147 590
+	1121	1 103	322 22 387
+	1122	1 103	306 66 591
+	1123	1 103	267 591 147
+	1124	1 103	267 36 306
+	1125	1 103	186 589 66
+	1126	1 103	202 82 589
+	1127	1 103	186 2 202
+	1128	1 103	292 52 594
+	1129	1 103	265 594 145
+	1130	1 103	265 22 292
+	1131	1 103	334 593 94
+	1132	1 103	385 145 593
+	1133	1 103	334 34 385
+	1134	1 103	172 592 52
+	1135	1 103	214 94 592
+	1136	1 103	172 6 214
+	1137	1 103	304 64 597
+	1138	1 103	266 597 146
+	1139	1 103	266 34 304
+	1140	1 103	336 596 96
+	1141	1 103	386 146 596
+	1142	1 103	336 36 386
+	1143	1 103	184 595 64
+	1144	1 103	216 96 595
+	1145	1 103	184 11 216
+	1146	1 103	296 56 600
+	1147	1 103	268 600 148
+	1148	1 103	268 26 296
+	1149	1 103	308 599 68
+	1150	1 103	388 148 599
+	1151	1 103	308 38 388
+	1152	1 103	176 598 56
+	1153	1 103	188 68 598
+	1154	1 103	176 7 188
+	1155	1 103	338 98 602
+	1156	1 103	269 602 149
+	1157	1 103	269 38 338
+	1158	1 103	309 603 69
+	1159	1 103	389 149 603
+	1160	1 103	309 39 389
+	1161	1 103	189 69 601
+	1162	1 103	218 601 98
+	1163	1 103	189 218 12
+	1164	1 103	326 606 86
+	1165	1 103	390 150 606
+	1166	1 103	326 26 390
+	1167	1 103	339 99 605
+	1168	1 103	270 605 150
+	1169	1 103	270 39 339
+	1170	1 103	206 86 604
+	1171	1 103	219 604 99
+	1172	1 103	206 219 8
+	1173	1 103	299 59 609
+	1174	1 103	271 609 151
+	1175	1 103	271 29 299
+	1176	1 103	339 608 99
+	1177	1 103	391 151 608
+	1178	1 103	339 39 391
+	1179	1 103	179 607 59
+	1180	1 103	219 99 607
+	1181	1 103	179 8 219
+	1182	1 103	309 69 612
+	1183	1 103	272 612 152
+	1184	1 103	272 39 309
+	1185	1 103	310 611 70
+	1186	1 103	392 152 611
+	1187	1 103	310 40 392
+	1188	1 103	189 610 69
+	1189	1 103	190 70 610
+	1190	1 103	189 12 190
+	1191	1 103	329 615 89
+	1192	1 103	393 153 615
+	1193	1 103	329 29 393
+	1194	1 103	340 100 614
+	1195	1 103	273 614 153
+	1196	1 103	273 40 340
+	1197	1 103	209 89 613
+	1198	1 103	220 613 100
+	1199	1 103	209 220 9
+	1200	1 103	302 62 618
+	1201	1 103	274 618 154
+	1202	1 103	274 32 302
+	1203	1 103	340 617 100
+	1204	1 103	394 154 617
+	1205	1 103	340 40 394
+	1206	1 103	182 616 62
+	1207	1 103	220 100 616
+	1208	1 103	182 9 220
+	1209	1 103	310 70 621
+	1210	1 103	275 621 155
+	1211	1 103	275 40 310
+	1212	1 103	311 620 71
+	1213	1 103	395 155 620
+	1214	1 103	311 41 395
+	1215	1 103	190 619 70
+	1216	1 103	191 71 619
+	1217	1 103	190 12 191
+	1218	1 103	332 624 92
+	1219	1 103	396 156 624
+	1220	1 103	332 32 396
+	1221	1 103	341 101 623
+	1222	1 103	276 623 156
+	1223	1 103	276 41 341
+	1224	1 103	212 92 622
+	1225	1 103	221 622 101
+	1226	1 103	212 221 10
+	1227	1 103	305 65 627
+	1228	1 103	277 627 157
+	1229	1 103	277 35 305
+	1230	1 103	341 626 101
+	1231	1 103	397 157 626
+	1232	1 103	341 41 397
+	1233	1 103	185 625 65
+	1234	1 103	221 101 625
+	1235	1 103	185 10 221
+	1236	1 103	311 71 630
+	1237	1 103	278 630 158
+	1238	1 103	278 41 311
+	1239	1 103	312 629 72
+	1240	1 103	398 158 629
+	1241	1 103	312 42 398
+	1242	1 103	191 628 71
+	1243	1 103	192 72 628
+	1244	1 103	191 12 192
+	1245	1 103	335 633 95
+	1246	1 103	399 159 633
+	1247	1 103	335 35 399
+	1248	1 103	342 102 632
+	1249	1 103	279 632 159
+	1250	1 103	279 42 342
+	1251	1 103	215 95 631
+	1252	1 103	222 631 102
+	1253	1 103	215 222 11
+	1254	1 103	307 67 636
+	1255	1 103	402 636 162
+	1256	1 103	307 402 37
+	1257	1 103	342 635 102
+	1258	1 103	282 162 635
+	1259	1 103	282 342 42
+	1260	1 103	187 634 67
+	1261	1 103	222 102 634
+	1262	1 103	187 11 222
+	1263	1 103	338 638 98
+	1264	1 103	281 161 638
+	1265	1 103	281 338 38
+	1266	1 103	312 72 639
+	1267	1 103	401 639 161
+	1268	1 103	312 401 42
+	1269	1 103	192 637 72
+	1270	1 103	218 98 637
+	1271	1 103	192 12 218
+	1272	1 103	337 641 97
+	1273	1 103	280 160 641
+	1274	1 103	280 337 37
+	1275	1 103	308 68 642
+	1276	1 103	400 642 160
+	1277	1 103	308 400 38
+	1278	1 103	188 640 68
+	1279	1 103	217 97 640
+	1280	1 103	188 7 217
+END_ELEM_DATA
+
+BEG_CHARGE_DATA
+	1
+	1 0 0 0 1
+END_CHARGE_DATA
diff --git a/source/TEST/data/HMOFile_test_no_charge.hmo b/source/TEST/data/HMOFile_test_no_charge.hmo
new file mode 100644
index 0000000..fdd6d2b
--- /dev/null
+++ b/source/TEST/data/HMOFile_test_no_charge.hmo
@@ -0,0 +1,1932 @@
+# HYPERMESH file written by BALL::HMOFile
+
+BEG_NODL_DATA
+	642
+	1 0 0 20
+	2 17.8885 0 8.94427
+	3 5.52786 17.013 8.94427
+	4 -14.4721 10.5146 8.94427
+	5 -14.4721 -10.5146 8.94427
+	6 5.52786 -17.013 8.94427
+	7 14.4721 10.5146 -8.94427
+	8 -5.52786 17.013 -8.94427
+	9 -17.8885 0 -8.94427
+	10 -5.52786 -17.013 -8.94427
+	11 14.4721 -10.5146 -8.94427
+	12 0 0 -20
+	13 3.24919 10 17.013
+	14 10.5146 0 17.013
+	15 13.7638 10 10.5146
+	16 -8.50651 6.18034 17.013
+	17 -5.25732 16.1803 10.5146
+	18 -8.50651 -6.18034 17.013
+	19 -17.013 0 10.5146
+	20 3.24919 -10 17.013
+	21 -5.25732 -16.1803 10.5146
+	22 13.7638 -10 10.5146
+	23 19.0211 6.18034 0
+	24 11.7557 16.1803 0
+	25 0 20 0
+	26 5.25732 16.1803 -10.5146
+	27 -11.7557 16.1803 0
+	28 -19.0211 6.18034 0
+	29 -13.7638 10 -10.5146
+	30 -19.0211 -6.18034 0
+	31 -11.7557 -16.1803 0
+	32 -13.7638 -10 -10.5146
+	33 0 -20 0
+	34 11.7557 -16.1803 0
+	35 5.25732 -16.1803 -10.5146
+	36 19.0211 -6.18034 0
+	37 17.013 0 -10.5146
+	38 8.50651 6.18034 -17.013
+	39 -3.24919 10 -17.013
+	40 -10.5146 0 -17.013
+	41 -3.24919 -10 -17.013
+	42 8.50651 -6.18034 -17.013
+	43 4.56217 14.0409 13.4922
+	44 5.46533 0 19.2388
+	45 16.4524 5.19784 10.1144
+	46 -11.9439 8.67777 13.4922
+	47 0.140625 17.2534 10.1144
+	48 -11.9439 -8.67777 13.4922
+	49 -16.3655 5.46533 10.1144
+	50 4.56217 -14.0409 13.4922
+	51 -10.2551 -13.8756 10.1144
+	52 10.0275 -14.0409 10.1144
+	53 19.1851 3.21244 4.64909
+	54 13.6328 13.8756 -4.64909
+	55 -2.87329 19.2388 -4.64909
+	56 10.2551 13.8756 -10.1144
+	57 -8.98372 17.2534 -4.64909
+	58 -19.1851 3.21244 -4.64909
+	59 -10.0275 14.0409 -10.1144
+	60 -19.1851 -3.21244 -4.64909
+	61 -8.98372 -17.2534 -4.64909
+	62 -16.4524 -5.19784 -10.1144
+	63 -2.87329 -19.2388 -4.64909
+	64 13.6328 -13.8756 -4.64909
+	65 -0.140625 -17.2534 -10.1144
+	66 19.1851 -3.21244 4.64909
+	67 16.3655 -5.46533 -10.1144
+	68 11.9439 8.67777 -13.4922
+	69 -1.68888 5.19784 -19.2388
+	70 -5.46533 0 -19.2388
+	71 -1.68888 -5.19784 -19.2388
+	72 4.42155 -3.21244 -19.2388
+	73 1.68888 5.19784 19.2388
+	74 14.7635 0 13.4922
+	75 10.0275 14.0409 10.1144
+	76 -4.42155 3.21244 19.2388
+	77 -10.2551 13.8756 10.1144
+	78 -4.42155 -3.21244 19.2388
+	79 -16.3655 -5.46533 10.1144
+	80 1.68888 -5.19784 19.2388
+	81 0.140625 -17.2534 10.1144
+	82 16.4524 -5.19784 10.1144
+	83 17.4093 8.67777 -4.64909
+	84 8.98372 17.2534 4.64909
+	85 2.87329 19.2388 4.64909
+	86 -0.140625 17.2534 -10.1144
+	87 -13.6328 13.8756 4.64909
+	88 -17.4093 8.67777 4.64909
+	89 -16.4524 5.19784 -10.1144
+	90 -17.4093 -8.67777 4.64909
+	91 -13.6328 -13.8756 4.64909
+	92 -10.0275 -14.0409 -10.1144
+	93 2.87329 -19.2388 4.64909
+	94 8.98372 -17.2534 4.64909
+	95 10.2551 -13.8756 -10.1144
+	96 17.4093 -8.67777 -4.64909
+	97 16.3655 5.46533 -10.1144
+	98 4.42155 3.21244 -19.2388
+	99 -4.56217 14.0409 -13.4922
+	100 -14.7635 0 -13.4922
+	101 -4.56217 -14.0409 -13.4922
+	102 11.9439 -8.67777 -13.4922
+	103 7.23607 5.25731 17.8885
+	104 12.7639 5.25731 14.4721
+	105 8.94427 10.5146 14.4721
+	106 -2.76393 8.50651 17.8885
+	107 -7.23607 11.7557 14.4721
+	108 -1.05573 13.7638 14.4721
+	109 -8.94427 0 17.8885
+	110 -13.4164 -3.2492 14.4721
+	111 -13.4164 3.2492 14.4721
+	112 -2.76393 -8.50651 17.8885
+	113 -1.05573 -13.7638 14.4721
+	114 -7.23607 -11.7557 14.4721
+	115 7.23607 -5.25731 17.8885
+	116 8.94427 -10.5146 14.4721
+	117 12.7639 -5.25731 14.4721
+	118 17.2361 8.50651 5.52786
+	119 16.1803 11.7557 0
+	120 13.4164 13.7638 5.52786
+	121 6.18034 19.0211 0
+	122 2.76393 19.0211 -5.52786
+	123 8.94427 17.013 -5.52786
+	124 -2.76393 19.0211 5.52786
+	125 -6.18034 19.0211 0
+	126 -8.94427 17.013 5.52786
+	127 -16.1803 11.7557 0
+	128 -17.2361 8.50651 -5.52786
+	129 -13.4164 13.7638 -5.52786
+	130 -18.9443 3.2492 5.52786
+	131 -20 0 0
+	132 -18.9443 -3.2492 5.52786
+	133 -16.1803 -11.7557 0
+	134 -13.4164 -13.7638 -5.52786
+	135 -17.2361 -8.50651 -5.52786
+	136 -8.94427 -17.013 5.52786
+	137 -6.18034 -19.0211 0
+	138 -2.76393 -19.0211 5.52786
+	139 6.18034 -19.0211 0
+	140 8.94427 -17.013 -5.52786
+	141 2.76393 -19.0211 -5.52786
+	142 20 0 0
+	143 18.9443 -3.2492 -5.52786
+	144 18.9443 3.2492 -5.52786
+	145 13.4164 -13.7638 5.52786
+	146 16.1803 -11.7557 0
+	147 17.2361 -8.50651 5.52786
+	148 7.23607 11.7557 -14.4721
+	149 2.76393 8.50651 -17.8885
+	150 1.05573 13.7638 -14.4721
+	151 -8.94427 10.5146 -14.4721
+	152 -7.23607 5.25731 -17.8885
+	153 -12.7639 5.25731 -14.4721
+	154 -12.7639 -5.25731 -14.4721
+	155 -7.23607 -5.25731 -17.8885
+	156 -8.94427 -10.5146 -14.4721
+	157 1.05573 -13.7638 -14.4721
+	158 2.76393 -8.50651 -17.8885
+	159 7.23607 -11.7557 -14.4721
+	160 13.4164 3.2492 -14.4721
+	161 8.94427 0 -17.8885
+	162 13.4164 -3.2492 -14.4721
+	163 5.09372 15.6769 11.3265
+	164 2.75904 0 19.8088
+	165 17.3362 2.62401 9.62134
+	166 -13.3355 9.68883 11.3265
+	167 2.8616 17.2986 9.62133
+	168 -13.3355 -9.68883 11.3265
+	169 -15.5677 8.06711 9.62133
+	170 5.09372 -15.6769 11.3265
+	171 -12.4829 -12.3128 9.62133
+	172 7.85276 -15.6769 9.62133
+	173 18.7157 1.62173 6.86229
+	174 14.1881 12.3128 -6.86229
+	175 -4.24113 18.3009 -6.86229
+	176 12.4829 12.3128 -9.62133
+	177 -7.32583 17.2986 -6.86229
+	178 -18.7157 1.62173 -6.86229
+	179 -7.85276 15.6769 -9.62133
+	180 -18.7157 -1.62173 -6.86229
+	181 -7.32583 -17.2986 -6.86229
+	182 -17.3362 -2.62401 -9.62134
+	183 -4.24113 -18.3009 -6.86229
+	184 14.1881 -12.3128 -6.86229
+	185 -2.8616 -17.2986 -9.62133
+	186 18.7157 -1.62173 6.86229
+	187 15.5677 -8.06711 -9.62133
+	188 13.3355 9.68883 -11.3265
+	189 -0.852591 2.62401 -19.8088
+	190 -2.75904 0 -19.8088
+	191 -0.852591 -2.62401 -19.8088
+	192 2.23211 -1.62173 -19.8088
+	193 0.852591 2.62401 19.8088
+	194 16.4836 0 11.3265
+	195 7.85276 15.6769 9.62133
+	196 -2.23211 1.62173 19.8088
+	197 -12.4829 12.3128 9.62133
+	198 -2.23211 -1.62173 19.8088
+	199 -15.5677 -8.06711 9.62133
+	200 0.852591 -2.62401 19.8088
+	201 2.8616 -17.2986 9.62133
+	202 17.3362 -2.62401 9.62134
+	203 16.0946 9.68883 -6.86229
+	204 7.32583 17.2986 6.86229
+	205 4.24113 18.3009 6.86229
+	206 -2.8616 17.2986 -9.62133
+	207 -14.1881 12.3128 6.86229
+	208 -16.0946 9.68883 6.86229
+	209 -17.3362 2.62401 -9.62134
+	210 -16.0946 -9.68883 6.86229
+	211 -14.1881 -12.3128 6.86229
+	212 -7.85276 -15.6769 -9.62133
+	213 4.24113 -18.3009 6.86229
+	214 7.32583 -17.2986 6.86229
+	215 12.4829 -12.3128 -9.62133
+	216 16.0946 -9.68883 -6.86229
+	217 15.5677 8.06711 -9.62133
+	218 2.23211 1.62173 -19.8088
+	219 -5.09372 15.6769 -11.3265
+	220 -16.4836 0 -11.3265
+	221 -5.09372 -15.6769 -11.3265
+	222 13.3355 -9.68883 -11.3265
+	223 5.30798 7.72375 17.6683
+	224 11.7844 2.66142 15.9388
+	225 11.4956 10.3852 12.6491
+	226 0.245654 9.3686 17.6683
+	227 -7.96941 9.07981 15.9388
+	228 -3.19587 15.1587 12.6491
+	229 -8.83416 3.12869 17.6683
+	230 -11.0981 -4.77354 15.9388
+	231 -15.4044 1.64485 12.6491
+	232 -5.70547 -7.43496 17.6683
+	233 1.1104 -12.03 15.9388
+	234 -6.32456 -14.1421 12.6491
+	235 8.98598 -2.66142 17.6683
+	236 6.17273 -10.3852 15.9388
+	237 13.4292 -7.72375 12.6491
+	238 15.6932 9.3686 8.12123
+	239 17.8201 9.07981 0
+	240 12.7429 15.1587 2.79838
+	241 9.07981 17.8201 0
+	242 1.39919 19.7538 -2.79838
+	243 7.18931 16.8036 -8.12123
+	244 -4.06062 17.8201 8.12123
+	245 -3.12869 19.7538 0
+	246 -10.479 16.8036 2.79838
+	247 -14.1421 14.1421 0
+	248 -18.3546 7.43496 -2.79838
+	249 -13.7595 12.03 -8.12123
+	250 -18.2028 1.64485 8.12123
+	251 -19.7538 3.12869 0
+	252 -19.2193 -4.77354 2.79838
+	253 -17.8201 -9.07981 0
+	254 -12.7429 -15.1587 -2.79838
+	255 -15.6932 -9.3686 -8.12123
+	256 -7.18931 -16.8036 8.12123
+	257 -9.07981 -17.8201 0
+	258 -1.39919 -19.7538 2.79838
+	259 3.12869 -19.7538 0
+	260 10.479 -16.8036 -2.79838
+	261 4.06062 -17.8201 -8.12123
+	262 19.7538 3.12869 0
+	263 19.2193 -4.77354 -2.79838
+	264 18.2028 1.64485 -8.12123
+	265 13.7595 -12.03 8.12123
+	266 14.1421 -14.1421 0
+	267 18.3546 -7.43496 2.79838
+	268 6.32456 14.1421 -12.6491
+	269 5.70547 7.43496 -17.6683
+	270 -1.1104 12.03 -15.9388
+	271 -11.4956 10.3852 -12.6491
+	272 -5.30798 7.72375 -17.6683
+	273 -11.7844 2.66142 -15.9388
+	274 -13.4292 -7.72375 -12.6491
+	275 -8.98598 -2.66142 -17.6683
+	276 -6.17273 -10.3852 -15.9388
+	277 3.19587 -15.1587 -12.6491
+	278 -0.245654 -9.3686 -17.6683
+	279 7.96941 -9.07981 -15.9388
+	280 15.4044 1.64485 -12.6491
+	281 8.83416 3.12869 -17.6683
+	282 11.0981 -4.77354 -15.9388
+	283 3.94339 12.1365 15.3998
+	284 8.06711 0 18.3009
+	285 15.2539 7.67228 10.4141
+	286 -10.3239 7.50077 15.3998
+	287 -2.58304 16.8782 10.4141
+	288 -10.3239 -7.50077 15.3998
+	289 -16.8504 2.75904 10.4141
+	290 3.94339 -12.1365 15.3998
+	291 -7.83106 -15.173 10.4141
+	292 12.0105 -12.1365 10.4141
+	293 19.2875 4.74173 2.34698
+	294 12.8168 15.173 -2.34698
+	295 -1.45051 19.8088 -2.34698
+	296 7.83106 15.173 -10.4141
+	297 -10.4698 16.8782 -2.34698
+	298 -19.2875 4.74173 -2.34698
+	299 -12.0105 12.1365 -10.4141
+	300 -19.2875 -4.74173 -2.34698
+	301 -10.4698 -16.8782 -2.34698
+	302 -15.2539 -7.67228 -10.4141
+	303 -1.45051 -19.8088 -2.34698
+	304 12.8168 -15.173 -2.34698
+	305 2.58304 -16.8782 -10.4141
+	306 19.2875 -4.74173 2.34698
+	307 16.8504 -2.75904 -10.4141
+	308 10.3239 7.50077 -15.3998
+	309 -2.49287 7.67228 -18.3009
+	310 -8.06711 0 -18.3009
+	311 -2.49287 -7.67228 -18.3009
+	312 6.52643 -4.74173 -18.3009
+	313 2.49287 7.67228 18.3009
+	314 12.7611 0 15.3998
+	315 12.0105 12.1365 10.4141
+	316 -6.52643 4.74173 18.3009
+	317 -7.83106 15.173 10.4141
+	318 -6.52643 -4.74173 18.3009
+	319 -16.8504 -2.75904 10.4141
+	320 2.49287 -7.67228 18.3009
+	321 -2.58304 -16.8782 10.4141
+	322 15.2539 -7.67228 10.4141
+	323 18.391 7.50077 -2.34698
+	324 10.4698 16.8782 2.34698
+	325 1.45051 19.8088 2.34698
+	326 2.58304 16.8782 -10.4141
+	327 -12.8168 15.173 2.34698
+	328 -18.391 7.50077 2.34698
+	329 -15.2539 7.67228 -10.4141
+	330 -18.391 -7.50077 2.34698
+	331 -12.8168 -15.173 2.34698
+	332 -12.0105 -12.1365 -10.4141
+	333 1.45051 -19.8088 2.34698
+	334 10.4698 -16.8782 2.34698
+	335 7.83106 -15.173 -10.4141
+	336 18.391 -7.50077 -2.34698
+	337 16.8504 2.75904 -10.4141
+	338 6.52643 4.74173 -18.3009
+	339 -3.94339 12.1365 -15.3998
+	340 -12.7611 0 -15.3998
+	341 -3.94339 -12.1365 -15.3998
+	342 10.3239 -7.50077 -15.3998
+	343 8.98598 2.66142 17.6683
+	344 13.4292 7.72375 12.6491
+	345 6.17273 10.3852 15.9388
+	346 -5.70547 7.43496 17.6683
+	347 -6.32456 14.1421 12.6491
+	348 1.1104 12.03 15.9388
+	349 -8.83416 -3.12869 17.6683
+	350 -15.4044 -1.64485 12.6491
+	351 -11.0981 4.77354 15.9388
+	352 0.245654 -9.3686 17.6683
+	353 -3.19587 -15.1587 12.6491
+	354 -7.96941 -9.07981 15.9388
+	355 5.30798 -7.72375 17.6683
+	356 11.4956 -10.3852 12.6491
+	357 11.7844 -2.66142 15.9388
+	358 18.3546 7.43496 2.79838
+	359 14.1421 14.1421 0
+	360 13.7595 12.03 8.12123
+	361 3.12869 19.7538 0
+	362 4.06062 17.8201 -8.12123
+	363 10.479 16.8036 -2.79838
+	364 -1.39919 19.7538 2.79838
+	365 -9.07981 17.8201 0
+	366 -7.18931 16.8036 8.12123
+	367 -17.8201 9.07981 0
+	368 -15.6932 9.3686 -8.12123
+	369 -12.7429 15.1587 -2.79838
+	370 -19.2193 4.77354 2.79838
+	371 -19.7538 -3.12869 0
+	372 -18.2028 -1.64485 8.12123
+	373 -14.1421 -14.1421 0
+	374 -13.7595 -12.03 -8.12123
+	375 -18.3546 -7.43496 -2.79838
+	376 -10.479 -16.8036 2.79838
+	377 -3.12869 -19.7538 0
+	378 -4.06062 -17.8201 8.12123
+	379 9.07981 -17.8201 0
+	380 7.18931 -16.8036 -8.12123
+	381 1.39919 -19.7538 -2.79838
+	382 19.7538 -3.12869 0
+	383 18.2028 -1.64485 -8.12123
+	384 19.2193 4.77354 -2.79838
+	385 12.7429 -15.1587 2.79838
+	386 17.8201 -9.07981 0
+	387 15.6932 -9.3686 8.12123
+	388 7.96941 9.07981 -15.9388
+	389 -0.245654 9.3686 -17.6683
+	390 3.19587 15.1587 -12.6491
+	391 -6.17273 10.3852 -15.9388
+	392 -8.98598 2.66142 -17.6683
+	393 -13.4292 7.72375 -12.6491
+	394 -11.7844 -2.66142 -15.9388
+	395 -5.30798 -7.72375 -17.6683
+	396 -11.4956 -10.3852 -12.6491
+	397 -1.1104 -12.03 -15.9388
+	398 5.70547 -7.43496 -17.6683
+	399 6.32456 -14.1421 -12.6491
+	400 11.0981 4.77354 -15.9388
+	401 8.83416 -3.12869 -17.6683
+	402 15.4044 -1.64485 -12.6491
+	403 10.1346 5.3281 16.3982
+	404 11.0002 7.99214 14.667
+	405 8.19909 7.99214 16.3982
+	406 -5.06732 10.2675 16.3982
+	407 -4.20172 12.9316 14.667
+	408 -1.93555 11.2851 16.3982
+	409 -11.3309 -1.64647 16.3982
+	410 -13.597 0 14.667
+	411 -11.3309 1.64647 16.3982
+	412 -1.93555 -11.2851 16.3982
+	413 -4.20172 -12.9316 14.667
+	414 -5.06732 -10.2675 16.3982
+	415 8.19909 -7.99214 16.3982
+	416 11.0002 -7.99214 14.667
+	417 10.1346 -5.3281 16.3982
+	418 16.9332 10.2675 2.80114
+	419 14.9976 12.9316 2.80114
+	420 15.5326 11.2851 5.60229
+	421 4.53235 19.2772 -2.80114
+	422 5.93292 18.2596 -5.60229
+	423 7.66412 18.2596 -2.80114
+	424 -4.53235 19.2772 2.80114
+	425 -7.66412 18.2596 2.80114
+	426 -5.93292 18.2596 5.60229
+	427 -16.9332 10.2675 -2.80114
+	428 -15.5326 11.2851 -5.60229
+	429 -14.9976 12.9316 -2.80114
+	430 -19.7343 1.64647 2.80114
+	431 -19.7343 -1.64647 2.80114
+	432 -19.1993 0 5.60229
+	433 -14.9976 -12.9316 -2.80114
+	434 -15.5326 -11.2851 -5.60229
+	435 -16.9332 -10.2675 -2.80114
+	436 -7.66412 -18.2596 2.80114
+	437 -4.53235 -19.2772 2.80114
+	438 -5.93292 -18.2596 5.60229
+	439 7.66412 -18.2596 -2.80114
+	440 5.93292 -18.2596 -5.60229
+	441 4.53235 -19.2772 -2.80114
+	442 19.7343 -1.64647 -2.80114
+	443 19.1993 0 -5.60229
+	444 19.7343 1.64647 -2.80114
+	445 14.9976 -12.9316 2.80114
+	446 16.9332 -10.2675 2.80114
+	447 15.5326 -11.2851 5.60229
+	448 5.06732 10.2675 -16.3982
+	449 1.93555 11.2851 -16.3982
+	450 4.20172 12.9316 -14.667
+	451 -8.19909 7.99214 -16.3982
+	452 -10.1346 5.3281 -16.3982
+	453 -11.0002 7.99214 -14.667
+	454 -10.1346 -5.3281 -16.3982
+	455 -8.19909 -7.99214 -16.3982
+	456 -11.0002 -7.99214 -14.667
+	457 1.93555 -11.2851 -16.3982
+	458 5.06732 -10.2675 -16.3982
+	459 4.20172 -12.9316 -14.667
+	460 11.3309 1.64647 -16.3982
+	461 11.3309 -1.64647 -16.3982
+	462 13.597 0 -14.667
+	463 7.3908 14.2256 11.9586
+	464 9.58402 12.4048 12.4205
+	465 6.82308 12.4048 14.1268
+	466 3.62416 2.63311 19.4918
+	467 4.50864 5.28166 18.7557
+	468 6.4164 2.65585 18.7557
+	469 15.8133 2.63311 11.9586
+	470 13.9061 2.65585 14.1268
+	471 14.7593 5.28166 12.4205
+	472 -11.2455 11.425 11.9586
+	473 -8.83604 12.9482 12.4205
+	474 -9.68921 10.3224 14.1268
+	475 -1.38431 4.26046 19.4918
+	476 -3.62991 5.92009 18.7557
+	477 -0.543089 6.92306 18.7557
+	478 2.38233 15.853 11.9586
+	479 -0.462287 15.669 12.4205
+	480 1.77136 14.0462 14.1268
+	481 -14.3409 -7.16457 11.9586
+	482 -15.045 -4.40234 12.4205
+	483 -12.8113 -6.02518 14.1268
+	484 -4.47971 0 19.4918
+	485 -6.75205 -1.62284 18.7557
+	486 -6.75205 1.62284 18.7557
+	487 -14.3409 7.16457 11.9586
+	488 -15.045 4.40234 12.4205
+	489 -12.8113 6.02518 14.1268
+	490 2.38233 -15.853 11.9586
+	491 -0.462287 -15.669 12.4205
+	492 1.77136 -14.0462 14.1268
+	493 -1.38431 -4.26046 19.4918
+	494 -0.543089 -6.92306 18.7557
+	495 -3.62991 -5.92009 18.7557
+	496 -11.2455 -11.425 11.9586
+	497 -8.83604 -12.9482 12.4205
+	498 -9.68921 -10.3224 14.1268
+	499 15.8133 -2.63311 11.9586
+	500 14.7593 -5.28166 12.4205
+	501 13.9061 -2.65585 14.1268
+	502 3.62416 -2.63311 19.4918
+	503 4.50864 -5.28166 18.7557
+	504 6.4164 -2.65585 18.7557
+	505 7.3908 -14.2256 11.9586
+	506 9.58402 -12.4048 12.4205
+	507 6.82308 -12.4048 14.1268
+	508 9.63065 15.853 7.47886
+	509 11.3159 15.669 5.14112
+	510 11.8432 14.0462 7.90205
+	511 18.0531 4.26046 7.47886
+	512 18.399 5.92009 5.14112
+	513 17.0185 6.92306 7.90205
+	514 15.7252 11.425 -4.71024
+	515 16.9685 10.3224 -2.34859
+	516 15.0608 12.9482 -2.34859
+	517 -1.52678 18.4861 -7.47886
+	518 1.32522 18.3249 -7.90205
+	519 -0.0552445 19.3279 -5.14112
+	520 6.00649 18.4861 4.71024
+	521 4.57365 19.3279 2.34859
+	522 7.66047 18.3249 2.34859
+	523 12.1011 14.0581 -7.47886
+	524 9.69897 15.6041 -7.90205
+	525 11.4053 15.6041 -5.14112
+	526 -12.1011 14.0581 7.47886
+	527 -11.4053 15.6041 5.14112
+	528 -9.69897 15.6041 7.90205
+	529 1.52678 18.4861 7.47886
+	530 0.0552445 19.3279 5.14112
+	531 -1.32522 18.3249 7.90205
+	532 -6.00649 18.4861 -4.71024
+	533 -7.66047 18.3249 -2.34859
+	534 -4.57365 19.3279 -2.34859
+	535 -18.0531 4.26046 -7.47886
+	536 -17.0185 6.92306 -7.90205
+	537 -18.399 5.92009 -5.14112
+	538 -15.7252 11.425 4.71024
+	539 -16.9685 10.3224 2.34859
+	540 -15.0608 12.9482 2.34859
+	541 -9.63065 15.853 -7.47886
+	542 -11.8432 14.0462 -7.90205
+	543 -11.3159 15.669 -5.14112
+	544 -17.1095 -7.16457 7.47886
+	545 -18.3648 -6.02518 5.14112
+	546 -17.8375 -4.40234 7.90205
+	547 -17.1095 7.16457 7.47886
+	548 -18.3648 6.02518 5.14112
+	549 -17.8375 4.40234 7.90205
+	550 -19.4374 0 -4.71025
+	551 -19.7952 -1.62284 -2.34859
+	552 -19.7952 1.62284 -2.34859
+	553 -9.63065 -15.853 -7.47886
+	554 -11.8432 -14.0462 -7.90205
+	555 -11.3159 -15.669 -5.14112
+	556 -15.7252 -11.425 4.71024
+	557 -15.0608 -12.9482 2.34859
+	558 -16.9685 -10.3224 2.34859
+	559 -18.0531 -4.26046 -7.47886
+	560 -17.0185 -6.92306 -7.90205
+	561 -18.399 -5.92009 -5.14112
+	562 1.52678 -18.4861 7.47886
+	563 0.0552445 -19.3279 5.14112
+	564 -1.32522 -18.3249 7.90205
+	565 -12.1011 -14.0581 7.47886
+	566 -11.4053 -15.6041 5.14112
+	567 -9.69897 -15.6041 7.90205
+	568 -6.00649 -18.4861 -4.71024
+	569 -4.57365 -19.3279 -2.34859
+	570 -7.66047 -18.3249 -2.34859
+	571 12.1011 -14.0581 -7.47886
+	572 9.69897 -15.6041 -7.90205
+	573 11.4053 -15.6041 -5.14112
+	574 6.00649 -18.4861 4.71024
+	575 7.66047 -18.3249 2.34859
+	576 4.57365 -19.3279 2.34859
+	577 -1.52678 -18.4861 -7.47886
+	578 1.32522 -18.3249 -7.90205
+	579 -0.0552445 -19.3279 -5.14112
+	580 17.1095 7.16457 -7.47886
+	581 17.8375 4.40234 -7.90205
+	582 18.3648 6.02518 -5.14112
+	583 19.4374 0 4.71025
+	584 19.7952 -1.62284 2.34859
+	585 19.7952 1.62284 2.34859
+	586 17.1095 -7.16457 -7.47886
+	587 18.3648 -6.02518 -5.14112
+	588 17.8375 -4.40234 -7.90205
+	589 18.0531 -4.26046 7.47886
+	590 17.0185 -6.92306 7.90205
+	591 18.399 -5.92009 5.14112
+	592 9.63065 -15.853 7.47886
+	593 11.3159 -15.669 5.14112
+	594 11.8432 -14.0462 7.90205
+	595 15.7252 -11.425 -4.71024
+	596 16.9685 -10.3224 -2.34859
+	597 15.0608 -12.9482 -2.34859
+	598 11.2455 11.425 -11.9586
+	599 9.68921 10.3224 -14.1268
+	600 8.83604 12.9482 -12.4205
+	601 1.38431 4.26046 -19.4918
+	602 3.62991 5.92009 -18.7557
+	603 0.543089 6.92306 -18.7557
+	604 -2.38233 15.853 -11.9586
+	605 -1.77136 14.0462 -14.1268
+	606 0.462287 15.669 -12.4205
+	607 -7.3908 14.2256 -11.9586
+	608 -6.82308 12.4048 -14.1268
+	609 -9.58402 12.4048 -12.4205
+	610 -3.62416 2.63311 -19.4918
+	611 -6.4164 2.65585 -18.7557
+	612 -4.50864 5.28166 -18.7557
+	613 -15.8133 2.63311 -11.9586
+	614 -13.9061 2.65585 -14.1268
+	615 -14.7593 5.28166 -12.4205
+	616 -15.8133 -2.63311 -11.9586
+	617 -13.9061 -2.65585 -14.1268
+	618 -14.7593 -5.28166 -12.4205
+	619 -3.62416 -2.63311 -19.4918
+	620 -4.50864 -5.28166 -18.7557
+	621 -6.4164 -2.65585 -18.7557
+	622 -7.3908 -14.2256 -11.9586
+	623 -6.82308 -12.4048 -14.1268
+	624 -9.58402 -12.4048 -12.4205
+	625 -2.38233 -15.853 -11.9586
+	626 -1.77136 -14.0462 -14.1268
+	627 0.462287 -15.669 -12.4205
+	628 1.38431 -4.26046 -19.4918
+	629 3.62991 -5.92009 -18.7557
+	630 0.543089 -6.92306 -18.7557
+	631 11.2455 -11.425 -11.9586
+	632 9.68921 -10.3224 -14.1268
+	633 8.83604 -12.9482 -12.4205
+	634 14.3409 -7.16457 -11.9586
+	635 12.8113 -6.02518 -14.1268
+	636 15.045 -4.40234 -12.4205
+	637 4.47971 0 -19.4918
+	638 6.75205 1.62284 -18.7557
+	639 6.75205 -1.62284 -18.7557
+	640 14.3409 7.16457 -11.9586
+	641 15.045 4.40234 -12.4205
+	642 12.8113 6.02518 -14.1268
+END_NODL_DATA
+
+BEG_ELEM_DATA
+	1280 0 0 1280 0 0 0 0 0 0 0 0 0
+	1	1 103	403 404 405
+	2	1 103	406 408 407
+	3	1 103	409 411 410
+	4	1 103	412 414 413
+	5	1 103	415 416 417
+	6	1 103	418 419 420
+	7	1 103	421 423 422
+	8	1 103	424 425 426
+	9	1 103	427 429 428
+	10	1 103	430 431 432
+	11	1 103	433 435 434
+	12	1 103	436 437 438
+	13	1 103	439 441 440
+	14	1 103	442 443 444
+	15	1 103	445 446 447
+	16	1 103	448 449 450
+	17	1 103	451 452 453
+	18	1 103	454 455 456
+	19	1 103	457 458 459
+	20	1 103	460 462 461
+	21	1 103	463 465 464
+	22	1 103	466 468 467
+	23	1 103	469 471 470
+	24	1 103	472 474 473
+	25	1 103	475 477 476
+	26	1 103	478 479 480
+	27	1 103	481 483 482
+	28	1 103	484 486 485
+	29	1 103	487 488 489
+	30	1 103	490 492 491
+	31	1 103	493 495 494
+	32	1 103	496 497 498
+	33	1 103	499 501 500
+	34	1 103	502 503 504
+	35	1 103	505 506 507
+	36	1 103	508 510 509
+	37	1 103	511 512 513
+	38	1 103	514 516 515
+	39	1 103	517 519 518
+	40	1 103	520 522 521
+	41	1 103	523 524 525
+	42	1 103	526 528 527
+	43	1 103	529 530 531
+	44	1 103	532 533 534
+	45	1 103	535 537 536
+	46	1 103	538 540 539
+	47	1 103	541 542 543
+	48	1 103	544 546 545
+	49	1 103	547 548 549
+	50	1 103	550 551 552
+	51	1 103	553 555 554
+	52	1 103	556 558 557
+	53	1 103	559 560 561
+	54	1 103	562 564 563
+	55	1 103	565 566 567
+	56	1 103	568 569 570
+	57	1 103	571 573 572
+	58	1 103	574 576 575
+	59	1 103	577 578 579
+	60	1 103	580 582 581
+	61	1 103	583 584 585
+	62	1 103	586 588 587
+	63	1 103	589 590 591
+	64	1 103	592 593 594
+	65	1 103	595 596 597
+	66	1 103	598 599 600
+	67	1 103	601 603 602
+	68	1 103	604 606 605
+	69	1 103	607 608 609
+	70	1 103	610 611 612
+	71	1 103	613 615 614
+	72	1 103	616 617 618
+	73	1 103	619 620 621
+	74	1 103	622 624 623
+	75	1 103	625 626 627
+	76	1 103	628 629 630
+	77	1 103	631 633 632
+	78	1 103	634 635 636
+	79	1 103	637 638 639
+	80	1 103	640 641 642
+	81	1 103	223 405 345
+	82	1 103	224 403 343
+	83	1 103	225 404 344
+	84	1 103	226 348 408
+	85	1 103	227 346 406
+	86	1 103	228 347 407
+	87	1 103	229 351 411
+	88	1 103	230 349 409
+	89	1 103	231 350 410
+	90	1 103	232 354 414
+	91	1 103	233 352 412
+	92	1 103	234 353 413
+	93	1 103	235 417 357
+	94	1 103	236 415 355
+	95	1 103	237 416 356
+	96	1 103	238 420 360
+	97	1 103	239 418 358
+	98	1 103	240 419 359
+	99	1 103	241 363 423
+	100	1 103	242 361 421
+	101	1 103	243 362 422
+	102	1 103	244 426 366
+	103	1 103	245 424 364
+	104	1 103	246 425 365
+	105	1 103	247 369 429
+	106	1 103	248 367 427
+	107	1 103	249 368 428
+	108	1 103	250 432 372
+	109	1 103	251 430 370
+	110	1 103	252 431 371
+	111	1 103	253 375 435
+	112	1 103	254 373 433
+	113	1 103	255 374 434
+	114	1 103	256 438 378
+	115	1 103	257 436 376
+	116	1 103	258 437 377
+	117	1 103	259 381 441
+	118	1 103	260 379 439
+	119	1 103	261 380 440
+	120	1 103	262 444 384
+	121	1 103	263 442 382
+	122	1 103	264 443 383
+	123	1 103	265 447 387
+	124	1 103	266 445 385
+	125	1 103	267 446 386
+	126	1 103	268 450 390
+	127	1 103	269 448 388
+	128	1 103	270 449 389
+	129	1 103	271 453 393
+	130	1 103	272 451 391
+	131	1 103	273 452 392
+	132	1 103	274 456 396
+	133	1 103	275 454 394
+	134	1 103	276 455 395
+	135	1 103	277 459 399
+	136	1 103	278 457 397
+	137	1 103	279 458 398
+	138	1 103	280 402 462
+	139	1 103	281 400 460
+	140	1 103	282 401 461
+	141	1 103	283 345 465
+	142	1 103	225 315 464
+	143	1 103	163 463 195
+	144	1 103	223 313 467
+	145	1 103	284 343 468
+	146	1 103	164 466 193
+	147	1 103	224 314 470
+	148	1 103	285 344 471
+	149	1 103	165 469 194
+	150	1 103	227 474 286
+	151	1 103	317 473 347
+	152	1 103	166 472 197
+	153	1 103	226 477 313
+	154	1 103	316 476 346
+	155	1 103	193 475 196
+	156	1 103	283 480 348
+	157	1 103	228 479 287
+	158	1 103	163 167 478
+	159	1 103	230 483 288
+	160	1 103	319 482 350
+	161	1 103	168 481 199
+	162	1 103	229 486 316
+	163	1 103	318 485 349
+	164	1 103	196 484 198
+	165	1 103	286 489 351
+	166	1 103	231 488 289
+	167	1 103	166 169 487
+	168	1 103	233 492 290
+	169	1 103	321 491 353
+	170	1 103	170 490 201
+	171	1 103	232 495 318
+	172	1 103	320 494 352
+	173	1 103	198 493 200
+	174	1 103	288 498 354
+	175	1 103	234 497 291
+	176	1 103	168 171 496
+	177	1 103	314 357 501
+	178	1 103	237 322 500
+	179	1 103	194 499 202
+	180	1 103	235 284 504
+	181	1 103	320 355 503
+	182	1 103	164 200 502
+	183	1 103	236 290 507
+	184	1 103	292 356 506
+	185	1 103	170 172 505
+	186	1 103	315 360 510
+	187	1 103	240 324 509
+	188	1 103	195 508 204
+	189	1 103	238 285 513
+	190	1 103	293 358 512
+	191	1 103	165 173 511
+	192	1 103	239 323 515
+	193	1 103	294 359 516
+	194	1 103	174 514 203
+	195	1 103	242 519 295
+	196	1 103	326 518 362
+	197	1 103	175 517 206
+	198	1 103	241 522 324
+	199	1 103	325 521 361
+	200	1 103	204 520 205
+	201	1 103	294 525 363
+	202	1 103	243 524 296
+	203	1 103	174 176 523
+	204	1 103	317 366 528
+	205	1 103	246 327 527
+	206	1 103	197 526 207
+	207	1 103	244 287 531
+	208	1 103	325 364 530
+	209	1 103	167 205 529
+	210	1 103	245 295 534
+	211	1 103	297 365 533
+	212	1 103	175 177 532
+	213	1 103	248 537 298
+	214	1 103	329 536 368
+	215	1 103	178 535 209
+	216	1 103	247 540 327
+	217	1 103	328 539 367
+	218	1 103	207 538 208
+	219	1 103	297 543 369
+	220	1 103	249 542 299
+	221	1 103	177 179 541
+	222	1 103	319 372 546
+	223	1 103	252 330 545
+	224	1 103	199 544 210
+	225	1 103	250 289 549
+	226	1 103	328 370 548
+	227	1 103	169 208 547
+	228	1 103	251 298 552
+	229	1 103	300 371 551
+	230	1 103	178 180 550
+	231	1 103	254 555 301
+	232	1 103	332 554 374
+	233	1 103	181 553 212
+	234	1 103	253 558 330
+	235	1 103	331 557 373
+	236	1 103	210 556 211
+	237	1 103	300 561 375
+	238	1 103	255 560 302
+	239	1 103	180 182 559
+	240	1 103	321 378 564
+	241	1 103	258 333 563
+	242	1 103	201 562 213
+	243	1 103	256 291 567
+	244	1 103	331 376 566
+	245	1 103	171 211 565
+	246	1 103	257 301 570
+	247	1 103	303 377 569
+	248	1 103	181 183 568
+	249	1 103	260 573 304
+	250	1 103	335 572 380
+	251	1 103	184 571 215
+	252	1 103	259 576 333
+	253	1 103	334 575 379
+	254	1 103	213 574 214
+	255	1 103	303 579 381
+	256	1 103	261 578 305
+	257	1 103	183 185 577
+	258	1 103	323 384 582
+	259	1 103	264 337 581
+	260	1 103	203 580 217
+	261	1 103	262 293 585
+	262	1 103	306 382 584
+	263	1 103	173 186 583
+	264	1 103	263 336 587
+	265	1 103	307 383 588
+	266	1 103	187 586 216
+	267	1 103	322 387 590
+	268	1 103	267 306 591
+	269	1 103	186 202 589
+	270	1 103	265 292 594
+	271	1 103	334 385 593
+	272	1 103	172 214 592
+	273	1 103	266 304 597
+	274	1 103	336 386 596
+	275	1 103	184 216 595
+	276	1 103	268 296 600
+	277	1 103	308 388 599
+	278	1 103	176 188 598
+	279	1 103	269 338 602
+	280	1 103	309 389 603
+	281	1 103	189 601 218
+	282	1 103	326 390 606
+	283	1 103	270 339 605
+	284	1 103	206 604 219
+	285	1 103	271 299 609
+	286	1 103	339 391 608
+	287	1 103	179 219 607
+	288	1 103	272 309 612
+	289	1 103	310 392 611
+	290	1 103	189 190 610
+	291	1 103	329 393 615
+	292	1 103	273 340 614
+	293	1 103	209 613 220
+	294	1 103	274 302 618
+	295	1 103	340 394 617
+	296	1 103	182 220 616
+	297	1 103	275 310 621
+	298	1 103	311 395 620
+	299	1 103	190 191 619
+	300	1 103	332 396 624
+	301	1 103	276 341 623
+	302	1 103	212 622 221
+	303	1 103	277 305 627
+	304	1 103	341 397 626
+	305	1 103	185 221 625
+	306	1 103	278 311 630
+	307	1 103	312 398 629
+	308	1 103	191 192 628
+	309	1 103	335 399 633
+	310	1 103	279 342 632
+	311	1 103	215 631 222
+	312	1 103	307 636 402
+	313	1 103	282 635 342
+	314	1 103	187 222 634
+	315	1 103	281 638 338
+	316	1 103	312 639 401
+	317	1 103	192 218 637
+	318	1 103	280 641 337
+	319	1 103	308 642 400
+	320	1 103	188 217 640
+	321	1 103	403 405 103
+	322	1 103	403 104 404
+	323	1 103	404 105 405
+	324	1 103	406 106 408
+	325	1 103	406 407 107
+	326	1 103	407 408 108
+	327	1 103	409 109 411
+	328	1 103	409 410 110
+	329	1 103	410 411 111
+	330	1 103	412 112 414
+	331	1 103	412 413 113
+	332	1 103	413 414 114
+	333	1 103	415 417 115
+	334	1 103	415 116 416
+	335	1 103	416 117 417
+	336	1 103	418 420 118
+	337	1 103	418 119 419
+	338	1 103	419 120 420
+	339	1 103	421 121 423
+	340	1 103	421 422 122
+	341	1 103	422 423 123
+	342	1 103	424 426 124
+	343	1 103	424 125 425
+	344	1 103	425 126 426
+	345	1 103	427 127 429
+	346	1 103	427 428 128
+	347	1 103	428 429 129
+	348	1 103	430 432 130
+	349	1 103	430 131 431
+	350	1 103	431 132 432
+	351	1 103	433 133 435
+	352	1 103	433 434 134
+	353	1 103	434 435 135
+	354	1 103	436 438 136
+	355	1 103	436 137 437
+	356	1 103	437 138 438
+	357	1 103	439 139 441
+	358	1 103	439 440 140
+	359	1 103	440 441 141
+	360	1 103	442 444 142
+	361	1 103	442 143 443
+	362	1 103	443 144 444
+	363	1 103	445 447 145
+	364	1 103	445 146 446
+	365	1 103	446 147 447
+	366	1 103	448 450 148
+	367	1 103	448 149 449
+	368	1 103	449 150 450
+	369	1 103	451 453 151
+	370	1 103	451 152 452
+	371	1 103	452 153 453
+	372	1 103	454 456 154
+	373	1 103	454 155 455
+	374	1 103	455 156 456
+	375	1 103	457 459 157
+	376	1 103	457 158 458
+	377	1 103	458 159 459
+	378	1 103	460 160 462
+	379	1 103	460 461 161
+	380	1 103	461 462 162
+	381	1 103	463 43 465
+	382	1 103	463 464 75
+	383	1 103	464 465 105
+	384	1 103	466 44 468
+	385	1 103	466 467 73
+	386	1 103	467 468 103
+	387	1 103	469 45 471
+	388	1 103	469 470 74
+	389	1 103	470 471 104
+	390	1 103	472 46 474
+	391	1 103	472 473 77
+	392	1 103	473 474 107
+	393	1 103	475 73 477
+	394	1 103	475 476 76
+	395	1 103	476 477 106
+	396	1 103	478 480 43
+	397	1 103	478 47 479
+	398	1 103	479 108 480
+	399	1 103	481 48 483
+	400	1 103	481 482 79
+	401	1 103	482 483 110
+	402	1 103	484 76 486
+	403	1 103	484 485 78
+	404	1 103	485 486 109
+	405	1 103	487 489 46
+	406	1 103	487 49 488
+	407	1 103	488 111 489
+	408	1 103	490 50 492
+	409	1 103	490 491 81
+	410	1 103	491 492 113
+	411	1 103	493 78 495
+	412	1 103	493 494 80
+	413	1 103	494 495 112
+	414	1 103	496 498 48
+	415	1 103	496 51 497
+	416	1 103	497 114 498
+	417	1 103	499 74 501
+	418	1 103	499 500 82
+	419	1 103	500 501 117
+	420	1 103	502 504 44
+	421	1 103	502 80 503
+	422	1 103	503 115 504
+	423	1 103	505 507 50
+	424	1 103	505 52 506
+	425	1 103	506 116 507
+	426	1 103	508 75 510
+	427	1 103	508 509 84
+	428	1 103	509 510 120
+	429	1 103	511 513 45
+	430	1 103	511 53 512
+	431	1 103	512 118 513
+	432	1 103	514 54 516
+	433	1 103	514 515 83
+	434	1 103	515 516 119
+	435	1 103	517 55 519
+	436	1 103	517 518 86
+	437	1 103	518 519 122
+	438	1 103	520 84 522
+	439	1 103	520 521 85
+	440	1 103	521 522 121
+	441	1 103	523 525 54
+	442	1 103	523 56 524
+	443	1 103	524 123 525
+	444	1 103	526 77 528
+	445	1 103	526 527 87
+	446	1 103	527 528 126
+	447	1 103	529 531 47
+	448	1 103	529 85 530
+	449	1 103	530 124 531
+	450	1 103	532 534 55
+	451	1 103	532 57 533
+	452	1 103	533 125 534
+	453	1 103	535 58 537
+	454	1 103	535 536 89
+	455	1 103	536 537 128
+	456	1 103	538 87 540
+	457	1 103	538 539 88
+	458	1 103	539 540 127
+	459	1 103	541 543 57
+	460	1 103	541 59 542
+	461	1 103	542 129 543
+	462	1 103	544 79 546
+	463	1 103	544 545 90
+	464	1 103	545 546 132
+	465	1 103	547 549 49
+	466	1 103	547 88 548
+	467	1 103	548 130 549
+	468	1 103	550 552 58
+	469	1 103	550 60 551
+	470	1 103	551 131 552
+	471	1 103	553 61 555
+	472	1 103	553 554 92
+	473	1 103	554 555 134
+	474	1 103	556 90 558
+	475	1 103	556 557 91
+	476	1 103	557 558 133
+	477	1 103	559 561 60
+	478	1 103	559 62 560
+	479	1 103	560 135 561
+	480	1 103	562 81 564
+	481	1 103	562 563 93
+	482	1 103	563 564 138
+	483	1 103	565 567 51
+	484	1 103	565 91 566
+	485	1 103	566 136 567
+	486	1 103	568 570 61
+	487	1 103	568 63 569
+	488	1 103	569 137 570
+	489	1 103	571 64 573
+	490	1 103	571 572 95
+	491	1 103	572 573 140
+	492	1 103	574 93 576
+	493	1 103	574 575 94
+	494	1 103	575 576 139
+	495	1 103	577 579 63
+	496	1 103	577 65 578
+	497	1 103	578 141 579
+	498	1 103	580 83 582
+	499	1 103	580 581 97
+	500	1 103	581 582 144
+	501	1 103	583 585 53
+	502	1 103	583 66 584
+	503	1 103	584 142 585
+	504	1 103	586 67 588
+	505	1 103	586 587 96
+	506	1 103	587 588 143
+	507	1 103	589 591 66
+	508	1 103	589 82 590
+	509	1 103	590 147 591
+	510	1 103	592 594 52
+	511	1 103	592 94 593
+	512	1 103	593 145 594
+	513	1 103	595 597 64
+	514	1 103	595 96 596
+	515	1 103	596 146 597
+	516	1 103	598 600 56
+	517	1 103	598 68 599
+	518	1 103	599 148 600
+	519	1 103	601 69 603
+	520	1 103	601 602 98
+	521	1 103	602 603 149
+	522	1 103	604 86 606
+	523	1 103	604 605 99
+	524	1 103	605 606 150
+	525	1 103	607 609 59
+	526	1 103	607 99 608
+	527	1 103	608 151 609
+	528	1 103	610 612 69
+	529	1 103	610 70 611
+	530	1 103	611 152 612
+	531	1 103	613 89 615
+	532	1 103	613 614 100
+	533	1 103	614 615 153
+	534	1 103	616 618 62
+	535	1 103	616 100 617
+	536	1 103	617 154 618
+	537	1 103	619 621 70
+	538	1 103	619 71 620
+	539	1 103	620 155 621
+	540	1 103	622 92 624
+	541	1 103	622 623 101
+	542	1 103	623 624 156
+	543	1 103	625 627 65
+	544	1 103	625 101 626
+	545	1 103	626 157 627
+	546	1 103	628 630 71
+	547	1 103	628 72 629
+	548	1 103	629 158 630
+	549	1 103	631 95 633
+	550	1 103	631 632 102
+	551	1 103	632 633 159
+	552	1 103	634 636 67
+	553	1 103	634 102 635
+	554	1 103	635 162 636
+	555	1 103	637 639 72
+	556	1 103	637 98 638
+	557	1 103	638 161 639
+	558	1 103	640 642 68
+	559	1 103	640 97 641
+	560	1 103	641 160 642
+	561	1 103	223 103 405
+	562	1 103	345 405 105
+	563	1 103	223 345 13
+	564	1 103	343 403 103
+	565	1 103	224 104 403
+	566	1 103	224 343 14
+	567	1 103	344 404 104
+	568	1 103	225 105 404
+	569	1 103	225 344 15
+	570	1 103	226 408 106
+	571	1 103	348 108 408
+	572	1 103	226 13 348
+	573	1 103	346 106 406
+	574	1 103	227 406 107
+	575	1 103	227 16 346
+	576	1 103	347 107 407
+	577	1 103	228 407 108
+	578	1 103	228 17 347
+	579	1 103	229 411 109
+	580	1 103	351 111 411
+	581	1 103	229 16 351
+	582	1 103	349 109 409
+	583	1 103	230 409 110
+	584	1 103	230 18 349
+	585	1 103	350 110 410
+	586	1 103	231 410 111
+	587	1 103	231 19 350
+	588	1 103	232 414 112
+	589	1 103	354 114 414
+	590	1 103	232 18 354
+	591	1 103	352 112 412
+	592	1 103	233 412 113
+	593	1 103	233 20 352
+	594	1 103	353 113 413
+	595	1 103	234 413 114
+	596	1 103	234 21 353
+	597	1 103	235 115 417
+	598	1 103	357 417 117
+	599	1 103	235 357 14
+	600	1 103	355 415 115
+	601	1 103	236 116 415
+	602	1 103	236 355 20
+	603	1 103	356 416 116
+	604	1 103	237 117 416
+	605	1 103	237 356 22
+	606	1 103	238 118 420
+	607	1 103	360 420 120
+	608	1 103	238 360 15
+	609	1 103	358 418 118
+	610	1 103	239 119 418
+	611	1 103	239 358 23
+	612	1 103	359 419 119
+	613	1 103	240 120 419
+	614	1 103	240 359 24
+	615	1 103	241 423 121
+	616	1 103	363 123 423
+	617	1 103	241 24 363
+	618	1 103	361 121 421
+	619	1 103	242 421 122
+	620	1 103	242 25 361
+	621	1 103	362 122 422
+	622	1 103	243 422 123
+	623	1 103	243 26 362
+	624	1 103	244 124 426
+	625	1 103	366 426 126
+	626	1 103	244 366 17
+	627	1 103	364 424 124
+	628	1 103	245 125 424
+	629	1 103	245 364 25
+	630	1 103	365 425 125
+	631	1 103	246 126 425
+	632	1 103	246 365 27
+	633	1 103	247 429 127
+	634	1 103	369 129 429
+	635	1 103	247 27 369
+	636	1 103	367 127 427
+	637	1 103	248 427 128
+	638	1 103	248 28 367
+	639	1 103	368 128 428
+	640	1 103	249 428 129
+	641	1 103	249 29 368
+	642	1 103	250 130 432
+	643	1 103	372 432 132
+	644	1 103	250 372 19
+	645	1 103	370 430 130
+	646	1 103	251 131 430
+	647	1 103	251 370 28
+	648	1 103	371 431 131
+	649	1 103	252 132 431
+	650	1 103	252 371 30
+	651	1 103	253 435 133
+	652	1 103	375 135 435
+	653	1 103	253 30 375
+	654	1 103	373 133 433
+	655	1 103	254 433 134
+	656	1 103	254 31 373
+	657	1 103	374 134 434
+	658	1 103	255 434 135
+	659	1 103	255 32 374
+	660	1 103	256 136 438
+	661	1 103	378 438 138
+	662	1 103	256 378 21
+	663	1 103	376 436 136
+	664	1 103	257 137 436
+	665	1 103	257 376 31
+	666	1 103	377 437 137
+	667	1 103	258 138 437
+	668	1 103	258 377 33
+	669	1 103	259 441 139
+	670	1 103	381 141 441
+	671	1 103	259 33 381
+	672	1 103	379 139 439
+	673	1 103	260 439 140
+	674	1 103	260 34 379
+	675	1 103	380 140 440
+	676	1 103	261 440 141
+	677	1 103	261 35 380
+	678	1 103	262 142 444
+	679	1 103	384 444 144
+	680	1 103	262 384 23
+	681	1 103	382 442 142
+	682	1 103	263 143 442
+	683	1 103	263 382 36
+	684	1 103	383 443 143
+	685	1 103	264 144 443
+	686	1 103	264 383 37
+	687	1 103	265 145 447
+	688	1 103	387 447 147
+	689	1 103	265 387 22
+	690	1 103	385 445 145
+	691	1 103	266 146 445
+	692	1 103	266 385 34
+	693	1 103	386 446 146
+	694	1 103	267 147 446
+	695	1 103	267 386 36
+	696	1 103	268 148 450
+	697	1 103	390 450 150
+	698	1 103	268 390 26
+	699	1 103	388 448 148
+	700	1 103	269 149 448
+	701	1 103	269 388 38
+	702	1 103	389 449 149
+	703	1 103	270 150 449
+	704	1 103	270 389 39
+	705	1 103	271 151 453
+	706	1 103	393 453 153
+	707	1 103	271 393 29
+	708	1 103	391 451 151
+	709	1 103	272 152 451
+	710	1 103	272 391 39
+	711	1 103	392 452 152
+	712	1 103	273 153 452
+	713	1 103	273 392 40
+	714	1 103	274 154 456
+	715	1 103	396 456 156
+	716	1 103	274 396 32
+	717	1 103	394 454 154
+	718	1 103	275 155 454
+	719	1 103	275 394 40
+	720	1 103	395 455 155
+	721	1 103	276 156 455
+	722	1 103	276 395 41
+	723	1 103	277 157 459
+	724	1 103	399 459 159
+	725	1 103	277 399 35
+	726	1 103	397 457 157
+	727	1 103	278 158 457
+	728	1 103	278 397 41
+	729	1 103	398 458 158
+	730	1 103	279 159 458
+	731	1 103	279 398 42
+	732	1 103	280 462 160
+	733	1 103	402 162 462
+	734	1 103	280 37 402
+	735	1 103	400 160 460
+	736	1 103	281 460 161
+	737	1 103	281 38 400
+	738	1 103	401 161 461
+	739	1 103	282 461 162
+	740	1 103	282 42 401
+	741	1 103	283 465 43
+	742	1 103	345 105 465
+	743	1 103	283 13 345
+	744	1 103	315 75 464
+	745	1 103	225 464 105
+	746	1 103	225 15 315
+	747	1 103	163 43 463
+	748	1 103	195 463 75
+	749	1 103	163 195 3
+	750	1 103	313 73 467
+	751	1 103	223 467 103
+	752	1 103	223 13 313
+	753	1 103	284 468 44
+	754	1 103	343 103 468
+	755	1 103	284 14 343
+	756	1 103	164 44 466
+	757	1 103	193 466 73
+	758	1 103	164 193 1
+	759	1 103	314 74 470
+	760	1 103	224 470 104
+	761	1 103	224 14 314
+	762	1 103	285 471 45
+	763	1 103	344 104 471
+	764	1 103	285 15 344
+	765	1 103	165 45 469
+	766	1 103	194 469 74
+	767	1 103	165 194 2
+	768	1 103	286 474 46
+	769	1 103	227 107 474
+	770	1 103	227 286 16
+	771	1 103	317 77 473
+	772	1 103	347 473 107
+	773	1 103	317 347 17
+	774	1 103	166 46 472
+	775	1 103	197 472 77
+	776	1 103	166 197 4
+	777	1 103	313 477 73
+	778	1 103	226 106 477
+	779	1 103	226 313 13
+	780	1 103	316 76 476
+	781	1 103	346 476 106
+	782	1 103	316 346 16
+	783	1 103	193 73 475
+	784	1 103	196 475 76
+	785	1 103	193 196 1
+	786	1 103	283 43 480
+	787	1 103	348 480 108
+	788	1 103	283 348 13
+	789	1 103	287 479 47
+	790	1 103	228 108 479
+	791	1 103	228 287 17
+	792	1 103	163 478 43
+	793	1 103	167 47 478
+	794	1 103	163 3 167
+	795	1 103	288 483 48
+	796	1 103	230 110 483
+	797	1 103	230 288 18
+	798	1 103	319 79 482
+	799	1 103	350 482 110
+	800	1 103	319 350 19
+	801	1 103	168 48 481
+	802	1 103	199 481 79
+	803	1 103	168 199 5
+	804	1 103	316 486 76
+	805	1 103	229 109 486
+	806	1 103	229 316 16
+	807	1 103	318 78 485
+	808	1 103	349 485 109
+	809	1 103	318 349 18
+	810	1 103	196 76 484
+	811	1 103	198 484 78
+	812	1 103	196 198 1
+	813	1 103	286 46 489
+	814	1 103	351 489 111
+	815	1 103	286 351 16
+	816	1 103	289 488 49
+	817	1 103	231 111 488
+	818	1 103	231 289 19
+	819	1 103	166 487 46
+	820	1 103	169 49 487
+	821	1 103	166 4 169
+	822	1 103	290 492 50
+	823	1 103	233 113 492
+	824	1 103	233 290 20
+	825	1 103	321 81 491
+	826	1 103	353 491 113
+	827	1 103	321 353 21
+	828	1 103	170 50 490
+	829	1 103	201 490 81
+	830	1 103	170 201 6
+	831	1 103	318 495 78
+	832	1 103	232 112 495
+	833	1 103	232 318 18
+	834	1 103	320 80 494
+	835	1 103	352 494 112
+	836	1 103	320 352 20
+	837	1 103	198 78 493
+	838	1 103	200 493 80
+	839	1 103	198 200 1
+	840	1 103	288 48 498
+	841	1 103	354 498 114
+	842	1 103	288 354 18
+	843	1 103	291 497 51
+	844	1 103	234 114 497
+	845	1 103	234 291 21
+	846	1 103	168 496 48
+	847	1 103	171 51 496
+	848	1 103	168 5 171
+	849	1 103	314 501 74
+	850	1 103	357 117 501
+	851	1 103	314 14 357
+	852	1 103	322 82 500
+	853	1 103	237 500 117
+	854	1 103	237 22 322
+	855	1 103	194 74 499
+	856	1 103	202 499 82
+	857	1 103	194 202 2
+	858	1 103	284 44 504
+	859	1 103	235 504 115
+	860	1 103	235 14 284
+	861	1 103	320 503 80
+	862	1 103	355 115 503
+	863	1 103	320 20 355
+	864	1 103	164 502 44
+	865	1 103	200 80 502
+	866	1 103	164 1 200
+	867	1 103	290 50 507
+	868	1 103	236 507 116
+	869	1 103	236 20 290
+	870	1 103	292 506 52
+	871	1 103	356 116 506
+	872	1 103	292 22 356
+	873	1 103	170 505 50
+	874	1 103	172 52 505
+	875	1 103	170 6 172
+	876	1 103	315 510 75
+	877	1 103	360 120 510
+	878	1 103	315 15 360
+	879	1 103	324 84 509
+	880	1 103	240 509 120
+	881	1 103	240 24 324
+	882	1 103	195 75 508
+	883	1 103	204 508 84
+	884	1 103	195 204 3
+	885	1 103	285 45 513
+	886	1 103	238 513 118
+	887	1 103	238 15 285
+	888	1 103	293 512 53
+	889	1 103	358 118 512
+	890	1 103	293 23 358
+	891	1 103	165 511 45
+	892	1 103	173 53 511
+	893	1 103	165 2 173
+	894	1 103	323 83 515
+	895	1 103	239 515 119
+	896	1 103	239 23 323
+	897	1 103	294 516 54
+	898	1 103	359 119 516
+	899	1 103	294 24 359
+	900	1 103	174 54 514
+	901	1 103	203 514 83
+	902	1 103	174 203 7
+	903	1 103	295 519 55
+	904	1 103	242 122 519
+	905	1 103	242 295 25
+	906	1 103	326 86 518
+	907	1 103	362 518 122
+	908	1 103	326 362 26
+	909	1 103	175 55 517
+	910	1 103	206 517 86
+	911	1 103	175 206 8
+	912	1 103	324 522 84
+	913	1 103	241 121 522
+	914	1 103	241 324 24
+	915	1 103	325 85 521
+	916	1 103	361 521 121
+	917	1 103	325 361 25
+	918	1 103	204 84 520
+	919	1 103	205 520 85
+	920	1 103	204 205 3
+	921	1 103	294 54 525
+	922	1 103	363 525 123
+	923	1 103	294 363 24
+	924	1 103	296 524 56
+	925	1 103	243 123 524
+	926	1 103	243 296 26
+	927	1 103	174 523 54
+	928	1 103	176 56 523
+	929	1 103	174 7 176
+	930	1 103	317 528 77
+	931	1 103	366 126 528
+	932	1 103	317 17 366
+	933	1 103	327 87 527
+	934	1 103	246 527 126
+	935	1 103	246 27 327
+	936	1 103	197 77 526
+	937	1 103	207 526 87
+	938	1 103	197 207 4
+	939	1 103	287 47 531
+	940	1 103	244 531 124
+	941	1 103	244 17 287
+	942	1 103	325 530 85
+	943	1 103	364 124 530
+	944	1 103	325 25 364
+	945	1 103	167 529 47
+	946	1 103	205 85 529
+	947	1 103	167 3 205
+	948	1 103	295 55 534
+	949	1 103	245 534 125
+	950	1 103	245 25 295
+	951	1 103	297 533 57
+	952	1 103	365 125 533
+	953	1 103	297 27 365
+	954	1 103	175 532 55
+	955	1 103	177 57 532
+	956	1 103	175 8 177
+	957	1 103	298 537 58
+	958	1 103	248 128 537
+	959	1 103	248 298 28
+	960	1 103	329 89 536
+	961	1 103	368 536 128
+	962	1 103	329 368 29
+	963	1 103	178 58 535
+	964	1 103	209 535 89
+	965	1 103	178 209 9
+	966	1 103	327 540 87
+	967	1 103	247 127 540
+	968	1 103	247 327 27
+	969	1 103	328 88 539
+	970	1 103	367 539 127
+	971	1 103	328 367 28
+	972	1 103	207 87 538
+	973	1 103	208 538 88
+	974	1 103	207 208 4
+	975	1 103	297 57 543
+	976	1 103	369 543 129
+	977	1 103	297 369 27
+	978	1 103	299 542 59
+	979	1 103	249 129 542
+	980	1 103	249 299 29
+	981	1 103	177 541 57
+	982	1 103	179 59 541
+	983	1 103	177 8 179
+	984	1 103	319 546 79
+	985	1 103	372 132 546
+	986	1 103	319 19 372
+	987	1 103	330 90 545
+	988	1 103	252 545 132
+	989	1 103	252 30 330
+	990	1 103	199 79 544
+	991	1 103	210 544 90
+	992	1 103	199 210 5
+	993	1 103	289 49 549
+	994	1 103	250 549 130
+	995	1 103	250 19 289
+	996	1 103	328 548 88
+	997	1 103	370 130 548
+	998	1 103	328 28 370
+	999	1 103	169 547 49
+	1000	1 103	208 88 547
+	1001	1 103	169 4 208
+	1002	1 103	298 58 552
+	1003	1 103	251 552 131
+	1004	1 103	251 28 298
+	1005	1 103	300 551 60
+	1006	1 103	371 131 551
+	1007	1 103	300 30 371
+	1008	1 103	178 550 58
+	1009	1 103	180 60 550
+	1010	1 103	178 9 180
+	1011	1 103	301 555 61
+	1012	1 103	254 134 555
+	1013	1 103	254 301 31
+	1014	1 103	332 92 554
+	1015	1 103	374 554 134
+	1016	1 103	332 374 32
+	1017	1 103	181 61 553
+	1018	1 103	212 553 92
+	1019	1 103	181 212 10
+	1020	1 103	330 558 90
+	1021	1 103	253 133 558
+	1022	1 103	253 330 30
+	1023	1 103	331 91 557
+	1024	1 103	373 557 133
+	1025	1 103	331 373 31
+	1026	1 103	210 90 556
+	1027	1 103	211 556 91
+	1028	1 103	210 211 5
+	1029	1 103	300 60 561
+	1030	1 103	375 561 135
+	1031	1 103	300 375 30
+	1032	1 103	302 560 62
+	1033	1 103	255 135 560
+	1034	1 103	255 302 32
+	1035	1 103	180 559 60
+	1036	1 103	182 62 559
+	1037	1 103	180 9 182
+	1038	1 103	321 564 81
+	1039	1 103	378 138 564
+	1040	1 103	321 21 378
+	1041	1 103	333 93 563
+	1042	1 103	258 563 138
+	1043	1 103	258 33 333
+	1044	1 103	201 81 562
+	1045	1 103	213 562 93
+	1046	1 103	201 213 6
+	1047	1 103	291 51 567
+	1048	1 103	256 567 136
+	1049	1 103	256 21 291
+	1050	1 103	331 566 91
+	1051	1 103	376 136 566
+	1052	1 103	331 31 376
+	1053	1 103	171 565 51
+	1054	1 103	211 91 565
+	1055	1 103	171 5 211
+	1056	1 103	301 61 570
+	1057	1 103	257 570 137
+	1058	1 103	257 31 301
+	1059	1 103	303 569 63
+	1060	1 103	377 137 569
+	1061	1 103	303 33 377
+	1062	1 103	181 568 61
+	1063	1 103	183 63 568
+	1064	1 103	181 10 183
+	1065	1 103	304 573 64
+	1066	1 103	260 140 573
+	1067	1 103	260 304 34
+	1068	1 103	335 95 572
+	1069	1 103	380 572 140
+	1070	1 103	335 380 35
+	1071	1 103	184 64 571
+	1072	1 103	215 571 95
+	1073	1 103	184 215 11
+	1074	1 103	333 576 93
+	1075	1 103	259 139 576
+	1076	1 103	259 333 33
+	1077	1 103	334 94 575
+	1078	1 103	379 575 139
+	1079	1 103	334 379 34
+	1080	1 103	213 93 574
+	1081	1 103	214 574 94
+	1082	1 103	213 214 6
+	1083	1 103	303 63 579
+	1084	1 103	381 579 141
+	1085	1 103	303 381 33
+	1086	1 103	305 578 65
+	1087	1 103	261 141 578
+	1088	1 103	261 305 35
+	1089	1 103	183 577 63
+	1090	1 103	185 65 577
+	1091	1 103	183 10 185
+	1092	1 103	323 582 83
+	1093	1 103	384 144 582
+	1094	1 103	323 23 384
+	1095	1 103	337 97 581
+	1096	1 103	264 581 144
+	1097	1 103	264 37 337
+	1098	1 103	203 83 580
+	1099	1 103	217 580 97
+	1100	1 103	203 217 7
+	1101	1 103	293 53 585
+	1102	1 103	262 585 142
+	1103	1 103	262 23 293
+	1104	1 103	306 584 66
+	1105	1 103	382 142 584
+	1106	1 103	306 36 382
+	1107	1 103	173 583 53
+	1108	1 103	186 66 583
+	1109	1 103	173 2 186
+	1110	1 103	336 96 587
+	1111	1 103	263 587 143
+	1112	1 103	263 36 336
+	1113	1 103	307 588 67
+	1114	1 103	383 143 588
+	1115	1 103	307 37 383
+	1116	1 103	187 67 586
+	1117	1 103	216 586 96
+	1118	1 103	187 216 11
+	1119	1 103	322 590 82
+	1120	1 103	387 147 590
+	1121	1 103	322 22 387
+	1122	1 103	306 66 591
+	1123	1 103	267 591 147
+	1124	1 103	267 36 306
+	1125	1 103	186 589 66
+	1126	1 103	202 82 589
+	1127	1 103	186 2 202
+	1128	1 103	292 52 594
+	1129	1 103	265 594 145
+	1130	1 103	265 22 292
+	1131	1 103	334 593 94
+	1132	1 103	385 145 593
+	1133	1 103	334 34 385
+	1134	1 103	172 592 52
+	1135	1 103	214 94 592
+	1136	1 103	172 6 214
+	1137	1 103	304 64 597
+	1138	1 103	266 597 146
+	1139	1 103	266 34 304
+	1140	1 103	336 596 96
+	1141	1 103	386 146 596
+	1142	1 103	336 36 386
+	1143	1 103	184 595 64
+	1144	1 103	216 96 595
+	1145	1 103	184 11 216
+	1146	1 103	296 56 600
+	1147	1 103	268 600 148
+	1148	1 103	268 26 296
+	1149	1 103	308 599 68
+	1150	1 103	388 148 599
+	1151	1 103	308 38 388
+	1152	1 103	176 598 56
+	1153	1 103	188 68 598
+	1154	1 103	176 7 188
+	1155	1 103	338 98 602
+	1156	1 103	269 602 149
+	1157	1 103	269 38 338
+	1158	1 103	309 603 69
+	1159	1 103	389 149 603
+	1160	1 103	309 39 389
+	1161	1 103	189 69 601
+	1162	1 103	218 601 98
+	1163	1 103	189 218 12
+	1164	1 103	326 606 86
+	1165	1 103	390 150 606
+	1166	1 103	326 26 390
+	1167	1 103	339 99 605
+	1168	1 103	270 605 150
+	1169	1 103	270 39 339
+	1170	1 103	206 86 604
+	1171	1 103	219 604 99
+	1172	1 103	206 219 8
+	1173	1 103	299 59 609
+	1174	1 103	271 609 151
+	1175	1 103	271 29 299
+	1176	1 103	339 608 99
+	1177	1 103	391 151 608
+	1178	1 103	339 39 391
+	1179	1 103	179 607 59
+	1180	1 103	219 99 607
+	1181	1 103	179 8 219
+	1182	1 103	309 69 612
+	1183	1 103	272 612 152
+	1184	1 103	272 39 309
+	1185	1 103	310 611 70
+	1186	1 103	392 152 611
+	1187	1 103	310 40 392
+	1188	1 103	189 610 69
+	1189	1 103	190 70 610
+	1190	1 103	189 12 190
+	1191	1 103	329 615 89
+	1192	1 103	393 153 615
+	1193	1 103	329 29 393
+	1194	1 103	340 100 614
+	1195	1 103	273 614 153
+	1196	1 103	273 40 340
+	1197	1 103	209 89 613
+	1198	1 103	220 613 100
+	1199	1 103	209 220 9
+	1200	1 103	302 62 618
+	1201	1 103	274 618 154
+	1202	1 103	274 32 302
+	1203	1 103	340 617 100
+	1204	1 103	394 154 617
+	1205	1 103	340 40 394
+	1206	1 103	182 616 62
+	1207	1 103	220 100 616
+	1208	1 103	182 9 220
+	1209	1 103	310 70 621
+	1210	1 103	275 621 155
+	1211	1 103	275 40 310
+	1212	1 103	311 620 71
+	1213	1 103	395 155 620
+	1214	1 103	311 41 395
+	1215	1 103	190 619 70
+	1216	1 103	191 71 619
+	1217	1 103	190 12 191
+	1218	1 103	332 624 92
+	1219	1 103	396 156 624
+	1220	1 103	332 32 396
+	1221	1 103	341 101 623
+	1222	1 103	276 623 156
+	1223	1 103	276 41 341
+	1224	1 103	212 92 622
+	1225	1 103	221 622 101
+	1226	1 103	212 221 10
+	1227	1 103	305 65 627
+	1228	1 103	277 627 157
+	1229	1 103	277 35 305
+	1230	1 103	341 626 101
+	1231	1 103	397 157 626
+	1232	1 103	341 41 397
+	1233	1 103	185 625 65
+	1234	1 103	221 101 625
+	1235	1 103	185 10 221
+	1236	1 103	311 71 630
+	1237	1 103	278 630 158
+	1238	1 103	278 41 311
+	1239	1 103	312 629 72
+	1240	1 103	398 158 629
+	1241	1 103	312 42 398
+	1242	1 103	191 628 71
+	1243	1 103	192 72 628
+	1244	1 103	191 12 192
+	1245	1 103	335 633 95
+	1246	1 103	399 159 633
+	1247	1 103	335 35 399
+	1248	1 103	342 102 632
+	1249	1 103	279 632 159
+	1250	1 103	279 42 342
+	1251	1 103	215 95 631
+	1252	1 103	222 631 102
+	1253	1 103	215 222 11
+	1254	1 103	307 67 636
+	1255	1 103	402 636 162
+	1256	1 103	307 402 37
+	1257	1 103	342 635 102
+	1258	1 103	282 162 635
+	1259	1 103	282 342 42
+	1260	1 103	187 634 67
+	1261	1 103	222 102 634
+	1262	1 103	187 11 222
+	1263	1 103	338 638 98
+	1264	1 103	281 161 638
+	1265	1 103	281 338 38
+	1266	1 103	312 72 639
+	1267	1 103	401 639 161
+	1268	1 103	312 401 42
+	1269	1 103	192 637 72
+	1270	1 103	218 98 637
+	1271	1 103	192 12 218
+	1272	1 103	337 641 97
+	1273	1 103	280 160 641
+	1274	1 103	280 337 37
+	1275	1 103	308 68 642
+	1276	1 103	400 642 160
+	1277	1 103	308 400 38
+	1278	1 103	188 640 68
+	1279	1 103	217 97 640
+	1280	1 103	188 7 217
+END_ELEM_DATA
+
diff --git a/source/TEST/data/PoseClustering_transformFile.dat b/source/TEST/data/PoseClustering_transformFile.dat
new file mode 100644
index 0000000..97afbe0
--- /dev/null
+++ b/source/TEST/data/PoseClustering_transformFile.dat
@@ -0,0 +1,8 @@
+A A  0.0 0.666747 -0.139666 -0.732081 0 0.331034 0.935567 0.123004 0 0.667731 -0.324356 0.670021 0
+A A  0.0 0.979479 0.140071 0.144917 1.14441e-05 -0.173061 0.953037 0.248536 -3.8147e-05 -0.103299 -0.268515 0.957721 1.14441e-05
+A A  0.0 0.538627 -0.0416586 -0.841514 -2.3125 0.392562 0.896151 0.206903 0.0872498 0.745504 -0.44179 0.499045 -0.0263605
+A A  0.0 0.802781 -0.0902871 -0.589398 1.20004 0.244969 0.951137 0.187957 0.321671 0.543629 -0.295273 0.785673 -0.0971184
+A A  0.0 0.684371 -0.51595 0.515201 0.854189 0.342643 -0.396137 -0.851864 -54.9851 0.643609 0.759521 -0.0943179 16.6043
+A A  0.0 0.535863 -0.419484 0.732724 0.854179 0.626205 -0.384644 -0.678171 -54.9851 0.56632 0.822242 0.0565671 16.6043
+A A  0.0 0.955263 -0.0613604 -0.289322 -32.1333 0.10242 0.986345 0.128975 -17.5631 0.277457 -0.152838 0.948503 5.30364
+A A  0.0 1 0 0 -32.0834 0 1 0 -18.842 0 0 1 5.68983
diff --git a/source/TEST/data/PoseClustering_wardtree.dat b/source/TEST/data/PoseClustering_wardtree.dat
new file mode 100644
index 0000000..bac5592
--- /dev/null
+++ b/source/TEST/data/PoseClustering_wardtree.dat
@@ -0,0 +1 @@
+22 serialization::archive 10 0 0 15 14 0 0 1 0 0 1 0 1 0 1 1 0 1 0 2 1 0 1 0 3 1 0 1 0 4 1 0 1 0 5 1 0 1 0 6 1 0 1 0 7 1 0 0 0 2 2.9301245e-05 0 0 3 1.0175115 0 0 4 2.3491771 0 0 2 0.94531083 0 0 2 1.0956884e-05 0 0 4 50.624729 0 0 8 58.394974 8 1 0 0 8 0 9 3 9 8 10 2 10 9 11 7 11 6 12 4 12 5 13 12 13 11 14 13 14 10 14
diff --git a/source/TEST/stringStub.C b/source/TEST/stringStub.C
deleted file mode 100644
index e79eef0..0000000
--- a/source/TEST/stringStub.C
+++ /dev/null
@@ -1,9 +0,0 @@
-// stringStub.h / stringStub.C are needed for VC2010!
-#include <string>
-#include <BALL/common.h>
-
-
-#ifdef BALL_COMPILER_MSVC
-template std::string::size_type std::string::npos;
-template std::wstring::size_type std::wstring::npos;
-#endif
diff --git a/source/VIEW/DIALOGS/coloringSettingsDialog.C b/source/VIEW/DIALOGS/coloringSettingsDialog.C
index a5806bf..950a7fc 100644
--- a/source/VIEW/DIALOGS/coloringSettingsDialog.C
+++ b/source/VIEW/DIALOGS/coloringSettingsDialog.C
@@ -110,12 +110,21 @@ namespace BALL
 			{
 				case COLORING_ELEMENT:
 				{
-					table = element_table_; 
-					if (table->rowCount() > 0)
+					table = element_table_;
+					colors.resize(table->rowCount());
+                    
+					for (Position p=0; p<(Position)table->rowCount(); p++)
 					{
-						colors.push_back(table->item(table->rowCount() - 1, 1)->backgroundColor());
+						// NOTE: do not remove the scope here; there is a class member Element flying around somewhere...
+						BALL::Element const& e = PTE_::getElement(ascii(table->item(p, 0)->text()));
+						
+						if ((e.getAtomicNumber() > 0) && (e.getAtomicNumber() < table->rowCount()))
+						{
+							colors[e.getAtomicNumber()] = table->item(p, 1)->backgroundColor();
+						}
 					}
-					break;
+						
+					return colors;
 				}
 				case COLORING_RESIDUE_INDEX: 	table = residue_table_; break;
 				case COLORING_CHAIN: 					table = chain_table_  ; break;
diff --git a/source/VIEW/DIALOGS/displayProperties.C b/source/VIEW/DIALOGS/displayProperties.C
index be9c2f9..0618ced 100644
--- a/source/VIEW/DIALOGS/displayProperties.C
+++ b/source/VIEW/DIALOGS/displayProperties.C
@@ -889,14 +889,25 @@ void DisplayProperties::createRepresentation(String data_string, const vector<co
 				std::istringstream is(string_vector_properties[i].decodeBase64());
 
 				TextPersistenceManager tmp(is);
+				tmp.registerClass(RTTI::getStreamName<Stage::Material>(), Stage::Material::createDefault);
 				tmp.registerClass(RTTI::getStreamName<Stage::RaytracingMaterial>(), Stage::RaytracingMaterial::createDefault);
 
 				NamedProperty* prop = (NamedProperty*) tmp.readObject();
 
+				// needed for compatibility with older versions
+				if (prop->getName() == "RTFact::Material")
+				{
+					boost::shared_ptr<PersistentObject> p(new Stage::Material(*reinterpret_cast<Stage::RaytracingMaterial*>(prop->getSmartObject().get())));
+					NamedProperty* prop_tmp = new NamedProperty("Rendering::Material", p);
+					delete (prop);
+					prop = prop_tmp;
+				}
+
 				rep->setProperty(*prop);
 			}
+		
+			notify_(new RepresentationMessage(*rep, RepresentationMessage::UPDATE_PROPERTIES));
 		}
-
 	}
 	catch(...)
 	{
diff --git a/source/VIEW/DIALOGS/lightSettings.C b/source/VIEW/DIALOGS/lightSettings.C
index 6a57bd7..9312497 100644
--- a/source/VIEW/DIALOGS/lightSettings.C
+++ b/source/VIEW/DIALOGS/lightSettings.C
@@ -328,7 +328,7 @@ void LightSettings::getValues_(Index current)
 	setDirection_(dir);
 	setAttenuation_(att);
 	
-	typeSelected();
+	typeSelected_(light.getType());
 	
 	if (light.getType() == LightSource::AMBIENT) ambient->setChecked(true);
 	if (light.getType() == LightSource::POSITIONAL) point->setChecked(true);
@@ -339,7 +339,10 @@ void LightSettings::getValues_(Index current)
 
 void LightSettings::clearFields_()
 {
+	ignore_ = true;
 	lights_list->clear();
+	ignore_ = false;
+
 	position_x->clear();
 	position_y->clear();
 	position_z->clear();
diff --git a/source/VIEW/DIALOGS/materialSettings.C b/source/VIEW/DIALOGS/materialSettings.C
index d7ac966..a029601 100644
--- a/source/VIEW/DIALOGS/materialSettings.C
+++ b/source/VIEW/DIALOGS/materialSettings.C
@@ -40,17 +40,11 @@ namespace BALL
 
 			connect (update_directly_checkBox, SIGNAL(stateChanged(int)), this, SLOT (updateDirectlyBoxChanged()));
 		
-			connect (radioButton_OpenGL, SIGNAL(clicked()), this, SLOT (rendererChanged()));
-			connect (radioButton_POVRay, SIGNAL(clicked()), this, SLOT (rendererChanged()));
-			connect (radioButton_RTFact, SIGNAL(clicked()), this, SLOT (rendererChanged()));
-
 			connect( ambient_color_button, SIGNAL( clicked() ), this, SLOT( editAmbientColor() ) );
 			connect( specularity_color_button, SIGNAL(clicked()), this, SLOT( editSpecularityColor() ) );
 			connect( reflectiveness_color_button, SIGNAL(clicked()), this, SLOT( editReflectivenessColor() ) );
 
 			registerWidgets_();
-
-			rendererChanged();
 		}
 
 
@@ -60,41 +54,22 @@ namespace BALL
 //TODO what should happen, when this dialog is called for a specific representation in POVRay and OpenGL?
 //TODO So far OpenGL and POVRay do not make any use of transparency!
 			if (Scene::getInstance(0) && Scene::getInstance(0)->getStage())
-			{	
+			{
 				Stage& stage = *Scene::getInstance(0)->getStage();
 
-				//TODO really both??
-				if (radioButton_OpenGL->isChecked() || radioButton_POVRay->isChecked())
-				{
-					stage.setSpecularIntensity(specularity_factor_label->text().toFloat());
-					stage.setDiffuseIntensity(1. - reflectiveness_factor_label->text().toFloat());
-					stage.setAmbientIntensity( ambient_factor_label->text().toFloat());
-					stage.setShininess(	shininess_factor_label->text().toFloat() );
-				}
-				if (radioButton_OpenGL->isChecked()) // TODO is this correct? names indicate but who knows??
-				{
-					glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, (stage.getShininess()+0.1));
-					GLfloat values[4];
-					values[0] = values[1] = values[2] =  stage.getSpecularIntensity();
-					values[3] = 1.0;
-					glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR,  values);
-				}
-#ifdef BALL_HAS_RTFACT	
-				else if (radioButton_RTFact->isChecked())
-				{
 					// first, decide whether we have been called from the preferences or from the geometric control
-					Stage::RaytracingMaterial rt_material;
+					Stage::Material material;
 
-					rt_material.ambient_color  	 = VIEW::getColor(ambient_color_label);
-					rt_material.specular_color 	 = VIEW::getColor(specularity_color_label);
-					rt_material.reflective_color = VIEW::getColor(reflectiveness_color_label);
+					material.ambient_color    = VIEW::getColor(ambient_color_label);
+					material.specular_color   = VIEW::getColor(specularity_color_label);
+					material.reflective_color = VIEW::getColor(reflectiveness_color_label);
 
-					rt_material.ambient_intensity    = ambient_factor_label->text().toFloat();
-					rt_material.specular_intensity   = specularity_factor_label->text().toFloat();
-					rt_material.reflective_intensity = reflectiveness_factor_label->text().toFloat();
+					material.ambient_intensity    = ambient_factor_label->text().toFloat();
+					material.specular_intensity   = specularity_factor_label->text().toFloat();
+					material.reflective_intensity = reflectiveness_factor_label->text().toFloat();
 
-					rt_material.shininess          = std::max(shininess_factor_label->text().toFloat(), 0.1f);
-					rt_material.transparency			 = transparency_factor_label->text().toFloat();
+					material.shininess    = std::max(shininess_factor_label->text().toFloat(), 0.1f);
+					material.transparency = transparency_factor_label->text().toFloat();
 
 					if (objectName() == "MaterialSettingsForRepresentation")
 					{
@@ -102,7 +77,7 @@ namespace BALL
 						// apply the values to this one
 						if (current_representation_)
 						{
-							Scene::getInstance(0)->updateRTMaterialForRepresentation(current_representation_, rt_material);
+							Scene::getInstance(0)->updateMaterialForRepresentation(current_representation_, material);
 						}
 						else
 							Log.error() << "MaterialSettings::apply(): Invalid representation selected!" << std::endl;
@@ -110,35 +85,29 @@ namespace BALL
 					else
 					{
 						// we have been called from the preferences and should set new default values for *all* representations
-						stage.getRTMaterial() = rt_material;
-						Scene::getInstance(0)->updateAllRTMaterials();
+						stage.getMaterial() = material;
+						Scene::getInstance(0)->updateAllMaterials();
 					}
 				}
-#endif
-			}
 		}
 
 		void MaterialSettings::setCurrentRepresentation(Representation* representation)
 		{
 			current_representation_ = representation;
 
-			// NOTE: this currently only works for RTfact! Sorry about that!
-			if (!radioButton_RTFact->isChecked())
-				return;
-
 			// update the sliders
-			Stage::RaytracingMaterial rt_material;
+			Stage::Material material;
 
-			if (representation->hasProperty("RTFact::Material"))
+			if (representation->hasProperty("Rendering::Material"))
 			{
-				NamedProperty rt_mat_property = representation->getProperty("RTFact::Material");
-				boost::shared_ptr<PersistentObject> mat_ptr = rt_mat_property.getSmartObject();
-				rt_material = *(dynamic_cast<Stage::RaytracingMaterial*>(mat_ptr.get()));
+				NamedProperty mat_property = representation->getProperty("Rendering::Material");
+				boost::shared_ptr<PersistentObject> mat_ptr = mat_property.getSmartObject();
+				material = *(dynamic_cast<Stage::Material*>(mat_ptr.get()));
 			}
 			else
 			{
 				Stage* stage = Scene::getInstance(0)->getStage();
-				rt_material = stage->getRTMaterial();
+				material = stage->getMaterial();
 			}
 
 			// remember the update-directly value
@@ -147,24 +116,24 @@ namespace BALL
 			update_directly_checkBox->setChecked(false);
 
 			// now set the values
-			setColor(ambient_color_label, rt_material.ambient_color);
-			setColor(reflectiveness_color_label, rt_material.reflective_color);
-			setColor(specularity_color_label, rt_material.specular_color);
+			setColor(ambient_color_label, material.ambient_color);
+			setColor(reflectiveness_color_label, material.reflective_color);
+			setColor(specularity_color_label, material.specular_color);
 
-			setLabel_(*ambient_factor_label, rt_material.ambient_intensity);
-			ambient_factor_slider->setValue(rt_material.ambient_intensity*(float)ambient_factor_slider->maximum());
+			setLabel_(*ambient_factor_label, material.ambient_intensity);
+			ambient_factor_slider->setValue(material.ambient_intensity*(float)ambient_factor_slider->maximum());
 
-			setLabel_(*specularity_factor_label, rt_material.specular_intensity);
-			specularity_factor_slider->setValue(rt_material.specular_intensity*(float)specularity_factor_slider->maximum());
+			setLabel_(*specularity_factor_label, material.specular_intensity);
+			specularity_factor_slider->setValue(material.specular_intensity*(float)specularity_factor_slider->maximum());
 
-			setLabel_(*reflectiveness_factor_label, rt_material.reflective_intensity);
-			reflectiveness_factor_slider->setValue(rt_material.reflective_intensity*(float)reflectiveness_factor_slider->maximum());
+			setLabel_(*reflectiveness_factor_label, material.reflective_intensity);
+			reflectiveness_factor_slider->setValue(material.reflective_intensity*(float)reflectiveness_factor_slider->maximum());
 
-			setLabel_(*shininess_factor_label, rt_material.shininess);
-			shininess_factor_slider->setValue(sqrt(rt_material.shininess*(float)shininess_factor_slider->maximum()));
+			setLabel_(*shininess_factor_label, material.shininess);
+			shininess_factor_slider->setValue(sqrt(material.shininess*(float)shininess_factor_slider->maximum()));
 
-			setLabel_(*transparency_factor_label, rt_material.transparency);
-			transparency_factor_slider->setValue(rt_material.transparency);
+			setLabel_(*transparency_factor_label, material.transparency);
+			transparency_factor_slider->setValue(material.transparency);
 
 			update_directly_checkBox->setChecked(do_update);
 		}
@@ -172,29 +141,26 @@ namespace BALL
 		void MaterialSettings::updateDefaultMaterialsFromStage()
 		{
 			Stage* stage = Scene::getInstance(0)->getStage();
-			Stage::RaytracingMaterial& rt_material = stage->getRTMaterial();
-
-			// set the renderer to RTfact, just to be on the safe side.
-			radioButton_RTFact->setChecked(true);
+			const Stage::Material& material = stage->getMaterial();
 
 			// now set the values
-			setColor(ambient_color_label, rt_material.ambient_color);
-			setColor(reflectiveness_color_label, rt_material.reflective_color);
-			setColor(specularity_color_label, rt_material.specular_color);
+			setColor(ambient_color_label, material.ambient_color);
+			setColor(reflectiveness_color_label, material.reflective_color);
+			setColor(specularity_color_label, material.specular_color);
 
-			ambient_factor_slider->setValue(rt_material.ambient_intensity);
+			ambient_factor_slider->setValue(material.ambient_intensity);
 			setValues_(*ambient_factor_slider, *ambient_factor_label, 1);
 
-			specularity_factor_slider->setValue(rt_material.specular_intensity);
+			specularity_factor_slider->setValue(material.specular_intensity);
 			setValues_(*specularity_factor_slider, *specularity_factor_label, 1);
 
-			reflectiveness_factor_slider->setValue(rt_material.reflective_intensity);
+			reflectiveness_factor_slider->setValue(material.reflective_intensity);
 			setValues_(*reflectiveness_factor_slider, *reflectiveness_factor_label, 1);
 
-			shininess_factor_slider->setValue(rt_material.shininess);
+			shininess_factor_slider->setValue(material.shininess);
 			setValues_(*shininess_factor_slider, *shininess_factor_label, 1);	
 
-			transparency_factor_slider->setValue(rt_material.transparency*100);
+			transparency_factor_slider->setValue(material.transparency*100);
 			setValues_(*transparency_factor_slider, *transparency_factor_label, 1);
 
 			if (update_directly_checkBox->isChecked())
@@ -309,22 +275,6 @@ namespace BALL
 			if (update_directly_checkBox->isChecked())
 				apply();
 		}
-	
-		void MaterialSettings::rendererChanged()
-		{
-			bool isOpenGL = radioButton_OpenGL->isChecked(); 
-			bool isPOVRay = radioButton_POVRay->isChecked();
-			bool isRTFact = radioButton_RTFact->isChecked();
-			groupBox_ambientIntensity->setDisabled(isOpenGL && (!isPOVRay) && (!isRTFact));
-			groupBox_Reflectiveness->setDisabled(isOpenGL && (!isPOVRay) && (!isRTFact));	
-			groupBox_Transparency->setDisabled(((isOpenGL) || (isPOVRay)) && (!isRTFact));
-			if (isOpenGL || isPOVRay)
-			{
-				update_directly_checkBox->setChecked(false);
-			}
-			update_directly_checkBox->setDisabled(isOpenGL || isPOVRay);
-		}
 
-		
 	} // namespace VIEW
 } // namespace BALL
diff --git a/source/VIEW/DIALOGS/materialSettings.ui b/source/VIEW/DIALOGS/materialSettings.ui
index ef543d1..efe1e07 100644
--- a/source/VIEW/DIALOGS/materialSettings.ui
+++ b/source/VIEW/DIALOGS/materialSettings.ui
@@ -1211,45 +1211,6 @@
       </widget>
      </item>
      <item>
-      <widget class="QGroupBox" name="groupBox_11">
-       <property name="title">
-        <string>Renderer</string>
-       </property>
-       <layout class="QVBoxLayout" name="verticalLayout">
-        <item>
-         <widget class="QRadioButton" name="radioButton_OpenGL">
-          <property name="text">
-           <string>OpenGL</string>
-          </property>
-          <property name="checked">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QRadioButton" name="radioButton_POVRay">
-          <property name="text">
-           <string>POVRay</string>
-          </property>
-          <property name="checked">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QRadioButton" name="radioButton_RTFact">
-          <property name="text">
-           <string>RTFact</string>
-          </property>
-          <property name="checked">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-     </item>
-     <item>
       <spacer name="verticalSpacer">
        <property name="orientation">
         <enum>Qt::Vertical</enum>
@@ -1889,9 +1850,6 @@
      </item>
      <item>
       <widget class="QGroupBox" name="groupBox_Transparency">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
        <property name="title">
         <string>Transparency</string>
        </property>
@@ -1965,9 +1923,6 @@
      </item>
      <item>
       <widget class="QCheckBox" name="update_directly_checkBox">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
        <property name="text">
         <string>automatic update</string>
        </property>
@@ -2002,9 +1957,6 @@
   <tabstop>specularity_color_button</tabstop>
   <tabstop>specularity_factor_slider</tabstop>
   <tabstop>shininess_factor_slider</tabstop>
-  <tabstop>radioButton_OpenGL</tabstop>
-  <tabstop>radioButton_POVRay</tabstop>
-  <tabstop>radioButton_RTFact</tabstop>
   <tabstop>transparency_factor_slider</tabstop>
   <tabstop>update_directly_checkBox</tabstop>
  </tabstops>
diff --git a/source/VIEW/DIALOGS/stageSettings.ui b/source/VIEW/DIALOGS/stageSettings.ui
index b8a74ec..7bf48fb 100644
--- a/source/VIEW/DIALOGS/stageSettings.ui
+++ b/source/VIEW/DIALOGS/stageSettings.ui
@@ -544,7 +544,7 @@
                <number>1</number>
               </property>
               <property name="maximum">
-               <number>5</number>
+               <number>100</number>
               </property>
               <property name="value">
                <number>1</number>
diff --git a/source/VIEW/KERNEL/MODES/editMode.C b/source/VIEW/KERNEL/MODES/editMode.C
index d59b1b9..1e68bab 100644
--- a/source/VIEW/KERNEL/MODES/editMode.C
+++ b/source/VIEW/KERNEL/MODES/editMode.C
@@ -709,6 +709,10 @@ namespace BALL
 			{
 				add_action->setEnabled(false);
 			}
+			else
+			{
+				add_action->setEnabled(true);
+			}
 		}
 
 		void EditMode::activatedOrderItem_(QAction* action)
diff --git a/source/VIEW/KERNEL/representationManager.C b/source/VIEW/KERNEL/representationManager.C
index 547f366..110b7f5 100644
--- a/source/VIEW/KERNEL/representationManager.C
+++ b/source/VIEW/KERNEL/representationManager.C
@@ -650,6 +650,7 @@ void RepresentationManager::finishedUpdate_(Representation* rep)
 	{
 		// no it wasnt, so update all widgets, that this Representation was rebuild
  		main_control_->notify_(new RepresentationMessage(*rep, RepresentationMessage::UPDATE));
+		main_control_->notify_(new RepresentationMessage(*rep, RepresentationMessage::UPDATE_PROPERTIES));
 	}
 	else
 	{
diff --git a/source/VIEW/KERNEL/shortcutRegistry.C b/source/VIEW/KERNEL/shortcutRegistry.C
index 1c77e58..d5ea64d 100644
--- a/source/VIEW/KERNEL/shortcutRegistry.C
+++ b/source/VIEW/KERNEL/shortcutRegistry.C
@@ -234,8 +234,6 @@ namespace BALL
 		{
 			std::map<String,QAction*>::const_iterator it = shortcuts_.begin();
 
-			QByteArray out;
-
 			for (; it!=shortcuts_.end() && (!it->second || it->second->shortcut().isEmpty()); ++it) ;
 
 			if (it == shortcuts_.end())
diff --git a/source/VIEW/KERNEL/sources.cmake b/source/VIEW/KERNEL/sources.cmake
index c43cb2f..86af8cd 100644
--- a/source/VIEW/KERNEL/sources.cmake
+++ b/source/VIEW/KERNEL/sources.cmake
@@ -19,7 +19,6 @@ SET(SOURCES_LIST
 	shortcutRegistry.C
 	snapshotManagerInterface.C
 	stage.C
-	stringStub.C
 	threads.C
 	UIOperationMode.C
 )
diff --git a/source/VIEW/KERNEL/stage.C b/source/VIEW/KERNEL/stage.C
index b8d7df6..52d59af 100644
--- a/source/VIEW/KERNEL/stage.C
+++ b/source/VIEW/KERNEL/stage.C
@@ -100,7 +100,7 @@ namespace BALL
 			BALL_DUMP_STREAM_SUFFIX(s);
 		}
 
-		Stage::RaytracingMaterial::RaytracingMaterial()
+		Stage::Material::Material()
 			: PersistentObject(),
 				ambient_color(ColorRGBA(255, 255, 255, 255)),
 				ambient_intensity(0.),
@@ -113,7 +113,7 @@ namespace BALL
 		{
 		}
 
-		void Stage::RaytracingMaterial::persistentWrite(PersistenceManager& pm, const char* name) const
+		void Stage::Material::persistentWrite(PersistenceManager& pm, const char* name) const
 			throw(Exception::GeneralException)
 		{
 			pm.writeObjectHeader(this, name);
@@ -132,7 +132,7 @@ namespace BALL
 			pm.writeObjectTrailer(name);
 		}
 		
-		void Stage::RaytracingMaterial::persistentRead(PersistenceManager& pm)
+		void Stage::Material::persistentRead(PersistenceManager& pm)
 			throw(Exception::GeneralException)
 		{
 			String color;
@@ -188,7 +188,7 @@ namespace BALL
 				diffuse_(stage.diffuse_),
 				ambient_(stage.ambient_),
 				shininess_(stage.shininess_),
-				rt_material_(stage.rt_material_)
+				material_(stage.material_)
 		{
 		}
 
@@ -206,7 +206,7 @@ namespace BALL
 			diffuse_  = 0.2;
 			ambient_  = 0.0;
 			shininess_ = 128.0;
-			rt_material_ = RaytracingMaterial();
+			material_ = Material();
 		}
 
 		bool Stage::operator == (const Stage& stage) const
diff --git a/source/VIEW/KERNEL/stringStub.C b/source/VIEW/KERNEL/stringStub.C
deleted file mode 100644
index e79eef0..0000000
--- a/source/VIEW/KERNEL/stringStub.C
+++ /dev/null
@@ -1,9 +0,0 @@
-// stringStub.h / stringStub.C are needed for VC2010!
-#include <string>
-#include <BALL/common.h>
-
-
-#ifdef BALL_COMPILER_MSVC
-template std::string::size_type std::string::npos;
-template std::wstring::size_type std::wstring::npos;
-#endif
diff --git a/source/VIEW/RENDERING/RENDERERS/XML3DRenderer.C b/source/VIEW/RENDERING/RENDERERS/XML3DRenderer.C
index f70acce..03fd40c 100644
--- a/source/VIEW/RENDERING/RENDERERS/XML3DRenderer.C
+++ b/source/VIEW/RENDERING/RENDERERS/XML3DRenderer.C
@@ -1,8 +1,6 @@
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id: XML3DRenderer.C,v 1.22.16.3 2007/04/18 21:06:17 amoll Exp $
-//
 
 #include <BALL/VIEW/RENDERING/RENDERERS/XML3DRenderer.h>
 #include <BALL/VIEW/KERNEL/common.h>
@@ -94,6 +92,31 @@ namespace BALL
 			color_index_ = 0;
 		}
 
+		void XML3DRenderer::setSize(float width, float height)
+		{
+			// this should really be done in the camera...
+			float x_scale, y_scale;
+			if (width > height)
+			{
+				x_scale = width / (height * 2);
+				y_scale = 0.5;
+			}
+			else
+			{
+				x_scale = 0.5;
+				y_scale = height / (width * 2);
+			}
+
+			float nearf =  1.5f;
+			float left  = -2.f*x_scale;
+			float right =  2.f*x_scale;
+			float bot   = -2.f*y_scale;
+			float top   =  2.f*y_scale;
+
+			fov_x_ = 2*atan( (right-left)/(2*nearf) );
+			fov_y_ = 2*atan( (top-bot)/(2*nearf) );
+		}
+
 		void XML3DRenderer::setFileName(const String& name)
 			throw(Exception::FileNotFound)
 		{
@@ -150,7 +173,7 @@ namespace BALL
 			return output;
 		}
 		
-		String XML3DRenderer::XML3DRaytracingMaterial(const Stage::RaytracingMaterial& input)
+		String XML3DRenderer::XML3DRaytracingMaterial(const Stage::Material& input)
 		{
 			String result;
       	
@@ -237,12 +260,17 @@ namespace BALL
 				Log.info() << "Start the XML3DRender output..." << endl;
 			#endif
 
+			setSize(width, height);
+
 			wireframes_.clear();
 			representations_.clear();
 			color_map_.clear();
 			color_strings_.clear();
 			color_index_ = 0;
 
+			current_sphere_number_ = 0;
+			current_tube_number_ = 0;
+
     // prepare the sphere template
       TriangulatedSphere sphere_template;
       sphere_template.pentakisDodecaeder();
@@ -360,9 +388,18 @@ namespace BALL
 			out << " orientation=\""<< final_rotation_axis.x << " "
 															<< final_rotation_axis.y << " "
 															<< final_rotation_axis.z << " "
-															<< final_rotation_angle << "\"" ;
+															<< final_rotation_angle << "\"";
 			
 			out << " fieldOfView=\"" << 1.2 << "\"";
+			out << " fieldOfViewX=\"" << fov_x_ << "\"";
+			out << " fieldOfViewY=\"" << fov_y_ << "\"";
+
+			Vector3 look_at_vector = stage.getCamera().getLookAtPosition();
+			out << " lookAtVector=\"" << look_at_vector.x << " "
+				                      << look_at_vector.y << " "
+									  << look_at_vector.z << "\"";
+
+
 			out << " >";
 			out << "</view>\n" << endl;
 			
@@ -391,7 +428,14 @@ namespace BALL
 					out << "<float3 name=\"attenuation\">" << attenuation.x << " " << attenuation.y << " " << attenuation.z << "</float3> ";
 					out << "</lightshader>" << endl;
 					out << "<group transform=\"lighttransform" << i << "\" >" << endl;
-					out << "<light shader=\"#point" << i << "\" id=\"mypoint" << i << "\" />" << endl;
+					out << "<light shader=\"#point" << i << "\" id=\"mypoint" << i << "\"";
+					
+					if (it->isRelativeToCamera())
+					{
+						out << " relativeToCamera=\"true\"";
+					}
+					
+					out << " />" << endl;
 					out << "</group>" << endl;
 				}
 				
@@ -405,16 +449,16 @@ namespace BALL
 		{
 			std::ostream& out = *outfile_;
 
-			rt_material_ = stage_->getRTMaterial();
+			rt_material_ = stage_->getMaterial();
 
 			vector<const Representation*>::iterator rit = representations_.begin();
 			for (; rit != representations_.end(); rit++)
 			{
-				if ((*rit)->hasProperty("RTFact::Material"))
+				if ((*rit)->hasProperty("Rendering::Material"))
 				{
-					NamedProperty rt_mat_property = (*rit)->getProperty("RTFact::Material");
+					NamedProperty rt_mat_property = (*rit)->getProperty("Rendering::Material");
 					boost::shared_ptr<PersistentObject> mat_ptr = rt_mat_property.getSmartObject();
-					rt_material_ = *dynamic_cast<Stage::RaytracingMaterial*>(mat_ptr.get());
+					rt_material_ = *dynamic_cast<Stage::Material*>(mat_ptr.get());
 				}
 
 				out << "<group ";
@@ -431,14 +475,6 @@ namespace BALL
 				out << "</group>" << endl;
 			}
 
-
-
-
-
-
-
-
-
 			//close xml3d environment
 			out << "		</xml3d>" << endl;
 			
@@ -490,12 +526,10 @@ namespace BALL
 		{
 			std::ostream& out = *outfile_;
 
-
-
       Vector3 const& sphere_pos = sphere.getPosition();
       float radius = sphere.getRadius();
 			
-			//define a shader for each Tube elment
+			//define a shader for each sphere
 
       ColorRGBA const& color = sphere.getColor();
 			out << "<shader id=\"" << &sphere << "shader\" script=\"urn:xml3d:shader:phong\" >" << endl;
@@ -504,14 +538,14 @@ namespace BALL
       
       out << "</shader>" << endl;
 			
-			//define a transform for each Tube element
+			//define a transform for each sphere
 			out << "<transform ";
 			out << "id=\"" << &sphere_pos << "\" ";
 			out << "translation=\"" << sphere_pos.x << " " << sphere_pos.y << " " << sphere_pos.z << "\" ";  
 			out << "scale=\"" << radius << " " << radius << " " << radius << "\" ";  
 			out << "/>" << endl;
 			
-			out << "<group ";
+			out << "<group id=\"Sphere_" << current_sphere_number_++ << "\" ";
 			out << "transform=\"#" << &sphere_pos << "\" "; 
 			out << "shader=\"#" << &sphere << "shader\" >" << endl; 
 			
@@ -597,8 +631,6 @@ namespace BALL
 			// *Not implmented yet*
 		}
 
-
-
 		void XML3DRenderer::renderTwoColoredTube_(const TwoColoredTube& tube)
 		{
 			std::ostream& out = *outfile_;
@@ -614,8 +646,8 @@ namespace BALL
 				out << "</shader>" << endl;
 				createTubeTransform_(tube);
 
-				out << "<group ";
-				out << "transform=\"#" << &tube << "trafo\" "; 
+				out << "<group id=\"Tube_" << current_tube_number_++ << "\" ";
+				out << "transform=\"#" << &tube << "trafo\" ";
 				out << "shader=\"#" << &tube << "shader\" >" << endl; 
 				
 				// Start a triangle env	
@@ -683,7 +715,7 @@ namespace BALL
 				createTubeTransform_(new_tube_1);
 				createTubeTransform_(new_tube_2);
 				
-				out << "<group ";
+				out << "<group id=\"Tube_" << current_tube_number_ << "_1\" ";
 				out << "transform=\"#" << &new_tube_1 << "trafo\" "; 
 				out << "shader=\"#" << &new_tube_1 << "shader\" >" << endl; 
 				
@@ -729,7 +761,7 @@ namespace BALL
 				out << "</group>" << endl; 
 				
 				// the second tube
-				out << "<group ";
+				out << "<group id=\"Tube_" << current_tube_number_++ << "_2\" ";
 				out << "transform=\"#" << &new_tube_2 << "trafo\" "; 
 				out << "shader=\"#" << &new_tube_2 << "shader\" >" << endl; 
 				
@@ -932,8 +964,7 @@ namespace BALL
 		
 		void XML3DRenderer::createTubeTransform_(const TwoColoredTube& tube)
 		{
-		
-     	Vector3 vec = tube.getVertex2() - tube.getVertex1();
+			Vector3 vec = tube.getVertex2() - tube.getVertex1();
       const double len = vec.getLength();
       const double angle = acos(vec.z / len); // the denominator accounts for the non-normalized rotation axis
       const float radius = tube.getRadius();
@@ -946,13 +977,12 @@ namespace BALL
       matrix.rotate(Angle(-angle), vec.y, -vec.x, 0);
 
       Matrix4x4 temp;
-      temp.setScale(radius, radius, len);
-      matrix*=temp;
+     // temp.setScale(radius, radius, len);
+     // matrix*=temp;
 
       temp.setTranslation(midpoint);
       matrix = temp*matrix;
 
-			
 			std::ostream& out = *outfile_;
 			
 			out << "<transform ";
diff --git a/source/VIEW/RENDERING/RENDERERS/glRenderer.C b/source/VIEW/RENDERING/RENDERERS/glRenderer.C
index bc683a8..66aa539 100644
--- a/source/VIEW/RENDERING/RENDERERS/glRenderer.C
+++ b/source/VIEW/RENDERING/RENDERERS/glRenderer.C
@@ -116,6 +116,14 @@ namespace BALL
 
 		void GLRenderer::clear()
 		{
+			glDisable(GL_BLEND);
+			glDisable(GL_LIGHTING);
+			glDisable(GL_LIGHT_MODEL_LOCAL_VIEWER);
+			glDisable(GL_RESCALE_NORMAL);
+			glDisable(GL_COLOR_MATERIAL);
+			glDisable(GL_DEPTH_TEST);
+			glDisable(GL_NORMALIZE);
+
 			name_to_object_.clear();
 			object_to_name_.clear();
 			all_names_ = 1;
@@ -171,10 +179,31 @@ namespace BALL
 			return smooth_lines_;
 		}
 
+		void GLRenderer::setMaterial_(const Stage::Material& material)
+		{
+			GLfloat shin[] = { material.shininess };
+			GLfloat spec[] = {
+				material.specular_intensity * (float)material.specular_color.getRed(),
+				material.specular_intensity * (float)material.specular_color.getGreen(),
+				material.specular_intensity * (float)material.specular_color.getBlue(),
+				material.specular_intensity * (float)material.specular_color.getAlpha()
+			};
+			GLfloat ambient[] = {
+				material.ambient_intensity * (float)material.ambient_color.getRed(),
+				material.ambient_intensity * (float)material.ambient_color.getGreen(),
+				material.ambient_intensity * (float)material.ambient_color.getBlue(),
+				material.ambient_intensity * (float)material.ambient_color.getAlpha()
+			};
+
+			glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR,  spec);
+			glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, shin );
+			glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,   ambient);
+		}
+
 		bool GLRenderer::init(const Stage& stage, float width, float height)
 		{
 			Renderer::init(stage, width, height);
-			
+
 			// Force OpenGL to normalize transformed normals to be of unit
 			// length before using the normals in OpenGL's lighting equations
 			// While this corrects potential lighting problems introduced by scaling,
@@ -230,18 +259,8 @@ namespace BALL
 			// set the background color according to the stage
 			updateBackgroundColor();
 
-			glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
+			glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
 			glEnable(GL_COLOR_MATERIAL);
-			
-			GLfloat diff[] = {0.4, 0.4, 0.4, 1.0};
-			GLfloat shin[] = {76.8};
-			GLfloat spec[] = {0.774597, 0.774597, 0.774597, 1.0};
-			GLfloat ambient[] = {0.25, 0.25, 0.25, 1.0};
-
-			glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR,  spec);
-			glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, shin );
-			glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,  diff);
-			glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,  ambient);
 
 			// if displaylists were already calculated, return
 			if (GL_spheres_list_ != 0) return true;
@@ -863,6 +882,17 @@ namespace BALL
 		{
 			model_type_ = representation.getModelType();
 
+			if (representation.hasProperty("Rendering::Material"))
+			{
+				NamedProperty rt_mat_property = representation.getProperty("Rendering::Material");
+				boost::shared_ptr<PersistentObject> mat_ptr = rt_mat_property.getSmartObject();
+				setMaterial_(*dynamic_cast<Stage::Material*>(mat_ptr.get()));
+			}
+			else
+			{
+				setMaterial_(stage_->getMaterial());
+			}
+
 			// accelerate things a little by calling getGeometricObjects() only once
 			const list<GeometricObject*>& geometric_objects = representation.getGeometricObjects();
 			if (geometric_objects.size() == 0) return;
@@ -2157,6 +2187,11 @@ namespace BALL
 
 		String GLRenderer::getOpenGLVersion()
 		{
+			if (runningOnVirtualBox())
+			{
+				return (String)qApp->translate("BALL::VIEW::GLRenderer","<Unable to get OpenGL version on Virtual Box probably due to driver bug>");
+			}
+
 			if (glGetString(GL_VERSION) == 0) return "";
 			return (char*)glGetString(GL_VERSION);
 		}
@@ -2175,6 +2210,11 @@ namespace BALL
 			return string_vector;
 		}
 
+		bool GLRenderer::runningOnVirtualBox()
+		{
+			return (getVendor() == "Humper") && (getRenderer() == "Chromium");
+		}
+
 		bool GLRenderer::enableVertexBuffers(bool state)
 		{
 #ifndef BALL_HAS_GLEW
diff --git a/source/VIEW/RENDERING/RENDERERS/rtfactRenderer.C b/source/VIEW/RENDERING/RENDERERS/rtfactRenderer.C
index 75d6446..881f09b 100644
--- a/source/VIEW/RENDERING/RENDERERS/rtfactRenderer.C
+++ b/source/VIEW/RENDERING/RENDERERS/rtfactRenderer.C
@@ -1,12 +1,14 @@
 #include <BALL/STRUCTURE/triangulatedSurface.h>
+#include <BALL/VIEW/KERNEL/clippingPlane.h>
 #include <BALL/VIEW/PRIMITIVES/sphere.h>
 #include <BALL/VIEW/PRIMITIVES/twoColoredTube.h>
 #include <BALL/VIEW/PRIMITIVES/twoColoredLine.h>
 
-#include <BALL/VIEW/RENDERING/RENDERERS/rtfactRenderer.h>
-
+#include <RTfact/Config/Common.hpp>
 #include <RTfact/Config/Init.hpp>
 
+#include <BALL/VIEW/RENDERING/RENDERERS/rtfactRenderer.h>
+
 #include <QtGui/QImage>
 
 #include <list>
@@ -14,24 +16,56 @@
 static const float LINE_RADIUS = 0.02;
 
 using RTfact::Vec3f;
-using RTfact::Remote::GroupHandle;
-using RTfact::Remote::GeoHandle;
-using RTfact::Remote::Picking;
-using RTfact::Remote::Transform;
-using RTfact::Remote::float3;
-using RTfact::Remote::RTAppearanceHandle;
+using RTpieCpp::GeometryHandle;
+using RTpieCpp::MeshHandle;
+using RTpieCpp::PickTaskHandle;
+using RTpieCpp::IntersectTaskHandle;
+using RTpieCpp::LightHandle;
+using RTpieCpp::Image2DHandle;
+using RTpieCpp::BufferHandle;
+using RTpieCpp::float3;
+using RTpieCpp::InstanceHandle;
+using RTpieCpp::FrameBufferHandle;
+using RTpieCpp::SceneHandle;
+using RTpieCpp::AppearanceHandle;
 
 namespace BALL
 {
 	namespace VIEW
 	{
+		const float RTfactRenderer::vectorDifferenceTolerance_= 0.0f;
+
+		bool RTfactRenderer::hasFPScounter()
+		{
+			return true;
+		}
+
+		double RTfactRenderer::getFPS()
+		{
+			return fpsMeter.getFPS();
+		}
+
 		bool RTfactRenderer::init(Scene& scene)
-		{		     
+		{
 			Renderer::init(scene);
 
-			GroupHandle root = m_renderer.getRoot();
-			m_picking = boost::shared_ptr<Picking>(new Picking(&m_renderer));
-			
+			// create rtpie handles
+			rayTracer = RTpieCpp::CreateRayTracerHandle();
+			sceneHandle = RTpieCpp::CreateSceneHandle();
+
+			rayTracer.attachScene(sceneHandle);
+
+			renderTask = rayTracer.createRenderTask();
+			renderTask.setOverSamplingRate(1);
+            renderTask.setAccumulatePixels(false);
+			renderTask.setMaxDepth(20);
+
+			pickTask = rayTracer.createPickTask();
+
+			cameraHandle = RTpieCpp::CreateCameraHandle();
+
+			renderTask.setCamera(cameraHandle);
+
 			// prepare the sphere template
 			TriangulatedSphere sphere_template;
 			sphere_template.pentakisDodecaeder();
@@ -43,7 +77,7 @@ namespace BALL
 			TriangulatedSurface* tube_template = TriangulatedSurface::createTube(18, 0, false, true);
 			tube_template->exportSurface(tube_template_);
 			delete (tube_template);
-				
+
 			objects_.clear();
 
 			rtfact_needs_update_ = false;
@@ -53,25 +87,43 @@ namespace BALL
 
 		GeometricObject* RTfactRenderer::pickObject(Position x, Position y)
 		{
-			RTfact::Remote::Picking::ScreenCoordinates coords((float)x, (float)y);
-			RTfact::Remote::Picking::Result result;
-
-			if (!m_picking->pick(coords, result))
-			{
-				return NULL;
-			}
-			else
+			PickTaskHandle pickTask = rayTracer.createPickTask();
+			pickTask.setCamera( cameraHandle );
+			pickTask.pick(
+				static_cast<int>(x),
+				static_cast<int>(y),
+				renderBuffer.getWidth(), renderBuffer.getHeight());
+
+			//returns true if some object was picked
+			if(pickTask.hasResult())
 			{
-				HashMap<RTfact::Remote::GeoHandle, GeometricObject*>::iterator geo = geometric_objects_.begin();
-				
-				for (; geo != geometric_objects_.end(); ++geo)
+				//for all scene object
+
+				if(geometric_objects_.empty())
+				{
+					HashMap<RTpieCpp::MeshHandle, GeometricObject*>::iterator geo = geometric_objects_.begin();
+					for (; geo != geometric_objects_.end(); ++geo)
+					{
+						if (pickTask.getMesh() == geo->first)
+						{
+							return geo->second;
+						}
+					}
+				}
+
+				if(geometric_objects_inst.empty())
 				{
-					if (RTfact::Remote::Geometry::equal(result.mGeometry, geo->first))
+					HashMap<RTpieCpp::InstanceHandle, GeometricObject*>::iterator geo = geometric_objects_inst.begin();
+					for (; geo != geometric_objects_inst.end(); ++geo)
 					{
-						return geo->second;
+						if (pickTask.getInstance() == geo->first)
+						{
+							return geo->second;
+						}
 					}
 				}
 			}
+
 			return NULL;
 		}
 
@@ -110,7 +162,7 @@ namespace BALL
 				x_scale_ = 0.5;
 				y_scale_ = height / (width * 2);
 			}
-			
+
 			setFrustum(1.5f, RTfact::Packet<1,float>::C_INFINITY, -2.f * x_scale_, 2.f * x_scale_, 2.f * y_scale_, -2.f * y_scale_);
 		}
 
@@ -128,42 +180,32 @@ namespace BALL
 
 			float new_left   = 2*left  - eye_separation * ndfl;
 			float new_right  = 2*right - eye_separation * ndfl;
-			
+
 			if (stage_->getCamera().getProjectionMode() == Camera::PERSPECTIVE)
 				setFrustum(nearf, RTfact::Packet<1,float>::C_INFINITY, left, right, top, bottom);
 			else
 			{
-				//glOrtho(new_left * orthographic_zoom_, new_right * orthographic_zoom_, 
+				//glOrtho(new_left * orthographic_zoom_, new_right * orthographic_zoom_,
 				//         bottom_ * orthographic_zoom_,      top_ * orthographic_zoom_, near_, far_);
 			}
 		}
 
 		void RTfactRenderer::getFrustum(float& near_f, float& far_f, float& left_f, float& right_f, float& top_f, float& bottom_f)
 		{
-			RTfact::Remote::FrustumParameters rtfact_frustum = m_renderer.getFrustum();
-			
-			near_f   = rtfact_frustum.nearPlane;
-			far_f    = rtfact_frustum.farPlane;
-			left_f   = rtfact_frustum.left   * 2.f*x_scale_;
-			right_f  = rtfact_frustum.right  * 2.f*x_scale_;
-			top_f    = rtfact_frustum.top    * 2.f*y_scale_;
-			bottom_f = rtfact_frustum.bottom * 2.f*y_scale_;
+		  cameraHandle.getFrustum(&left_f, &right_f, &top_f, &bottom_f, &near_f, &far_f);
+
+			left_f   *= 2.f*x_scale_;
+			right_f  *= 2.f*x_scale_;
+			top_f    *= 2.f*y_scale_;
+			bottom_f *= 2.f*y_scale_;
 		}
 
 		void RTfactRenderer::setFrustum(float near_f, float far_f, float left_f, float right_f, float top_f, float bottom_f)
 		{
-			RTfact::Remote::FrustumParameters rtfact_frustum;
-			
-			rtfact_frustum.nearPlane = near_f;
-			rtfact_frustum.farPlane  = far_f;
-
-			rtfact_frustum.left  = left_f  / (2.f*x_scale_);
-			rtfact_frustum.right = right_f / (2.f*x_scale_);
-
-			rtfact_frustum.top    = top_f     / (2.f*y_scale_);
-			rtfact_frustum.bottom = bottom_f  / (2.f*y_scale_);
-
-			m_renderer.setFrustum(rtfact_frustum);
+			cameraHandle.setFrustum(
+				left_f/ (2.f*x_scale_), right_f/ (2.f*x_scale_),
+				top_f/ (2.f*y_scale_), bottom_f/ (2.f*y_scale_),
+				near_f, far_f);
 		}
 
 		void RTfactRenderer::setLights(bool reset_all)
@@ -171,29 +213,28 @@ namespace BALL
 			if (reset_all)
 			{
 				for (Position i=0; i<lights_.size(); ++i)
-					m_renderer.removeLight(lights_[i]);
+				  lights_[i].clear();
 				lights_.clear();
 			}
 
 			Vector3 direction, light_position, attenuation;
 
-			Size current_light=0; 
+			Size current_light=0;
 			Size num_lights=lights_.size();
 
 			std::list<LightSource>::const_iterator it = stage_->getLightSources().begin();
-
 			for (; it != stage_->getLightSources().end(); ++it, ++current_light)
 			{
 				if (current_light >= num_lights)
 				{
-					RTfact::Remote::RTLightHandle light; 
+					LightHandle light;
 					switch (it->getType())
 					{
 						case LightSource::DIRECTIONAL:
-							light = m_renderer.createLight("DirectionalLight"); 
+						  light = sceneHandle.createLight("DirectionalLight");
 							break;
 						case LightSource::POSITIONAL:
-							light = m_renderer.createLight("PointLight"); 
+						  light = sceneHandle.createLight("PointLight");
 							break;
 						default:
 							std::cerr << "Light source type not supported!" << std::endl;
@@ -209,7 +250,7 @@ namespace BALL
 						if (it->isRelativeToCamera())
 							direction = stage_->calculateAbsoluteCoordinates(direction);
 
-						lights_[current_light]->setParam("direction", float3(direction.x, direction.y, direction.z));
+						lights_[current_light].setParam3f("direction", float3(direction.x, direction.y, direction.z));
 						break;
 					case LightSource::POSITIONAL:
 						light_position = it->getPosition();
@@ -217,54 +258,75 @@ namespace BALL
 						{
 							light_position = stage_->calculateAbsoluteCoordinates(it->getPosition())+stage_->getCamera().getViewPoint();
 						}
-						lights_[current_light]->setParam("position", float3(light_position.x, light_position.y, light_position.z));
+						lights_[current_light].setParam3f("position", float3(light_position.x, light_position.y, light_position.z));
 
 						attenuation = it->getAttenuation();
-						lights_[current_light]->setParam("attenuation", float3(attenuation.x, attenuation.y, attenuation.z));
+						lights_[current_light].setParam3f("attenuation", float3(attenuation.x, attenuation.y, attenuation.z));
 						break;
 					default:
 						std::cerr << "Light source type not supported!" << std::endl;
 						break;
 				}
+
 				float intensity = it->getIntensity();
 				ColorRGBA const& color = it->getColor();
 
-				lights_[current_light]->setParam("intensity", float3((float)color.getRed()*intensity,(float)color.getGreen()*intensity,(float)color.getBlue()*intensity));
+				lights_[current_light].setParam3f("intensity", float3((float)color.getRed()*intensity,(float)color.getGreen()*intensity,(float)color.getBlue()*intensity));
 			}
 		}
 
 		void RTfactRenderer::updateCamera(const Camera* camera)
 		{
+
 			// the renderer should be paused whenever the camera has been updated
 			if (camera == 0) camera = &(stage_->getCamera());
 
 			Vector3 const& position = camera->getViewPoint();
-			// RTfact relies on a normalized view vector, so we have to normalize it prior to handing it to RTfact 
-			// TODO: Store a normalized view vector in our Camera, mind project files 
+			// RTfact relies on a normalized view vector, so we have to normalize it prior to handing it to RTfact
+			// TODO: Store a normalized view vector in our Camera, mind project files
 			Vector3  view_vector = camera->getViewVector();
 			view_vector.normalize();
 			Vector3 const& look_up = camera->getLookUpVector();
 
-			if (use_continuous_loop_)
-			{
-				if (   ((last_camera_position - position   ).getSquareLength() > 1e-5)
-						 ||((last_camera_view_vec - view_vector).getSquareLength() > 1e-5)
-						 ||((last_camera_lookup   - look_up    ).getSquareLength() > 1e-5))
-						m_renderer.useProgressiveRefinement(false);
-			}
-
-			m_renderer.setCameraPosition(float3(position.x, position.y, position.z),
-																	 float3(view_vector.x, view_vector.y, view_vector.z),
-																	 float3(look_up.x, look_up.y, look_up.z));
+            if(use_continuous_loop_)
+            {
+                if (doVectorsDiffer( last_camera_position, position ))
+                {
+                    cameraHandle.setPosition( float3(position.x, position.y, position.z) );
+                    last_camera_position  = position;
+                }
+
+                if (doVectorsDiffer( last_camera_view_vec, view_vector ))
+                {
+                    cameraHandle.setDirection( float3(view_vector.x, view_vector.y, view_vector.z) );
+                    last_camera_view_vec  = view_vector;
+                }
+
+                if (doVectorsDiffer( last_camera_lookup, look_up ))
+                {
+                    cameraHandle.setUpVector( float3(look_up.x, look_up.y, look_up.z) );
+                    last_camera_lookup    = look_up;
+                }
+            }
+            else
+            {
+                cameraHandle.setPosition( float3(position.x, position.y, position.z) );
+                cameraHandle.setDirection( float3(view_vector.x, view_vector.y, view_vector.z) );
+                cameraHandle.setUpVector( float3(look_up.x, look_up.y, look_up.z) );
+
+                last_camera_position  = position;
+                last_camera_view_vec  = view_vector;
+                last_camera_lookup    = look_up;
+            }
 
 			if (lights_.size() != stage_->getLightSources().size()) return;
-			
+
 			// lights that are relative to the camera need to have their position updated
 			if (lights_.size() == 0) return; // TEST
 			std::list<LightSource>::const_iterator it = stage_->getLightSources().begin();
 			Size current_light=0;
 			Vector3 light_position, direction;
-			
+
 			for (; it != stage_->getLightSources().end(); ++it, ++current_light)
 			{
 				switch (it->getType())
@@ -274,29 +336,29 @@ namespace BALL
 						if (it->isRelativeToCamera())
 							direction = stage_->calculateAbsoluteCoordinates(direction);
 
-						lights_[current_light]->setParam("direction", float3(direction.x, direction.y, direction.z));
+						if(!(lights_[current_light].getParam3f("direction") == float3(direction.x, direction.y, direction.z)))
+							lights_[current_light].setParam3f("direction", float3(direction.x, direction.y, direction.z));
 					case LightSource::POSITIONAL:
 						light_position = it->getPosition();
 						if (it->isRelativeToCamera())
 						{
 							light_position = stage_->calculateAbsoluteCoordinates(it->getPosition())+stage_->getCamera().getViewPoint();
 						}
-						lights_[current_light]->setParam("position", float3(light_position.x, light_position.y, light_position.z));
+
+						if(!(lights_[current_light].getParam3f("position") == float3(light_position.x, light_position.y, light_position.z)))
+							lights_[current_light].setParam3f("position", float3(light_position.x, light_position.y, light_position.z));
 						break;
 					default:
 						break;
 				}
 			}
-			last_camera_position  = position;
-			last_camera_view_vec  = view_vector; 
-			last_camera_lookup    = look_up;
 		}
 
-		void RTfactRenderer::updateBackgroundColor() 
+		void RTfactRenderer::updateBackgroundColor()
 		{
-			m_renderer.setEnvironmentColor(stage_->getBackgroundColor().getRed(),
-																		 stage_->getBackgroundColor().getGreen(),
-																		 stage_->getBackgroundColor().getBlue());
+			sceneHandle.setEnvironmentColor(stage_->getBackgroundColor().getRed(),
+															  stage_->getBackgroundColor().getGreen(),
+																stage_->getBackgroundColor().getBlue(), 1);
 		}
 
 		void RTfactRenderer::setupEnvironmentMap(const QImage& image)
@@ -319,17 +381,85 @@ namespace BALL
 				}
 			}
 
-			m_renderer.setEnvironmentTexture(rtfact_env_map, 3, image.width(), image.height());
+			RTfact::uint colorBufferLength = image.width() * image.height() * 3 * sizeof(float);
+			BufferHandle colorBuffer = RTpieCpp::CreateBufferHandleUseData(colorBufferLength, rtfact_env_map);
+			Image2DHandle imageHandle = RTpieCpp::CreateImage2DHandleUseData(
+								RTfact::RTpie::IImage2D::COMPONENT_FLOAT,
+								3,
+								image.width(), image.height(),
+								colorBuffer
+						);
+
+			sceneHandle.setEnvironmentTexture(imageHandle);
 
 			delete[] (rtfact_env_map);
 		}
-			
+
 		void RTfactRenderer::prepareBufferedRendering(const Stage& stage)
 		{
 			// this function is not needed for this kind of raytracer
 		}
 
-		void RTfactRenderer::bufferRepresentation(const Representation& rep)
+		void transformMeshData(float *mat,
+											float const *vertices, int num_vertices,
+											float const *normals, int num_normals,
+											float *t_vertices, float *t_normals)
+		{
+				TMatrix4x4<float> m(mat);
+				float w;
+				for(int i = 0; i < num_vertices; i++)
+				{
+						TVector4<float> v = m * TVector4<float>(vertices[i*3], vertices[i*3+1], vertices[i*3+2], 1);
+						v.get(t_vertices[i*3], t_vertices[i*3+1], t_vertices[i*3+2], w);
+				}
+
+				for(int i = 0; i < num_normals; i++)
+				{
+						TVector4<float> v = m * TVector4<float>(normals[i*3], normals[i*3+1], normals[i*3+2], 0);
+						v.get(t_normals[i*3], t_normals[i*3+1], t_normals[i*3+2], w);
+				}
+		}
+
+		void setPrimitives(RTpieCpp::MeshHandle aMesh,
+				const RTfact::RTpie::uint32 aTriangleCount,
+				const Index* aIndices,
+				const float* aVertices,
+				const float* aNormals,
+				const float* aVertexColors,
+				const float* aTexCoords, bool reorder = true)
+		{
+				if(reorder)
+				{
+					//reorder
+					RTfact::RTpie::int32* reordered_indices = new RTfact::RTpie::int32[aTriangleCount*3];
+					for(int i = 0;  i < aTriangleCount; i++)
+					{
+							reordered_indices[i * 3 + 2] = aIndices[i * 3 + 0];
+							reordered_indices[i * 3 + 1] = aIndices[i * 3 + 1];
+							reordered_indices[i * 3 + 0] = aIndices[i * 3 + 2];
+					}
+
+					aMesh.setPrimitives(aTriangleCount,
+							reordered_indices, aVertices, aNormals, aVertexColors, aTexCoords);
+
+					delete[] reordered_indices;
+				}
+				else
+				{
+					RTfact::RTpie::int32* converted_indices = new RTfact::RTpie::int32[aTriangleCount*3];
+					for(int i = 0;  i < aTriangleCount; i++)
+					{
+							converted_indices[i * 3 + 0] = aIndices[i * 3 + 0];
+							converted_indices[i * 3 + 1] = aIndices[i * 3 + 1];
+							converted_indices[i * 3 + 2] = aIndices[i * 3 + 2];
+					}
+
+					aMesh.setPrimitives(aTriangleCount,
+							converted_indices, aVertices, aNormals, aVertexColors, aTexCoords);
+				}
+    }
+
+		void RTfactRenderer::bufferRepresentationDynamic(const Representation& rep)
 		{
 			if (rep.getGeometricObjects().empty())
 				return;
@@ -356,9 +486,9 @@ namespace BALL
 					RTfactData& rt_data = objects_[&rep];
 
 					// iterate over all top group handles and add them to the root again to make them visible
-					for (Position i=0; i<rt_data.top_group_handles.size(); ++i)
+					for (Position i=0; i<rt_data.object_handles.size(); ++i)
 					{
-						m_renderer.getRoot()->add(rt_data.top_group_handles[i]);
+						rt_data.instance_handles.push_back(rt_data.object_handles[i].createInstance());
 					}
 
 					objects_[&rep].has_been_disabled = false;
@@ -375,13 +505,14 @@ namespace BALL
 
 			RTfactData rt_data;
 			rt_data.has_been_disabled = false;
+			float trafo[16];
 
-			Stage::RaytracingMaterial rt_material = scene_->getStage()->getRTMaterial();
-			if (rep.hasProperty("RTFact::Material"))
+			Stage::Material rt_material = scene_->getStage()->getMaterial();
+			if (rep.hasProperty("Rendering::Material"))
 			{
-				NamedProperty rt_mat_property = rep.getProperty("RTFact::Material");
+				NamedProperty rt_mat_property = rep.getProperty("Rendering::Material");
 				boost::shared_ptr<PersistentObject> mat_ptr = rt_mat_property.getSmartObject();
-				rt_material = *dynamic_cast<Stage::RaytracingMaterial*>(mat_ptr.get());
+				rt_material = *dynamic_cast<Stage::Material*>(mat_ptr.get());
 			}
 
 			std::list<GeometricObject*>::const_iterator it;
@@ -389,6 +520,7 @@ namespace BALL
 					 it != rep.getGeometricObjects().end();
 					 it++)
 			{
+
 				if (RTTI::isKindOf<Mesh>(**it))
 				{
 					Mesh const& mesh = *(const Mesh*)*it;
@@ -397,44 +529,67 @@ namespace BALL
 					float const* normals  = reinterpret_cast<float const*>(&(mesh.normal[0]));
 					Index const* indices  = reinterpret_cast<Index const*>(&(mesh.triangle[0]));
 
+					//
+					rt_data.material_handles.push_back(
+					    sceneHandle.createAppearance("PhongShader"));
+					convertMaterial(rt_material, rt_data.material_handles.back());
 
-					RTAppearanceHandle material = m_renderer.createAppearance("PhongShader");
-					convertMaterial(rt_material, material);
-
-					GeoHandle handle;
-
+					//
 					float const* colors = 0;
 					if (mesh.colors.size() > 1)
 					{
 						colors  = reinterpret_cast<float const*>(&(mesh.colors[0]));
-						material->setParam("useVertexColor", true);
+						rt_data.material_handles.back().setParamb("useVertexColor", true);
 
-						handle = m_renderer.createGeometry(vertices, normals, colors, (const unsigned int*)indices, (unsigned int)mesh.triangle.size(), material);
-					} 
-					else 
+						//colors conversion (rtfact accepts RGB)
+						float* rgbcolors = new float[3*mesh.colors.size()];
+						for(int i =0; i < mesh.colors.size(); i++)
+						{
+							rgbcolors[i * 3 + 0] = colors[i * 4 + 0];
+							rgbcolors[i * 3 + 1] = colors[i * 4 + 1];
+							rgbcolors[i * 3 + 2] = colors[i * 4 + 2];
+						}
+
+						rt_data.object_handles.push_back(
+								sceneHandle.createGeometry());
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)mesh.triangle.size(),
+							indices, vertices, normals, rgbcolors, 0);
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+
+						delete[] rgbcolors;
+					}
+					else
 					{
 						ColorRGBA const &c = (mesh.colors.size() == 1) ? mesh.colors[0] : ColorRGBA(1., 1., 1., 1.);
 
-						material->setParam("diffuseColor", float3(c.getRed(), c.getGreen(), c.getBlue()));
-						material->setParam("useVertexColor", false);
-
-						handle = m_renderer.createGeometry(vertices, normals, (const unsigned int*)indices, (unsigned int)mesh.triangle.size(), material);
+						rt_data.material_handles.back().setParam3f(
+								"diffuseColor", float3(c.getRed(), c.getGreen(), c.getBlue()));
+						rt_data.material_handles.back().setParamb("useVertexColor", false);
+
+						rt_data.object_handles.push_back(
+								sceneHandle.createGeometry());
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)mesh.triangle.size(),
+							indices, vertices, normals, 0, 0);
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
 					}
 
-					GroupHandle meshGroup = m_renderer.createGroup(Transform::identity());
-					meshGroup->add(handle);                
-
-					if (!rep.isHidden())
-						m_renderer.getRoot()->add(meshGroup);
-
-					rt_data.top_group_handles.push_back(meshGroup);
-					rt_data.object_handles.push_back(handle);
-					rt_data.material_handles.push_back(material);
+					if (!rep.isHidden()) {
+						rt_data.instance_handles.push_back(
+						    rt_data.object_handles.back().createInstance());
+					}
 
-					geometric_objects_[handle] = *it;
+					geometric_objects_inst[rt_data.instance_handles.back()] = *it;
 
 					rtfact_needs_update_ = true;
-				} 
+				}
 
 				if (RTTI::isKindOf<Sphere>(**it))
 				{
@@ -446,44 +601,42 @@ namespace BALL
 
 					ColorRGBA const& color = sphere.getColor();
 
-					RTAppearanceHandle material = m_renderer.createAppearance("PhongShader");
-					convertMaterial(rt_material, material);
-
-					material->setParam("diffuseColor", float3(color.getRed(), color.getGreen(), color.getBlue()));
-					material->setParam("useVertexColor", false);
+					//
+					rt_data.material_handles.push_back(
+					    sceneHandle.createAppearance("PhongShader"));
+					convertMaterial(rt_material, rt_data.material_handles.back());
+					rt_data.material_handles.back().setParam3f(
+							"diffuseColor", float3(color.getRed(), color.getGreen(), color.getBlue()));
+					rt_data.material_handles.back().setParamb("useVertexColor", false);
 
-					GeoHandle handle   = m_renderer.createGeometry(vertices, normals, (const unsigned int*)indices, (unsigned int)sphere_template_.triangle.size(), material);
+					//
+					rt_data.object_handles.push_back(
+							sceneHandle.createGeometry());
+					rt_data.mesh_handles.push_back(
+							rt_data.object_handles.back().createMesh());
+					setPrimitives(rt_data.mesh_handles.back(),
+						(unsigned int)sphere_template_.triangle.size(),
+						indices, vertices, normals, 0, 0);
+					rt_data.mesh_handles.back().setAppearance(
+							rt_data.material_handles.back());
 
+					//
 					Vector3 const& sphere_pos = sphere.getPosition();
 					float radius = sphere.getRadius();
 
-					const float mat[16] = {
+					float mat[16] = {
 						radius, 0, 0, 0,
 						0, radius, 0, 0,
 						0, 0, radius, 0,
 						sphere_pos.x, sphere_pos.y, sphere_pos.z, 1};
 
-					float inv_radius = 1./radius;
-
-					const float inv_mat[16] = {
-						inv_radius, 0, 0, 0,
-						0, inv_radius, 0, 0,
-						0, 0, inv_radius, 0,
-						-sphere_pos.x, -sphere_pos.y, -sphere_pos.z, 1};
-
-					Transform trafo(mat, inv_mat);
-
-					GroupHandle sphereGroup = m_renderer.createGroup(trafo);
-
-					sphereGroup->add(handle);
-					if (!rep.isHidden())
-						m_renderer.getRoot()->add(sphereGroup);
-
-					rt_data.top_group_handles.push_back(sphereGroup);
-					rt_data.object_handles.push_back(handle);
-					rt_data.material_handles.push_back(material);
+					if (!rep.isHidden()) {
+						rt_data.instance_handles.push_back(
+						    rt_data.object_handles.back().createInstance());
+						rt_data.instance_handles.back().setTransform(mat, NULL);
+					}
 
-					geometric_objects_[handle] = *it;
+					geometric_objects_inst[rt_data.instance_handles.back()] = *it;
 
 					rtfact_needs_update_ = true;
 				}
@@ -500,37 +653,60 @@ namespace BALL
 					ColorRGBA const& color1 = old_tube.getColor();
 					ColorRGBA const& color2 = old_tube.getColor2();
 
-					RTAppearanceHandle material_1 = m_renderer.createAppearance("PhongShader");
-					convertMaterial(rt_material, material_1);
-
-					material_1->setParam("diffuseColor", float3(color1.getRed(), color1.getGreen(), color1.getBlue()));
-					material_1->setParam("useVertexColor", false);
+					//
+					rt_data.material_handles.push_back(
+					    sceneHandle.createAppearance("PhongShader"));
+					convertMaterial(rt_material, rt_data.material_handles.back());
+					rt_data.material_handles.back().setParam3f(
+							"diffuseColor", float3(color1.getRed(), color1.getGreen(), color1.getBlue()));
+					rt_data.material_handles.back().setParamb("useVertexColor", false);
 
-					GeoHandle handle_1 = m_renderer.createGeometry(vertices, normals, (const unsigned int*)indices, (unsigned int)tube_template_.triangle.size(), material_1);
+					//
+					rt_data.object_handles.push_back(
+							sceneHandle.createGeometry());
+					geometric_objects_inst[rt_data.instance_handles.back()] = *it;
+					rt_data.mesh_handles.push_back(
+							rt_data.object_handles.back().createMesh());
+					setPrimitives(rt_data.mesh_handles.back(),
+						(unsigned int)tube_template_.triangle.size(),
+						indices, vertices, normals, 0, 0, false);
+					rt_data.mesh_handles.back().setAppearance(
+							rt_data.material_handles.back());
 
 					if (color1 == color2)
 					{
-						GroupHandle tubeGroup = transformTube(old_tube);
-						tubeGroup->add(handle_1);
 
-						if (!rep.isHidden())
-							m_renderer.getRoot()->add(tubeGroup);
+						if (!rep.isHidden()) {
+							rt_data.instance_handles.push_back(
+									rt_data.object_handles.back().createInstance());
 
-						rt_data.top_group_handles.push_back(tubeGroup);
-						rt_data.object_handles.push_back(handle_1);
-						rt_data.material_handles.push_back(material_1);
+							transformTube(old_tube, trafo);
+							rt_data.instance_handles.back().setTransform(trafo, 0);
+						}
 
-						geometric_objects_[handle_1] = *it;
-					} 
-					else 
+					}
+					else
 					{
-						RTAppearanceHandle material_2 = m_renderer.createAppearance("PhongShader");
-						convertMaterial(rt_material, material_2);
-
-						material_2->setParam("diffuseColor", float3(color2.getRed(), color2.getGreen(), color2.getBlue()));
-						material_2->setParam("useVertexColor", false);
-
-						GeoHandle handle_2 = m_renderer.createGeometry(vertices, normals, (const unsigned int*)indices, (unsigned int)tube_template_.triangle.size(), material_2);
+						//
+						rt_data.material_handles.push_back(
+								sceneHandle.createAppearance("PhongShader"));
+						convertMaterial(rt_material, rt_data.material_handles.back());
+						rt_data.material_handles.back().setParam3f(
+								"diffuseColor", float3(color2.getRed(), color2.getGreen(), color2.getBlue()));
+						rt_data.material_handles.back().setParamb("useVertexColor", false);
+
+						//
+						Size last_geom_index = rt_data.object_handles.size() - 1;
+						rt_data.object_handles.push_back(
+								sceneHandle.createGeometry());
+						geometric_objects_inst[rt_data.instance_handles.back()] = *it;
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)tube_template_.triangle.size(),
+							indices, vertices, normals, 0, 0, false);
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
 
 						// NOTE: Just copying tube would be highly dangerous; vertex2 can store pointers
 						//       to the vertices instead of using its own, and these are copied as well!
@@ -544,28 +720,17 @@ namespace BALL
 						new_tube_2.setVertex2(old_tube.getVertex2());
 						new_tube_2.setRadius(old_tube.getRadius());
 
-						GroupHandle all_group = m_renderer.createGroup(Transform::identity());
-
-						GroupHandle tubeGroup_1 = transformTube(new_tube_1);
-						tubeGroup_1->add(handle_1);
-
-						GroupHandle tubeGroup_2 = transformTube(new_tube_2);
-						tubeGroup_2->add(handle_2);
+						if (!rep.isHidden()) {
+							rt_data.instance_handles.push_back(
+									rt_data.object_handles[last_geom_index].createInstance());
+							transformTube(new_tube_1, trafo);
+							rt_data.instance_handles.back().setTransform(trafo, 0);
 
-						all_group->add(tubeGroup_1);
-						all_group->add(tubeGroup_2);
-
-						if (!rep.isHidden())
-							m_renderer.getRoot()->add(all_group);
-
-						rt_data.top_group_handles.push_back(all_group);
-						rt_data.object_handles.push_back(handle_1);
-						rt_data.object_handles.push_back(handle_2);
-						rt_data.material_handles.push_back(material_1);
-						rt_data.material_handles.push_back(material_2);
-
-						geometric_objects_[handle_1] = *it;
-						geometric_objects_[handle_2] = *it;
+							rt_data.instance_handles.push_back(
+									rt_data.object_handles.back().createInstance());
+							transformTube(new_tube_2, trafo);
+							rt_data.instance_handles.back().setTransform(trafo, 0);
+						}
 					}
 
 					rtfact_needs_update_ = true;
@@ -583,37 +748,58 @@ namespace BALL
 					ColorRGBA const& color1 = old_line.getColor();
 					ColorRGBA const& color2 = old_line.getColor2();
 
-					RTAppearanceHandle material_1 = m_renderer.createAppearance("PhongShader");
-					updateMaterialFromStage(material_1);
-
-					material_1->setParam("diffuseColor", float3(color1.getRed(), color1.getGreen(), color1.getBlue()));
-					material_1->setParam("useVertexColor", false);
+					//
+					rt_data.material_handles.push_back(
+					    sceneHandle.createAppearance("PhongShader"));
+					updateMaterialFromStage(rt_data.material_handles.back());
+					rt_data.material_handles.back().setParam3f(
+							"diffuseColor", float3(color1.getRed(), color1.getGreen(), color1.getBlue()));
+					rt_data.material_handles.back().setParamb("useVertexColor", false);
 
-					GeoHandle handle_1 = m_renderer.createGeometry(vertices, normals, (const unsigned int*)indices, (unsigned int)tube_template_.triangle.size(), material_1);
+					//
+					rt_data.object_handles.push_back(
+							sceneHandle.createGeometry());
+					geometric_objects_inst[rt_data.instance_handles.back()] = *it;
+					rt_data.mesh_handles.push_back(
+							rt_data.object_handles.back().createMesh());
+					setPrimitives(rt_data.mesh_handles.back(),
+						(unsigned int)tube_template_.triangle.size(),
+						indices, vertices, normals, 0, 0, false);
+					rt_data.mesh_handles.back().setAppearance(
+							rt_data.material_handles.back());
 
 					if (color1 == color2)
 					{
-						GroupHandle tubeGroup = transformLine(old_line);
-						tubeGroup->add(handle_1);
-
-						if (!rep.isHidden())
-							m_renderer.getRoot()->add(tubeGroup);
-
-						rt_data.top_group_handles.push_back(tubeGroup);
-						rt_data.object_handles.push_back(handle_1);
-						rt_data.material_handles.push_back(material_1);
+						if (!rep.isHidden()) {
+							rt_data.instance_handles.push_back(
+									rt_data.object_handles.back().createInstance());
 
-						geometric_objects_[handle_1] = *it;
-					} 
-					else 
+							transformLine(old_line, trafo);
+							rt_data.instance_handles.back().setTransform(trafo, 0);
+						}
+					}
+					else
 					{
-						RTAppearanceHandle material_2 = m_renderer.createAppearance("PhongShader");
-						updateMaterialFromStage(material_2);
-
-						material_2->setParam("diffuseColor", float3(color2.getRed(), color2.getGreen(), color2.getBlue()));
-						material_2->setParam("useVertexColor", false);
-
-						GeoHandle handle_2 = m_renderer.createGeometry(vertices, normals, (const unsigned int*)indices, (unsigned int)tube_template_.triangle.size(), material_2);
+						//
+						rt_data.material_handles.push_back(
+								sceneHandle.createAppearance("PhongShader"));
+						convertMaterial(rt_material, rt_data.material_handles.back());
+						rt_data.material_handles.back().setParam3f(
+								"diffuseColor", float3(color2.getRed(), color2.getGreen(), color2.getBlue()));
+						rt_data.material_handles.back().setParamb("useVertexColor", false);
+
+						//
+						RTpieCpp::GeometryHandle& lastGeom = rt_data.object_handles.back();
+						rt_data.object_handles.push_back(
+								sceneHandle.createGeometry());
+						geometric_objects_inst[rt_data.instance_handles.back()] = *it;
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)tube_template_.triangle.size(),
+							indices, vertices, normals, 0, 0, false);
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
 
 						// NOTE: Just copying tube would be highly dangerous; vertex2 can store pointers
 						//       to the vertices instead of using its own, and these are copied as well!
@@ -627,36 +813,411 @@ namespace BALL
 						new_line_2.setVertex2(old_line.getVertex2());
 						//new_line_2.setRadius(LINE_RADIUS);//old_line.getRadius());
 
-						GroupHandle all_group = m_renderer.createGroup(Transform::identity());
+						if (!rep.isHidden()) {
+							rt_data.instance_handles.push_back(
+									lastGeom.createInstance());
+							transformLine(new_line_1, trafo);
+							rt_data.instance_handles.back().setTransform(trafo, 0);
+
+							rt_data.instance_handles.push_back(
+									rt_data.object_handles.back().createInstance());
+							transformLine(new_line_2, trafo);
+							rt_data.instance_handles.back().setTransform(trafo, 0);
+						}
+					}
+
+					rtfact_needs_update_ = true;
+
+				}
+			}
+
+			objects_[&rep] = rt_data;
+		}
+
+		void RTfactRenderer::bufferRepresentation(const Representation& rep)
+		{
+			if (rep.getGeometricObjects().empty())
+				return;
+
+			if (rep.isHidden())
+			{
+				if (rep.needsUpdate())
+				{
+					// if the representation has been changed while it was hidden, we need
+					// to recreate it from scratch the next time it is enabled
+					//
+					// NOTE: it is safe to call removeRepresentation even if the representation
+					//       has not yet been added
+					removeRepresentation(rep);
+				}
+				return;
+			}
+
+			if (objects_.find(&rep) != objects_.end())
+			{
+				// was the representation previously disabled and now just needs enabling?
+				if (objects_[&rep].has_been_disabled)
+				{
+					RTfactData& rt_data = objects_[&rep];
+
+					// iterate over all top group handles and add them to the root again to make them visible
+					for (Position i=0; i<rt_data.object_handles.size(); ++i)
+					{
+						rt_data.instance_handles.push_back(rt_data.object_handles[i].createInstance());
+					}
+
+					objects_[&rep].has_been_disabled = false;
+					rtfact_needs_update_ = true;
+
+					return;
+				}
+				else
+				{
+					// TODO: handle the update more gracefully!
+					removeRepresentation(rep);
+				}
+			}
+
+			RTfactData rt_data;
+			rt_data.has_been_disabled = false;
+
+			Stage::Material rt_material = scene_->getStage()->getMaterial();
+			if (rep.hasProperty("Rendering::Material"))
+			{
+				NamedProperty rt_mat_property = rep.getProperty("Rendering::Material");
+				boost::shared_ptr<PersistentObject> mat_ptr = rt_mat_property.getSmartObject();
+				rt_material = *dynamic_cast<Stage::Material*>(mat_ptr.get());
+			}
+
+			rt_data.cutPlaneShader = sceneHandle.createAppearance("PhongShader");
+			rt_data.cutPlaneShader.setParam3f("diffuseColor", float3(0.0f, 0.0, 1.0f));
+			rt_data.cutPlaneShader.setParam3f("ambientIntensity", float3(.0f, .0f, .0f));
+			rt_data.cutPlaneShader.setParamf("transparency", 0.7f);
 
-						GroupHandle tubeGroup_1 = transformLine(new_line_1);
-						tubeGroup_1->add(handle_1);
+			//
+			rt_data.object_handles.push_back(
+					sceneHandle.createGeometry());
 
-						GroupHandle tubeGroup_2 = transformLine(new_line_2);
-						tubeGroup_2->add(handle_2);
+			std::list<GeometricObject*>::const_iterator it;
+			for (it =  rep.getGeometricObjects().begin();
+					 it != rep.getGeometricObjects().end();
+					 it++)
+			{
+
+				if (RTTI::isKindOf<Mesh>(**it))
+				{
+					Mesh const& mesh = *(const Mesh*)*it;
+
+					float const* vertices = reinterpret_cast<float const*>(&(mesh.vertex[0]));
+					float const* normals  = reinterpret_cast<float const*>(&(mesh.normal[0]));
+					Index const* indices  = reinterpret_cast<Index const*>(&(mesh.triangle[0]));
+
+					//
+					rt_data.material_handles.push_back(
+					    sceneHandle.createAppearance("PhongShader"));
+					convertMaterial(rt_material, rt_data.material_handles.back());
+
+					//
+					float const* colors = 0;
+					if (mesh.colors.size() > 1)
+					{
+						colors  = reinterpret_cast<float const*>(&(mesh.colors[0]));
+						rt_data.material_handles.back().setParamb("useVertexColor", true);
+
+						//colors conversion (rtfact accepts RGB)
+						float* rgbcolors = new float[3*mesh.colors.size()];
+						for(int i =0; i < mesh.colors.size(); i++)
+						{
+							rgbcolors[i * 3 + 0] = colors[i * 4 + 0];
+							rgbcolors[i * 3 + 1] = colors[i * 4 + 1];
+							rgbcolors[i * 3 + 2] = colors[i * 4 + 2];
+						}
+
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)mesh.triangle.size(),
+							indices, vertices, normals, rgbcolors, 0);
+
+						delete[] rgbcolors;
+					}
+					else
+					{
+						ColorRGBA const &c = (mesh.colors.size() == 1) ? mesh.colors[0] : ColorRGBA(1., 1., 1., 1.);
+
+						rt_data.material_handles.back().setParam3f(
+								"diffuseColor", float3(c.getRed(), c.getGreen(), c.getBlue()));
+						rt_data.material_handles.back().setParamb("useVertexColor", false);
+
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)mesh.triangle.size(),
+							indices, vertices, normals, 0, 0);
+					}
+
+					geometric_objects_[rt_data.mesh_handles.back()] = *it;
+
+					rtfact_needs_update_ = true;
+				}
+
+				if (RTTI::isKindOf<Sphere>(**it))
+				{
+					Sphere const& sphere = *(const Sphere*)*it;
+
+					float const* vertices = reinterpret_cast<float const*>(&(sphere_template_.vertex[0]));
+					float const* normals  = reinterpret_cast<float const*>(&(sphere_template_.normal[0]));
+					Index const* indices  = reinterpret_cast<Index const*>(&(sphere_template_.triangle[0]));
+
+					ColorRGBA const& color = sphere.getColor();
+
+					//
+					rt_data.material_handles.push_back(
+					    sceneHandle.createAppearance("PhongShader"));
+					convertMaterial(rt_material, rt_data.material_handles.back());
+					rt_data.material_handles.back().setParam3f(
+							"diffuseColor", float3(color.getRed(), color.getGreen(), color.getBlue()));
+					rt_data.material_handles.back().setParamb("useVertexColor", false);
+
+					//
+					rt_data.mesh_handles.push_back(
+							rt_data.object_handles.back().createMesh());
+					rt_data.mesh_handles.back().setAppearance(
+							rt_data.material_handles.back());
+
+					Vector3 const& sphere_pos = sphere.getPosition();
+					float radius = sphere.getRadius();
+
+					float mat[16] = {
+						radius, 0, 0, sphere_pos.x,
+						0, radius, 0, sphere_pos.y,
+						0, 0, radius, sphere_pos.z,
+						0, 0, 0, 1};
+					float* t_vertices = new float[3*sphere_template_.getNumberOfVertices()];
+					float* t_normals = new float[3*sphere_template_.getNumberOfNormals()];
+
+					transformMeshData(mat,
+														vertices, sphere_template_.getNumberOfVertices(),
+														normals, sphere_template_.getNumberOfNormals(),
+														t_vertices, t_normals);
+					geometric_objects_[rt_data.mesh_handles.back()] = *it;
+					setPrimitives(rt_data.mesh_handles.back(),
+						(unsigned int)sphere_template_.triangle.size(),
+						indices, t_vertices, t_normals, 0, 0);
+
+					delete[] t_vertices;
+					delete[] t_normals;
+
+					rtfact_needs_update_ = true;
+				}
+
+				if (RTTI::isKindOf<TwoColoredTube>(**it))
+				{
+					TwoColoredTube const& old_tube = *(const TwoColoredTube*)*it;
+
+					float const* vertices = reinterpret_cast<float const*>(&(tube_template_.vertex[0]));
+					float const* normals  = reinterpret_cast<float const*>(&(tube_template_.normal[0]));
+					Index const* indices  = reinterpret_cast<Index const*>(&(tube_template_.triangle[0]));
+
+					// we will produce two tubes using the same vertex/normal/color values, just with the correct offsets
+					ColorRGBA const& color1 = old_tube.getColor();
+					ColorRGBA const& color2 = old_tube.getColor2();
+
+					//
+					rt_data.material_handles.push_back(
+					    sceneHandle.createAppearance("PhongShader"));
+					convertMaterial(rt_material, rt_data.material_handles.back());
+					rt_data.material_handles.back().setParam3f(
+							"diffuseColor", float3(color1.getRed(), color1.getGreen(), color1.getBlue()));
+					rt_data.material_handles.back().setParamb("useVertexColor", false);
+
+					float mat[16];
+					float* t_vertices = new float[3*tube_template_.getNumberOfVertices()];
+					float* t_normals = new float[3*tube_template_.getNumberOfNormals()];
+
+					//
+					if (color1 == color2)
+					{
+						transformTube(old_tube, mat);
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+						transformMeshData(mat,
+															vertices, tube_template_.getNumberOfVertices(),
+															normals, tube_template_.getNumberOfNormals(),
+															t_vertices, t_normals);
+						geometric_objects_[rt_data.mesh_handles.back()] = *it;
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)tube_template_.triangle.size(),
+							indices, t_vertices, t_normals, 0, 0, false);
+					}
+					else
+					{
+						TwoColoredTube new_tube_1, new_tube_2;
+
+						//
+						new_tube_1.setVertex1(old_tube.getVertex1());
+						new_tube_1.setVertex2(old_tube.getMiddleVertex());
+						new_tube_1.setRadius(old_tube.getRadius());
+
+						//
+						new_tube_2.setVertex1(old_tube.getMiddleVertex());
+						new_tube_2.setVertex2(old_tube.getVertex2());
+						new_tube_2.setRadius(old_tube.getRadius());
+
+						//
+						transformTube(new_tube_1, mat);
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+						transformMeshData(mat,
+															vertices, tube_template_.getNumberOfVertices(),
+															normals, tube_template_.getNumberOfNormals(),
+															t_vertices, t_normals);
+						geometric_objects_[rt_data.mesh_handles.back()] = *it;
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)tube_template_.triangle.size(),
+							indices, t_vertices, t_normals, 0, 0, false);
+
+						//
+						rt_data.material_handles.push_back(
+								sceneHandle.createAppearance("PhongShader"));
+						convertMaterial(rt_material, rt_data.material_handles.back());
+						rt_data.material_handles.back().setParam3f(
+								"diffuseColor", float3(color2.getRed(), color2.getGreen(), color2.getBlue()));
+						rt_data.material_handles.back().setParamb("useVertexColor", false);
+
+						//
+						transformTube(new_tube_2, mat);
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+						transformMeshData(mat,
+															vertices, tube_template_.getNumberOfVertices(),
+															normals, tube_template_.getNumberOfNormals(),
+															t_vertices, t_normals);
+						geometric_objects_[rt_data.mesh_handles.back()] = *it;
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)tube_template_.triangle.size(),
+							indices, t_vertices, t_normals, 0, 0, false);
+					}
 
-						all_group->add(tubeGroup_1);
-						all_group->add(tubeGroup_2);
+					delete[] t_vertices;
+					delete[] t_normals;
 
-						if (!rep.isHidden())
-							m_renderer.getRoot()->add(all_group);
+					rtfact_needs_update_ = true;
+				}
+
+				if (RTTI::isKindOf<TwoColoredLine>(**it))
+				{
+					TwoColoredLine const& old_line = *(const TwoColoredLine*)*it;
+
+					float const* vertices = reinterpret_cast<float const*>(&(tube_template_.vertex[0]));
+					float const* normals  = reinterpret_cast<float const*>(&(tube_template_.normal[0]));
+					Index const* indices  = reinterpret_cast<Index const*>(&(tube_template_.triangle[0]));
+
+					// we will produce two tubes using the same vertex/normal/color values, just with the correct offsets
+					ColorRGBA const& color1 = old_line.getColor();
+					ColorRGBA const& color2 = old_line.getColor2();
+
+					//
+					rt_data.material_handles.push_back(
+					    sceneHandle.createAppearance("PhongShader"));
+					updateMaterialFromStage(rt_data.material_handles.back());
+					rt_data.material_handles.back().setParam3f(
+							"diffuseColor", float3(color1.getRed(), color1.getGreen(), color1.getBlue()));
+					rt_data.material_handles.back().setParamb("useVertexColor", false);
 
-						rt_data.top_group_handles.push_back(all_group);
-						rt_data.object_handles.push_back(handle_1);
-						rt_data.object_handles.push_back(handle_2);
-						rt_data.material_handles.push_back(material_1);
-						rt_data.material_handles.push_back(material_2);
+					float mat[16];
+					float* t_vertices = new float[3*tube_template_.getNumberOfVertices()];
+					float* t_normals = new float[3*tube_template_.getNumberOfNormals()];
+
+					if (color1 == color2)
+					{
+						transformLine(old_line, mat);
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+						transformMeshData(mat,
+															vertices, tube_template_.getNumberOfVertices(),
+															normals, tube_template_.getNumberOfNormals(),
+															t_vertices, t_normals);
+						geometric_objects_[rt_data.mesh_handles.back()] = *it;
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)tube_template_.triangle.size(),
+							indices, t_vertices, t_normals, 0, 0, false);
+					}
+					else
+					{
+						TwoColoredLine new_line_1, new_line_2;
+
+						new_line_1.setVertex1(old_line.getVertex1());
+						new_line_1.setVertex2(old_line.getMiddleVertex());
+						//new_line_1.setRadius(LINE_RADIUS);//old_line.getRadius());
+
+						new_line_2.setVertex1(old_line.getMiddleVertex());
+						new_line_2.setVertex2(old_line.getVertex2());
+						//new_line_2.setRadius(LINE_RADIUS);//old_line.getRadius());
+
+						//
+						transformLine(new_line_1, mat);
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+						transformMeshData(mat,
+															vertices, tube_template_.getNumberOfVertices(),
+															normals, tube_template_.getNumberOfNormals(),
+															t_vertices, t_normals);
+						geometric_objects_[rt_data.mesh_handles.back()] = *it;
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)tube_template_.triangle.size(),
+							indices, t_vertices, t_normals, 0, 0, false);
+
+						//
+						rt_data.material_handles.push_back(
+								sceneHandle.createAppearance("PhongShader"));
+						convertMaterial(rt_material, rt_data.material_handles.back());
+						rt_data.material_handles.back().setParam3f(
+								"diffuseColor", float3(color2.getRed(), color2.getGreen(), color2.getBlue()));
+						rt_data.material_handles.back().setParamb("useVertexColor", false);
+
+						//
+						transformLine(new_line_2, mat);
+						rt_data.mesh_handles.push_back(
+								rt_data.object_handles.back().createMesh());
+						rt_data.mesh_handles.back().setAppearance(
+								rt_data.material_handles.back());
+						transformMeshData(mat,
+															vertices, tube_template_.getNumberOfVertices(),
+															normals, tube_template_.getNumberOfNormals(),
+															t_vertices, t_normals);
+						geometric_objects_[rt_data.mesh_handles.back()] = *it;
+						setPrimitives(rt_data.mesh_handles.back(),
+							(unsigned int)tube_template_.triangle.size(),
+							indices, t_vertices, t_normals, 0, 0, false);
 
-						geometric_objects_[handle_1] = *it;
-						geometric_objects_[handle_2] = *it;
 					}
 
 					rtfact_needs_update_ = true;
+
 				}
 			}
 
-			if (rtfact_needs_update_ && use_continuous_loop_)
-				m_renderer.useProgressiveRefinement(false);
+			if (!rep.isHidden()) {
+				rt_data.instance_handles.push_back(
+						rt_data.object_handles.back().createInstance());
+			}
 
 			objects_[&rep] = rt_data;
 		}
@@ -667,22 +1228,24 @@ namespace BALL
 			{
 				// TODO: find out if this also deletes the geometries and materials
 				RTfactData& rt_data = objects_[&rep];
-				GroupHandle root = m_renderer.getRoot();
 
-				for (Position i=0; i<rt_data.top_group_handles.size(); ++i)
+				for (Position i=0; i<rt_data.mesh_handles.size(); ++i)
 				{
-					root->remove(rt_data.top_group_handles[i]);
-
-					for (Position current_geo_handle=0; current_geo_handle<rt_data.object_handles.size(); ++current_geo_handle)
-					{
-						geometric_objects_.erase(rt_data.object_handles[current_geo_handle]);
-					}
+					geometric_objects_.erase(rt_data.mesh_handles[i]);
+				}
+				for (Position i=0; i<rt_data.instance_handles.size(); ++i)
+				{
+					geometric_objects_inst.erase(rt_data.instance_handles[i]);
+					rt_data.instance_handles[i].clear();
 				}
 
-				rtfact_needs_update_ = true;
+				rt_data.instance_handles.clear();
+
+				rt_data.material_handles.clear();
 
-				if (use_continuous_loop_ && !rep.isHidden())
-					m_renderer.useProgressiveRefinement(false);
+				rt_data.mesh_handles.clear();
+
+				rtfact_needs_update_ = true;
 
 				objects_.erase(&rep);
 			}
@@ -690,13 +1253,40 @@ namespace BALL
 
 		void RTfactRenderer::useContinuousLoop(bool use_loop)
 		{
-			Renderer::useContinuousLoop(use_loop);
+            Renderer::useContinuousLoop(use_loop);
+            renderTask.setAccumulatePixels(use_loop);
+		}
 
-			m_renderer.useProgressiveRefinement(use_loop);
+		// line x plane intersection
+		void intersection(Vector3 p, Vector3 d, // line = point + direction
+										 Vector3 o, Vector3 n, // plane = origin + normal
+										 Vector3* op, int& on)
+		{
+				float c = - o * n;
+				float dn = d * n;
+				if(dn == 0.0f)
+						return;
+				float t = - (n * p + c) / dn;
+				if(t >= 0.0f && t <= 1.0f)
+				{
+						op[on++] = p + t * d;
+				}
 		}
 
+		struct PlanarPointsCompare {
+				Vector3 orig, norm;
+				PlanarPointsCompare(Vector3 _orig, Vector3 _norm) : norm(_norm), orig(_orig) {}
+				bool operator() (const Vector3 &a, const Vector3 &b) {
+						Vector3 v = (a - orig) % (b - orig);
+						return (v * norm) < 0;
+				}
+		};
+
 		void RTfactRenderer::renderToBufferImpl(FrameBufferPtr buffer)
-		{		    
+		{
+			if (!getMainControl())
+				return;
+
 			Stage const& stage = *(scene_->getStage());
 
 			// deactivate hidden representations (we need no reactivation code,
@@ -708,63 +1298,284 @@ namespace BALL
 					// It is safe to remove a group multiple times from RTfact. It may not be
 					// *fast*, but it should be safe.
 					RTfactData& rt_data = it->second;
-					GroupHandle root = m_renderer.getRoot();
 
-					for (Position i=0; i<rt_data.top_group_handles.size(); ++i)
+					for (Position i=0; i<rt_data.instance_handles.size(); ++i)
 					{
-						root->remove(rt_data.top_group_handles[i]);
+					  rt_data.instance_handles[i].clear();
 					}
 
+					rt_data.instance_handles.clear();
+
 					it->second.has_been_disabled = true;
 
 					rtfact_needs_update_ = true;
 				}
 			}
 
+			//clipping planes
+			RepresentationManager& pm = getMainControl()->getRepresentationManager();
+			const vector<ClippingPlane*>& vc = pm.getClippingPlanes();
+			RepresentationList::const_iterator it = pm.getRepresentations().begin();
+			for (; it != pm.getRepresentations().end(); it++)
+			{
+			    std::map< RTpieCpp::InstanceHandle, std::vector<Vector3> > normals;
+			    std::map< RTpieCpp::InstanceHandle, std::vector<Vector3> > points;
+			    std::map< RTpieCpp::InstanceHandle, std::vector<bool> > active;
+                std::map< RTpieCpp::InstanceHandle, std::vector<ColorRGBA> > cappingColors;
+
+					const Representation& rep = **it;
+
+					// has this representation been buffered already?
+					if (objects_.find(&rep) == objects_.end())
+						continue;
+
+					RTfactData& rtfactData = objects_[&rep];
+					bool cappingEnabled = false;
+
+					vector<ClippingPlane*>::const_iterator plane_it = vc.begin();
+					for (;plane_it != vc.end(); plane_it++)
+					{
+							ClippingPlane& plane = **plane_it;
+
+                            //This line means if the clipping plane clips the given representation
+                            if (!plane.getRepresentations().has(*it)) continue;
+							if (plane.isHidden()) continue;
+
+							std::vector<RTpieCpp::InstanceHandle>::iterator iit = rtfactData.instance_handles.begin();
+							for(; iit != rtfactData.instance_handles.end(); iit++)
+							{
+
+									const Vector3& n(plane.getNormal());
+									const Vector3& p(plane.getPoint());
+
+                                    normals[*iit].push_back(n);
+                                    points[*iit].push_back(p);
+                                    active[*iit].push_back(plane.isActive());
+                                    cappingColors[*iit].push_back(plane.getCappingColor());
+
+							}
+
+							cappingEnabled = plane.cappingEnabled();
+					}
+
+					std::vector<RTpieCpp::InstanceHandle>::iterator iit = rtfactData.instance_handles.begin();
+					for(; iit != rtfactData.instance_handles.end(); iit++)
+					{
+							const std::vector<Vector3>& instanceNormals = normals[*iit];
+							const std::vector<Vector3>& instancePoints = points[*iit];
+							const std::vector<bool>& instanceActive = active[*iit];
+                            const std::vector<ColorRGBA>& instanceCappingColors = cappingColors[*iit];
+							const int n = instanceNormals.size();
+
+                            float* data = new float[n*9];
+
+							int a = 0;
+							for(int i = 0; i < n; i++)
+							{
+									if(!instanceActive[i]) continue;
+									data[0*n + a] = instanceNormals[i].x;
+									data[1*n + a] = instanceNormals[i].y;
+									data[2*n + a] = instanceNormals[i].z;
+									data[3*n + a] = instancePoints[i].x;
+									data[4*n + a] = instancePoints[i].y;
+									data[5*n + a] = instancePoints[i].z;
+                                    data[6*n + a] = instanceCappingColors[i].getRed();
+                                    data[7*n + a] = instanceCappingColors[i].getGreen();
+                                    data[8*n + a] = instanceCappingColors[i].getBlue();
+									a++;
+							}
+
+							//TODO: color from ballview configuration
+                            iit->setCutPlanes(cappingEnabled, float3(data[6*n], data[7*n], data[8*n]), a,
+									data+0*n, data+1*n, data+2*n,
+									data+3*n, data+4*n, data+5*n);
+
+
+							//visualization
+							//TODO: there is a bug somewhere (some intersections are in the origin)
+							float min[3];
+							float max[3];
+							iit->getBounds(min, max);
+
+							rtfactData.cutPlaneInstances.clear();
+							rtfactData.cutPlaneMeshes.clear();
+							rtfactData.cutPlanes.clear();
+
+                            //Add the geometry for drawing the clipping plane if it is visible but not active
+                            for(int j = 0; j < n; j++)
+                            {
+                                    if(instanceActive[j]) continue;
+
+									int m = 0;
+									Vector3 p[6];
+
+									//
+									intersection(Vector3(min[0], min[1], min[2]), Vector3(max[0]-min[0], 0, 0), instancePoints[j], instanceNormals[j], p, m);
+									intersection(Vector3(min[0], min[1], min[2]), Vector3(0, max[1]-min[1], 0), instancePoints[j], instanceNormals[j], p, m);
+									intersection(Vector3(min[0], min[1], min[2]), Vector3(0, 0, max[2]-min[2]), instancePoints[j], instanceNormals[j], p, m);
+									intersection(Vector3(max[0], max[1], max[2]), Vector3(min[0]-max[0], 0, 0), instancePoints[j], instanceNormals[j], p, m);
+									intersection(Vector3(max[0], max[1], max[2]), Vector3(0, min[1]-max[1], 0), instancePoints[j], instanceNormals[j], p, m);
+									intersection(Vector3(max[0], max[1], max[2]), Vector3(0, 0, min[2]-max[2]), instancePoints[j], instanceNormals[j], p, m);
+
+									intersection(Vector3(max[0], max[1], min[2]), Vector3(min[0]-max[0], 0, 0), instancePoints[j], instanceNormals[j], p, m);
+									intersection(Vector3(max[0], max[1], min[2]), Vector3(0, min[1]-max[1], 0), instancePoints[j], instanceNormals[j], p, m);
+
+									intersection(Vector3(min[0], min[1], max[2]), Vector3(max[0]-min[0], 0, 0), instancePoints[j], instanceNormals[j], p, m);
+									intersection(Vector3(min[0], min[1], max[2]), Vector3(0, max[1]-min[1], 0), instancePoints[j], instanceNormals[j], p, m);
+
+									intersection(Vector3(max[0], min[1], min[2]), Vector3(0, 0, max[2]-min[2]), instancePoints[j], instanceNormals[j], p, m);
+									intersection(Vector3(min[0], max[1], min[2]), Vector3(0, 0, max[2]-min[2]), instancePoints[j], instanceNormals[j], p, m);
+
+									//
+									PlanarPointsCompare cmp(p[0], instanceNormals[0]);
+									std::sort(p, p + m, cmp);
+
+									//
+									Index* CUTPLANE_INDICES = new Index[3*m];
+									float* CUTPLANE_POSITIONS = new float[3 * 3 * (m-2)];
+									float* CUTPLANE_NORMALS = new float[3 * 3 * (m-2)];
+
+									for(int i = 0; i < m-2; i++)
+									{
+											CUTPLANE_POSITIONS[i*3*3 + 0] = p[0].x;
+											CUTPLANE_POSITIONS[i*3*3 + 1] = p[0].y;
+											CUTPLANE_POSITIONS[i*3*3 + 2] = p[0].z;
+
+											CUTPLANE_POSITIONS[i*3*3 + 3] = p[i+1].x;
+											CUTPLANE_POSITIONS[i*3*3 + 4] = p[i+1].y;
+											CUTPLANE_POSITIONS[i*3*3 + 5] = p[i+1].z;
+
+											CUTPLANE_POSITIONS[i*3*3 + 6] = p[i+2].x;
+											CUTPLANE_POSITIONS[i*3*3 + 7] = p[i+2].y;
+											CUTPLANE_POSITIONS[i*3*3 + 8] = p[i+2].z;
+									}
+
+									for(int i = 0; i < 3*(m-2); i++)
+									{
+											CUTPLANE_INDICES[i] = i;
+											CUTPLANE_NORMALS[i*3 + 0] = instanceNormals[0].x;
+											CUTPLANE_NORMALS[i*3 + 1] = instanceNormals[0].y;
+											CUTPLANE_NORMALS[i*3 + 2] = instanceNormals[0].z;
+									}
+
+									//
+									rtfactData.cutPlanes.push_back(sceneHandle.createGeometry());
+									rtfactData.cutPlaneMeshes.push_back(rtfactData.cutPlanes.back().createMesh());
+									setPrimitives(rtfactData.cutPlaneMeshes.back(),
+										m-2,
+										CUTPLANE_INDICES,
+										CUTPLANE_POSITIONS,
+										CUTPLANE_NORMALS,
+										0, 0);
+									rtfactData.cutPlaneMeshes.back().setAppearance(rtfactData.cutPlaneShader);
+									rtfactData.cutPlaneInstances.push_back( rtfactData.cutPlanes.back().createInstance() );
+
+									float m1[16], m2[16];
+									iit->getTransform(m1, m2);
+									rtfactData.cutPlaneInstances.back().setTransform(m1,m2);
+
+									rtfactData.cutPlaneInstances.back().setDropShadow(false);
+
+									//
+									delete[] CUTPLANE_INDICES;
+									delete[] CUTPLANE_POSITIONS;
+									delete[] CUTPLANE_NORMALS;
+							}
+
+					}
+
+			}
+
 			if (rtfact_needs_update_)
 			{
-				m_renderer.createAccelStruct();
+				rayTracer.syncStructures();
 				rtfact_needs_update_ = false;
 			}
 
-			FrameBufferFormat fmt = buffer->getFormat();		    
+			FrameBufferFormat fmt = buffer->getFormat();
 			if (objects_.size() != 0)
 			{
+
+				Image2DHandle distanceBufferHandle;
+				Image2DHandle colorBufferHandle;
+
 				if (fmt.getPixelFormat() == PixelFormat::RGBF_96)
 				{
- 					m_renderer.attachFrameBuffer((float*)buffer->getData()+offset_, 3, width_, height_, width_+stride_);
+					//color buffer (use given memory)
+					t_ColorImage* colorImage = new t_ColorImage((float*)buffer->getData(), 3, width_, height_, width_+stride_, false);
+					RTfact::uint colorBufferLength = colorImage->getResX() * colorImage->getResY()* colorImage->getComponentCount() * sizeof(t_ColorImage::Component);
+					BufferHandle colorBuffer = RTpieCpp::CreateBufferHandleUseData(colorBufferLength, colorImage->getFirstComponent(0,0));
+					colorBufferHandle = RTpieCpp::CreateImage2DHandleUseData(RTfact::RTpie::IImage2D::COMPONENT_FLOAT, 3, width_, height_, colorBuffer);
+
+					//distance buffer
+					t_DistanceImage* distanceImage = new t_DistanceImage(1, width_, height_);
+					RTfact::uint distanceBufferLength = distanceImage->getResX() * distanceImage->getResY()* distanceImage->getComponentCount() * sizeof(t_DistanceImage::Component);
+					BufferHandle distanceBuffer = RTpieCpp::CreateBufferHandleUseData(distanceBufferLength, distanceImage->getFirstComponent(0,0));
+					distanceBufferHandle = RTpieCpp::CreateImage2DHandleUseData(RTfact::RTpie::IImage2D::COMPONENT_FLOAT, 1, width_, height_, distanceBuffer);
+
+					//set framebuffer buffers
+					framebuffer.setColorImage(colorImage);
+					framebuffer.setDistanceImage(distanceImage);
 				}
 				else if (fmt.getPixelFormat() == PixelFormat::RGBA_32)
 				{
- 					m_renderer.attachFrameBuffer((unsigned char*)buffer->getData()+offset_, 4, width_, height_, width_+stride_);
+					//color buffer (use given memory)
+					t_ByteColorImage* colorImage = new t_ByteColorImage((unsigned char*)buffer->getData(), 4, width_, height_, width_+stride_, false);
+					RTfact::uint colorBufferLength = colorImage->getResX() * colorImage->getResY()* colorImage->getComponentCount() * sizeof(t_ByteColorImage::Component);
+					BufferHandle colorBuffer = RTpieCpp::CreateBufferHandleUseData(colorBufferLength, colorImage->getFirstComponent(0,0));
+					colorBufferHandle = RTpieCpp::CreateImage2DHandleUseData(RTfact::RTpie::IImage2D::COMPONENT_BYTE, 4, width_, height_, colorBuffer);
+
+					//distance buffer
+					t_ByteDistanceImage* distanceImage = new t_ByteDistanceImage(1, width_, height_);
+					RTfact::uint distanceBufferLength = distanceImage->getResX() * distanceImage->getResY()* distanceImage->getComponentCount() * sizeof(t_ByteDistanceImage::Component);
+					BufferHandle distanceBuffer = RTpieCpp::CreateBufferHandleUseData(distanceBufferLength, distanceImage->getFirstComponent(0,0));
+					distanceBufferHandle = RTpieCpp::CreateImage2DHandleUseData(RTfact::RTpie::IImage2D::COMPONENT_BYTE, 1, width_, height_, distanceBuffer);
+
+					//set framebuffer buffers
+					byteFramebuffer.setColorImage(colorImage);
+					byteFramebuffer.setDistanceImage(distanceImage);
 				}
 				else
 				{
 					return;
 				}
 
-				m_renderer.renderToBuffer();
+				//set framebuffer to rendertask
+				renderBuffer = RTpieCpp::CreateFrameBufferHandle();
+				renderBuffer.setColorBuffer(colorBufferHandle);
+				renderBuffer.setDistanceBuffer(distanceBufferHandle);
+				renderTask.setFrameBuffer(renderBuffer);
+
+				//
+				framebuffer.prePaint();
+
+				fpsMeter.startFrame();
+
+				rayTracer.syncStructures();
+
+				renderTask.run();
+
+				fpsMeter.endFrame();
+
+				framebuffer.postPaint();
 
-				if (use_continuous_loop_)
-				{
-					m_renderer.useProgressiveRefinement(true);
-				}
 			}
 		}
 
 		void RTfactRenderer::updateMaterialForRepresentation(Representation const* rep)
 		{
+
 			if (objects_.find(rep) != objects_.end())
 			{
 				RTfactData& rt_data = objects_[rep];
 
 				for (Position i=0; i<rt_data.material_handles.size(); ++i)
 				{
-					if (rep->hasProperty("RTFact::Material"))
+					if (rep->hasProperty("Rendering::Material"))
 					{
-						NamedProperty rt_mat_property = rep->getProperty("RTFact::Material");
+						NamedProperty rt_mat_property = rep->getProperty("Rendering::Material");
 						boost::shared_ptr<PersistentObject> mat_ptr = rt_mat_property.getSmartObject();
-						convertMaterial(*dynamic_cast<Stage::RaytracingMaterial*>(mat_ptr.get()), rt_data.material_handles[i]);
+						convertMaterial(*dynamic_cast<Stage::Material*>(mat_ptr.get()), rt_data.material_handles[i]);
 					}
 					else
 						updateMaterialFromStage(rt_data.material_handles[i]);
@@ -772,7 +1583,7 @@ namespace BALL
 			}
 		}
 
-		GroupHandle RTfactRenderer::transformTube(const TwoColoredTube& tube) 
+		void RTfactRenderer::transformTube(const TwoColoredTube& tube, float *trafo)
 		{
 			Vector3 vec = tube.getVertex2() - tube.getVertex1();
 			const double len = vec.getLength();
@@ -783,7 +1594,7 @@ namespace BALL
 			//Rotate the vector around the normal
 			vec /= sqrt(vec.x*vec.x + vec.y*vec.y);
 
-			Matrix4x4 matrix = Matrix4x4::getIdentity(); 
+			Matrix4x4 matrix = Matrix4x4::getIdentity();
 			matrix.rotate(Angle(-angle), vec.y, -vec.x, 0);
 
 			Matrix4x4 temp;
@@ -793,18 +1604,12 @@ namespace BALL
 			temp.setTranslation(midpoint);
 			matrix = temp*matrix;
 
-			//return m_renderer.createGroup(	Transform::translation(midpoint.x, midpoint.y, midpoint.z)
-			//															 *matrix*Transform::scale(Vec3f<1>(radius, radius, len)));
-			Transform trafo;
 			for (Position i=0; i<4; ++i)
 				for (Position j=0; j<4; ++j)
-					trafo.matrix[j][i] = matrix(i, j);
-			trafo.hasInverse = false;
-
-			return m_renderer.createGroup(trafo);
+					trafo[i*4+j] = matrix(i, j);
 		}
-		
-		GroupHandle RTfactRenderer::transformLine(const TwoColoredLine& line) 
+
+		void RTfactRenderer::transformLine(const TwoColoredLine& line, float *trafo)
 		{
 			Vector3 vec = line.getVertex2() - line.getVertex1();
 			const double len = vec.getLength();
@@ -817,7 +1622,7 @@ namespace BALL
 
 			Matrix4x4 matrix = Matrix4x4::getIdentity();
 			matrix.rotate(Angle(-angle), vec.y, -vec.x, 0);
-			
+
 			Matrix4x4 temp;
 			temp.setScale(radius, radius, len);
 			matrix*=temp;
@@ -825,51 +1630,47 @@ namespace BALL
 			temp.setTranslation(midpoint);
 			matrix = temp*matrix;
 
-			//return m_renderer.createGroup(	Transform::translation(midpoint.x, midpoint.y, midpoint.z)
-			//															 *matrix*Transform::scale(Vec3f<1>(radius, radius, len)));
-			Transform trafo;
 			for (Position i=0; i<4; ++i)
 				for (Position j=0; j<4; ++j)
-					trafo.matrix[j][i] = matrix(i, j);
-			trafo.hasInverse = false;
-
-			return m_renderer.createGroup(trafo);
+                    trafo[i*4+j] = matrix(i, j);
 		}
 
-		void RTfactRenderer::updateMaterialFromStage(RTAppearanceHandle& material)
+		void RTfactRenderer::updateMaterialFromStage(AppearanceHandle& material)
 		{
-			Stage::RaytracingMaterial const& rt_material = scene_->getStage()->getRTMaterial();
+
+			Stage::Material const& rt_material = scene_->getStage()->getMaterial();
 			convertMaterial(rt_material, material);
+
 		}
 
-		void RTfactRenderer::convertMaterial(Stage::RaytracingMaterial const& rt_material, RTAppearanceHandle& material)
+		void RTfactRenderer::convertMaterial(Stage::Material const& rt_material, AppearanceHandle& material)
 		{
 			// ambience
 			float red   = (float)rt_material.ambient_color.getRed()   * rt_material.ambient_intensity;
 			float blue  = (float)rt_material.ambient_color.getBlue()  * rt_material.ambient_intensity;
 			float green = (float)rt_material.ambient_color.getGreen() * rt_material.ambient_intensity;
 
-			material->setParam("ambientIntensity", float3(red, blue, green));
+			material.setParam3f("ambientIntensity", float3(red, blue, green));
 
 			// specularity
 			red   = (float)rt_material.specular_color.getRed()   * rt_material.specular_intensity;
 			blue  = (float)rt_material.specular_color.getBlue()  * rt_material.specular_intensity;
 			green = (float)rt_material.specular_color.getGreen() * rt_material.specular_intensity;
 
-			material->setParam("specularColor", float3(red, blue, green));
+			material.setParam3f("specularColor", float3(red, blue, green));
 
 			// reflectiveness
 			red   = (float)rt_material.reflective_color.getRed()   * rt_material.reflective_intensity;
 			blue  = (float)rt_material.reflective_color.getBlue()  * rt_material.reflective_intensity;
 			green = (float)rt_material.reflective_color.getGreen() * rt_material.reflective_intensity;
 
-			material->setParam("reflective", float3(red, blue, green));
+			material.setParam3f("reflective", float3(red, blue, green));
 
 			// shininess
-			material->setParam("shininess", rt_material.shininess);
+			material.setParamf("shininess", rt_material.shininess);
 
-			// transparency
-			material->setParam("alpha", (100.f - rt_material.transparency) * 0.01f);
+			// transparency            
+            material.setParamf("transparency", rt_material.transparency * 0.01f);
 		}
 
 		std::vector<float> RTfactRenderer::intersectRaysWithGeometry(const std::vector<Vector3>& origins,
@@ -884,13 +1685,20 @@ namespace BALL
 
 			std::vector<float> results(origins.size());
 
-			m_renderer.intersectRays(reinterpret_cast<const float*>(&origins[0]), 
-			                         reinterpret_cast<const float*>(&directions[0]), 
-															 origins.size(),
-															 reinterpret_cast<float*>(&results[0]));
+			IntersectTaskHandle intersectTask = rayTracer.createIntersectTask();
+			intersectTask.intersectRays(
+				reinterpret_cast<const float*>(&origins[0]),
+				reinterpret_cast<const float*>(&directions[0]),
+				origins.size(),
+				reinterpret_cast<float*>(&results[0]));
 
-			return results;
-		}
+            return results;
+        }
+
+        bool RTfactRenderer::doVectorsDiffer(const Vector3 &vecA, const Vector3 &vecB)
+        {
+            return ((vecA - vecB).getSquareLength() > vectorDifferenceTolerance_);
+        }
 
 	}
 }
diff --git a/source/VIEW/RENDERING/renderSetup.C b/source/VIEW/RENDERING/renderSetup.C
index 08672e2..41a202c 100644
--- a/source/VIEW/RENDERING/renderSetup.C
+++ b/source/VIEW/RENDERING/renderSetup.C
@@ -517,22 +517,13 @@ namespace BALL
 		}
 		void RenderSetup::updateMaterialForRepresentation(const Representation* rep)
 		{
-#ifdef BALL_HAS_RTFACT
-			if (RTTI::isKindOf<RTfactRenderer>(*renderer))
-			{
 			render_mutex_.lock();
 
-			makeCurrent();
-			
-			((RTfactRenderer*)renderer)->updateMaterialForRepresentation(rep);
-			
+			//makeCurrent();
+
+			renderer->updateMaterialForRepresentation(rep);
+
 			render_mutex_.unlock();
-			}
-			else
-			{
-				return;
-			}
-#endif
 		}
 		
 		void RenderSetup::updateBackgroundColor()
diff --git a/source/VIEW/WIDGETS/geometricControl.C b/source/VIEW/WIDGETS/geometricControl.C
index e4275a0..5127e6b 100644
--- a/source/VIEW/WIDGETS/geometricControl.C
+++ b/source/VIEW/WIDGETS/geometricControl.C
@@ -22,8 +22,8 @@
 
 #include <QtGui/QFileDialog>
 #include <QtGui/QMenuBar>
-#include <QtGui/QToolTip> 
-#include <QtGui/QInputDialog> 
+#include <QtGui/QToolTip>
+#include <QtGui/QInputDialog>
 
 #include <BALL/MATHS/matrix44.h>
 #include <BALL/MATHS/analyticalGeometry.h>
@@ -48,7 +48,7 @@ namespace BALL
 		#ifdef BALL_VIEW_DEBUG
 			Log.error() << "new GeometricControl " << this << std::endl;
 		#endif
-			
+
 			listview->setObjectName("MolecularControlList");
 			listview->headerItem()->setText(0, tr("[visible] Index"));
 			listview->headerItem()->setText(1, tr("Model"));
@@ -67,31 +67,31 @@ namespace BALL
 									"6." + (String)tr("column") + ": " + (String)tr("number of used molecular entities, number of geometric objects") + ". ";
 
 			listview->setToolTip(txt.c_str());
-			
+
 			registerWidget(this);
 
 			clipping_plane_context_menu_.addAction(tr("Hide/Show"), this, SLOT(hideShowClippingPlane()));
-			clipping_plane_context_menu_.addAction(tr("Flip"), this, SLOT(flipClippingPlane()));	
-			clipping_plane_context_menu_.addAction(tr("Set to position..."), this, SLOT(setClippingPosition()));	
-			clipping_plane_context_menu_.addAction(tr("Set to x axis"), this, SLOT(setClippingPlaneX()));	
-			clipping_plane_context_menu_.addAction(tr("Set to y axis"), this, SLOT(setClippingPlaneY()));	
-			clipping_plane_context_menu_.addAction(tr("Set to z axis"), this, SLOT(setClippingPlaneZ()));	
-			clipping_plane_context_menu_.addAction(tr("Clip <-> Cap"), this, SLOT(flipClippingCapping()));	
-			clipping_plane_context_menu_.addAction(tr("Select Representations"), this, SLOT(selectClipRepresentations()));	
+			clipping_plane_context_menu_.addAction(tr("Flip"), this, SLOT(flipClippingPlane()));
+			clipping_plane_context_menu_.addAction(tr("Set to position..."), this, SLOT(setClippingPosition()));
+			clipping_plane_context_menu_.addAction(tr("Set to x axis"), this, SLOT(setClippingPlaneX()));
+			clipping_plane_context_menu_.addAction(tr("Set to y axis"), this, SLOT(setClippingPlaneY()));
+			clipping_plane_context_menu_.addAction(tr("Set to z axis"), this, SLOT(setClippingPlaneZ()));
+			clipping_plane_context_menu_.addAction(tr("Clip <-> Cap"), this, SLOT(flipClippingCapping()));
+			clipping_plane_context_menu_.addAction(tr("Select Representations"), this, SLOT(selectClipRepresentations()));
 		}
 
 		GeometricControl::~GeometricControl()
 		{
 			#ifdef BALL_VIEW_DEBUG
 				Log.error() << "Destructing object " << this << " of class GeometricControl" << std::endl;
-			#endif 
+			#endif
 		}
 
 		void GeometricControl::addRepresentation(Representation& rep)
 		{
-			if (representation_to_item_.has(&rep)) 
+			if (representation_to_item_.has(&rep))
 			{
-				Log.error() << (String)tr("Tried to add an already inserted Representation in ") 
+				Log.error() << (String)tr("Tried to add an already inserted Representation in ")
 										<< __FILE__ << " " << __LINE__ << std::endl;
 				return;
 			}
@@ -105,14 +105,14 @@ namespace BALL
 			delete representation_to_item_[&rep];
 
 			item_to_representation_.erase(representation_to_item_[&rep]);
-			representation_to_item_.erase(&rep);		
+			representation_to_item_.erase(&rep);
 		}
 
-		void GeometricControl::updateRepresentation(Representation& rep)
+		void GeometricControl::updateRepresentation(Representation& rep, bool force)
 		{
-			if (getMainControl()->isBusy()) return;
+			if (!force && getMainControl()->isBusy()) return;
 
-			const HashMap<Representation*, QTreeWidgetItem*>::Iterator to_find = 
+			const HashMap<Representation*, QTreeWidgetItem*>::Iterator to_find =
 				representation_to_item_.find(&rep);
 
 			if (to_find == representation_to_item_.end()) return;
@@ -180,7 +180,7 @@ namespace BALL
 			}
 
 			if (!RTTI::isKindOf<RepresentationMessage> (*message)) return;
-			
+
 			Representation* rep =	(RTTI::castTo<RepresentationMessage> (*message))->getRepresentation();
 			if (rep == 0) return;
 
@@ -198,7 +198,7 @@ namespace BALL
 				case RepresentationMessage::ADD_TO_GEOMETRIC_CONTROL:
 					addRepresentation(*rep);
 					return;
-			
+
 				case RepresentationMessage::REMOVE:
 					removeRepresentation(*rep);
 					return;
@@ -207,6 +207,10 @@ namespace BALL
 					updateRepresentation(*rep);
 					return;
 
+				case RepresentationMessage::UPDATE_PROPERTIES:
+					updateRepresentation(*rep, true);
+					return;
+
 				default:
 					Log.error() << (String)tr("Unknown Type of RepresentationMessage in ") << __FILE__ << __LINE__ << std::endl;
 			}
@@ -223,9 +227,9 @@ namespace BALL
 
 			Representation* rep = 0;
 			ClippingPlane* plane = 0;
-			
+
 			if (item_to_representation_.has(context_item_)) rep = item_to_representation_[context_item_];
-			else if (item_to_plane_.has(context_item_))     plane = item_to_plane_[context_item_]; 
+			else if (item_to_plane_.has(context_item_))     plane = item_to_plane_[context_item_];
 
 			context_menu_.clear();
 			context_menu_actions_.clear();
@@ -236,7 +240,7 @@ namespace BALL
 			addItem_((String)tr("Duplicate"), SLOT(duplicate()));
 			addItem_((String)tr("Move"), SLOT(enterMoveMode()));
 
-			if (rep->getModelType() == MODEL_PROXIMITY_LIGHT)
+			if (rep && rep->getModelType() == MODEL_PROXIMITY_LIGHT)
 			{
 				addItem_((String)tr("Setup Proximity Light"), SLOT(setupProximityLight()));
 			}
@@ -246,8 +250,8 @@ namespace BALL
 				context_menu_.addSeparator();
 				addItem_((String)tr("Save Surface"), SLOT(saveSurface()));
 				addItem_((String)tr("Select Atoms"), SLOT(selectAtoms()));
-				addItem_((String)tr("Modify Model"), SLOT(modifyRepresentation_()));	
-				addItem_((String)tr("Modify Representation"), SLOT(show()), modify_rep_dialog_);	
+				addItem_((String)tr("Modify Model"), SLOT(modifyRepresentation_()));
+				addItem_((String)tr("Modify Representation"), SLOT(show()), modify_rep_dialog_);
 				addItem_((String)tr("Rename"), SLOT(renameRepresentation()));
 				context_menu_.addSeparator();
 				Size acs = context_menu_actions_.size() - 1;
@@ -261,7 +265,7 @@ namespace BALL
 
 					for (Position p = all_pos + 1; p <= acs; p++)
 					{
-						context_menu_actions_[p]->setEnabled(false); 
+						context_menu_actions_[p]->setEnabled(false);
 					}
 					return;
 				}
@@ -276,12 +280,12 @@ namespace BALL
 				{
 					for (Position p = 1; p <= acs; p++)
 					{
-						context_menu_actions_[p]->setEnabled(false); 
+						context_menu_actions_[p]->setEnabled(false);
 					}
 				}
 
 				// not modifyable
-				if (rep->getModelType() >= MODEL_LABEL)
+				if (rep && rep->getModelType() >= MODEL_LABEL)
 				{
 					context_menu_actions_[6]->setEnabled(false);
 				}
@@ -321,7 +325,7 @@ namespace BALL
 			ignore_change_ = true;
 			if (rep.isHidden()) new_item->setCheckState(0, Qt::Unchecked);
 			ignore_change_ = false;
-			
+
 			listview->setItemSelected(new_item, true);
  			deselectOtherControls_();
 			updateSelection();
@@ -330,7 +334,7 @@ namespace BALL
 		void GeometricControl::deleteCurrentItems()
 		{
 			if (getMainControl()->getRepresentationManager().updateRunning() ||
-			    creating_representations_) 
+			    creating_representations_)
 			{
 				setStatusbarText((String)tr("Could not delete Representation while update is running!"), true);
 				return;
@@ -367,9 +371,9 @@ namespace BALL
 			if (state != representation.isHidden()) return;
 
 			representation.setHidden(!state);
-			if (!representation.isHidden()) 
+			if (!representation.isHidden())
 			{
-				representation.update(false); 
+				representation.update(false);
 			}
 			else
 			{
@@ -388,7 +392,7 @@ namespace BALL
 			buildContextMenu();
 			context_menu_.popup(mapToGlobal(pos));
 		}
-		
+
 
 		void GeometricControl::modifyRepresentation_()
 		{
@@ -427,12 +431,12 @@ namespace BALL
 			modify_rep_dialog_->setRepresentation(rep);
 			notify_(new RepresentationMessage(*rep, RepresentationMessage::SELECTED));
 
-			if (rep == 0 || !getMainControl()->getRepresentationManager().has(*rep)) 
+			if (rep == 0 || !getMainControl()->getRepresentationManager().has(*rep))
 			{
-				return; 
+				return;
 			}
 
-			if (rep->getComposites().size() > 0) 
+			if (rep->getComposites().size() > 0)
 			{
 				String name;
 				const Composite* c_ptr = *rep->getComposites().begin();
@@ -456,7 +460,7 @@ namespace BALL
 				{
 					name = ac->getProperty("FROM_FILE").getString() + "->" + name;
 				}
-				
+
 				name.trimRight("->");
 
 				if (rep->getComposites().size() > 1) name += "...";
@@ -478,7 +482,7 @@ namespace BALL
 				if (item_to_representation_.has(*sel_it))
 					selection.push_back(item_to_representation_[*sel_it]);
 			}
-			
+
 			return selection;
 		}
 
@@ -502,7 +506,7 @@ namespace BALL
 		void GeometricControl::focus()
 		{
 			list<Representation*> reps = getHighlightedRepresentations();
-			if (reps.size() == 1) 
+			if (reps.size() == 1)
 			{
 				getMainControl()->getRepresentationManager().focusRepresentation(**reps.begin());
 				return;
@@ -525,7 +529,7 @@ namespace BALL
 		{
 			GenericControl::initializeWidget(main_control);
 
-			menu_clipping_plane_ = insertMenuEntry(MainControl::DISPLAY_CREATE, tr("Clipping Plane"), 
+			menu_clipping_plane_ = insertMenuEntry(MainControl::DISPLAY_CREATE, tr("Clipping Plane"),
 			                                       this, SLOT(createNewClippingPlane()), "Shortcut|Display|Create|ClippingPlane",
 																						 QKeySequence(), tr("Add an OpenGL Clipping Plane to the Scene"),
 																						 UIOperationMode::MODE_ADVANCED);
@@ -535,7 +539,7 @@ namespace BALL
 																					 SLOT(loadSurface()), "Shortcut|Display|Create|Surface",
 																					 QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 
-			modify_surface_ = insertMenuEntry(MainControl::DISPLAY, tr("Modify Representation"), modify_rep_dialog_, 
+			modify_surface_ = insertMenuEntry(MainControl::DISPLAY, tr("Modify Representation"), modify_rep_dialog_,
 			                                  SLOT(show()), "Shortcut|Display|Modify Representation", QKeySequence(),
 																				tr(""), UIOperationMode::MODE_ADVANCED);
 
@@ -698,10 +702,10 @@ namespace BALL
 
 			Vector3 vv = camera.getViewVector();
 			if (!Maths::isZero(vv.getSquareLength())) vv.normalize();
-	
+
 			Vector3 n(vv + -camera.getRightVector() + camera.getLookUpVector());
 			if (!Maths::isZero(n.getSquareLength())) n.normalize();
-		
+
 			plane->setNormal(n);
 			plane->setPoint(camera.getLookAtPosition() + vv * 10);
 
@@ -753,7 +757,7 @@ namespace BALL
 					ignore_change_ = true;
 					new_item->setCheckState(0, Qt::Checked);
 
-					if (!plane->isActive()) 
+					if (!plane->isActive())
 					{
 						ignore_change_ = true;
 						new_item->setCheckState(0, Qt::Unchecked);
@@ -814,7 +818,7 @@ namespace BALL
 		{
 			if (col != 0) return;
 
-			if (ignore_change_) 
+			if (ignore_change_)
 			{
 				ignore_change_ = false;
 				return;
@@ -835,7 +839,7 @@ namespace BALL
 
 			ClippingPlane* plane = 0;
 			Representation* rep  = 0;
-			
+
 			if 			(item_to_plane_.has(item)) 					plane = item_to_plane_[item];
 			else if (item_to_representation_.has(item))	rep   = item_to_representation_[item];
 
@@ -886,7 +890,7 @@ namespace BALL
 			QString qresult = QFileDialog::getSaveFileName(
 												0,
 												tr("Export Surface"),
-												(getWorkingDir() + String(FileSystem::PATH_SEPARATOR) + 
+												(getWorkingDir() + String(FileSystem::PATH_SEPARATOR) +
 												 "surface.dat").c_str(),
 												"*.*");
 
diff --git a/source/VIEW/WIDGETS/molecularControl.C b/source/VIEW/WIDGETS/molecularControl.C
index 740168e..e3e3f16 100644
--- a/source/VIEW/WIDGETS/molecularControl.C
+++ b/source/VIEW/WIDGETS/molecularControl.C
@@ -329,6 +329,9 @@ namespace BALL
 
 					case CompositeMessage::CHANGED_COMPOSITE_HIERARCHY:
 					{
+						Composite* composite_ptr;
+						vector<Composite*> roots;
+						
 						bool was_enabled = !ignore_messages_;
 						selected_.clear();
 						enableUpdates_(false);
@@ -337,22 +340,32 @@ namespace BALL
 						QTreeWidgetItemIterator qit(listview);
 						while (*qit != 0)
 						{
+							composite_ptr = (*(MyTreeWidgetItem*)*qit).composite;
+							
 							if (listview->isItemExpanded(*qit))
 							{
-								open_items.insert((*(MyTreeWidgetItem*)*qit).composite);
+								open_items.insert(composite_ptr);
 							}
 
 							if (listview->isItemSelected(*qit))
 							{
-								highlighted.insert((*(MyTreeWidgetItem*)*qit).composite);
+								highlighted.insert(composite_ptr);
+							}
+							
+				
+							if ((*qit)->parent() == NULL)
+							{
+								roots.push_back(composite_ptr);
 							}
 
 							qit++;
 						}
 
-						Composite& root = composite_message->getComposite()->getRoot();
-						removeComposite(root);
-						addComposite(root);
+						for (Position i=0; i!=roots.size(); ++i)
+						{
+							removeComposite(*roots[i]);
+							addComposite(*roots[i]);
+						}
 
 						list<QTreeWidgetItem*> item_list;
 						qit = QTreeWidgetItemIterator(listview);
diff --git a/source/VIEW/WIDGETS/molecularStructure.C b/source/VIEW/WIDGETS/molecularStructure.C
index 3ad51a8..4b2c4d8 100644
--- a/source/VIEW/WIDGETS/molecularStructure.C
+++ b/source/VIEW/WIDGETS/molecularStructure.C
@@ -1172,6 +1172,12 @@ namespace BALL
 				chooseForceField(AMBER_FF);
 			}
 		}
+    
+    
+    Position MolecularStructure::getForceFieldID()
+    {
+      return force_field_id_;
+    }
 
 
 		void MolecularStructure::writePreferences(INIFile& inifile)
@@ -1216,8 +1222,6 @@ namespace BALL
 				Bond& bond = *bit;
 				if (bond.getType() == Bond::TYPE__HYDROGEN) hbonds++; 
 			}
-
-			hbonds /= 2;
 			
 			setStatusbarText(String(tr("Calculated")) + " " + String(hbonds) + (String)tr(" H-bonds"), true);
 		}
diff --git a/source/VIEW/WIDGETS/scene.C b/source/VIEW/WIDGETS/scene.C
index 0e0ab74..9e98d75 100644
--- a/source/VIEW/WIDGETS/scene.C
+++ b/source/VIEW/WIDGETS/scene.C
@@ -69,7 +69,7 @@
 #ifdef BALL_HAS_RTFACT
 
 #include <BALL/VIEW/RENDERING/glRenderWindow.h>
-//#include <BALL/VIEW/RENDERING/RENDERERS/cudaVolumeRenderer.h>    
+//#include <BALL/VIEW/RENDERING/RENDERERS/cudaVolumeRenderer.h>
 #include <BALL/VIEW/RENDERING/RENDERERS/rtfactRenderer.h>
 
 #endif
@@ -102,7 +102,7 @@ namespace BALL
 	namespace VIEW
 	{
 
-#ifdef BALL_HAS_RTFACT    
+#ifdef BALL_HAS_RTFACT
 		//typedef CudaVolumeRenderer t_RaytracingRenderer;
 		typedef RTfactRenderer t_RaytracingRenderer;
 		typedef GLRenderWindow t_RaytracingWindow;
@@ -115,7 +115,7 @@ namespace BALL
 
 		// ###############CONSTRUCTORS,DESTRUCTORS,CLEAR###################
 
-		// values for mouse-sensitivity 
+		// values for mouse-sensitivity
 		float Scene::mouse_sensitivity_ = 5;
 		float Scene::mouse_wheel_sensitivity_ = 5;
 		bool  Scene::show_light_sources_ = false;
@@ -228,7 +228,7 @@ namespace BALL
 		{
 #ifdef BALL_VIEW_DEBUG
 			Log.info() << "Destructing object Scene " << this << " of class Scene" << std::endl;
-#endif 
+#endif
 			delete stage_;
 
 			for (Position i=0; i<renderers_.size(); ++i)
@@ -242,7 +242,7 @@ namespace BALL
 
 				renderers_[i]->wait(1000);
 				//	NOTE: This is problematic, since we have some smart pointers
-				//	delete renderers_[i].renderer; 
+				//delete(renderers_[i]->renderer);
 				delete(renderers_[i]->target);
 			}
 
@@ -254,7 +254,7 @@ namespace BALL
 #ifndef BALL_HAS_RTFACT
 			renderers_.push_back(boost::shared_ptr<RenderSetup>(new RenderSetup(gl_renderer_, main_display_, this, stage_)));
 #else
-			renderers_.push_back(boost::shared_ptr<RenderSetup>(new RenderSetup(&*rt_renderer_, main_display_, this, stage_)));
+			renderers_.push_back(boost::shared_ptr<RenderSetup>(new RenderSetup(rt_renderer_, main_display_, this, stage_)));
 #endif
 		}
 
@@ -296,7 +296,7 @@ namespace BALL
 
 			stage_->dump(s, depth);
 
-			BALL_DUMP_STREAM_SUFFIX(s);     
+			BALL_DUMP_STREAM_SUFFIX(s);
 		}
 
 		// ####################GL, CAMERA############################################
@@ -315,7 +315,9 @@ namespace BALL
 						if (pm.startRendering(rep))
 						{
 							for (Position i=0; i<renderers_.size(); ++i)
+							{
 								renderers_[i]->bufferRepresentation(*rep);
+							}
 
 							pm.finishedRendering(rep);
 						}
@@ -455,7 +457,7 @@ namespace BALL
 		void Scene::handleControlSelectionMessage_(ControlSelectionMessage* /*csm*/)
 		{
 			checkMenu(*getMainControl());
-		}	
+		}
 
 		void Scene::onNotify(Message *message)
 		{
@@ -473,11 +475,11 @@ namespace BALL
 				ControlSelectionMessage* csm = RTTI::castTo<ControlSelectionMessage>(*message);
 				handleControlSelectionMessage_(csm);
 			}
-			else if (RTTI::isKindOf<RepresentationMessage>(*message)) 
+			else if (RTTI::isKindOf<RepresentationMessage>(*message))
 			{
 				RepresentationMessage* rm = RTTI::castTo<RepresentationMessage>(*message);
 				handleRepresentationMessage_(rm);
-			} 
+			}
 			else if (RTTI::isKindOf<DatasetMessage>(*message))
 			{
 				DatasetMessage* dm = RTTI::castTo<DatasetMessage>(*message);
@@ -498,7 +500,7 @@ namespace BALL
 			{
 				renderers_[i]->init();
 				GLRenderWindow* gt = dynamic_cast<GLRenderWindow*>(renderers_[i]->target);
-				if (gt) 
+				if (gt)
 				{
 					gt->ignoreEvents(true);
 					gt->installEventFilter(this);
@@ -508,37 +510,46 @@ namespace BALL
 			if (stage_->getLightSources().size() == 0) setDefaultLighting(false);
 		}
 
-		String Scene::createFPSInfo_()
+		String Scene::createFPSInfo_(Renderer* renderer)
 		{
 			String fps_string;
+			float fps = -1;
 
-			float ti = 1000000.0 / (PreciseTime::now().getMicroSeconds() - time_.getMicroSeconds());
-
-			if (ti < 0)
+			// gather renderer specific fps
+			if(renderer->hasFPScounter())
 			{
-				time_ = PreciseTime::now();
-				return fps_string;
+				fps = (float)renderer->getFPS();
 			}
-
-			if (fps_.size() > 0)
+			// if fps not available render gui fps
+			else
 			{
-				if (BALL_ABS(*fps_.begin() - ti) > ti / 0.5)
+				float ti = 1000000.0 / (PreciseTime::now().getMicroSeconds() - time_.getMicroSeconds());
+
+				if (ti < 0)
 				{
-					fps_.clear();
+					time_ = PreciseTime::now();
+					return fps_string;
+				}
+
+				if (fps_.size() > 0)
+				{
+					if (BALL_ABS(*fps_.begin() - ti) > ti / 0.5)
+					{
+						fps_.clear();
+					}
 				}
-			}
 
-			fps_.push_back(ti);
-			if (fps_.size() > 10) fps_.pop_front();
+				fps_.push_back(ti);
+				if (fps_.size() > 10) fps_.pop_front();
 
-			float fps = 0;
-			list<float>::iterator lit = fps_.begin();
-			for (; lit != fps_.end(); lit++)
-			{
-				fps += *lit;
-			}
+				list<float>::iterator lit = fps_.begin();
+				for (; lit != fps_.end(); lit++)
+				{
+					fps += *lit;
+				}
 
-			fps /= fps_.size();
+				fps /= fps_.size();
+			}
 
 			std::ostringstream stream;
 			stream.imbue(std::locale("C"));
@@ -562,7 +573,7 @@ namespace BALL
 
 			QPainter p(current_dev);
 
-			QPen pen(QColor((int)text_color.getRed(),  (int)text_color.getGreen(), 
+			QPen pen(QColor((int)text_color.getRed(),  (int)text_color.getGreen(),
 						          (int)text_color.getBlue(), (int)text_color.getAlpha()));
 
 			p.setPen(pen);
@@ -608,7 +619,7 @@ namespace BALL
 		}
 
 		void Scene::resizeEvent(QResizeEvent* /*event*/)
-		{						
+		{
 			for (Position i=0; i<renderers_.size(); ++i)
 				renderers_[i]->resize(width(), height());
 		}
@@ -616,7 +627,7 @@ namespace BALL
 		bool Scene::eventFilter(QObject* object, QEvent* event)
 		{
 			for (Position i=0; i<renderers_.size(); ++i)
-			{				
+			{
 				if (static_cast<QObject*>(dynamic_cast<GLRenderWindow*>(renderers_[i]->target)) != object)
 					continue;
 
@@ -712,7 +723,7 @@ namespace BALL
 			const Camera& camera = stage_->getCamera();
 
 			Vector3 vv = camera.getViewVector();
-			vv.normalize(); 
+			vv.normalize();
 
 			Quaternion q1;
 			q1.fromAxisAngle(camera.getLookUpVector(), Angle(degree_right, false).toRadian());
@@ -749,7 +760,7 @@ namespace BALL
 
 			HashSet<Composite*> roots;
 
-			for (cit = selection.begin(); cit != selection.end(); cit++) 
+			for (cit = selection.begin(); cit != selection.end(); cit++)
 			{
 				(*cit)->apply(tp1);
 				(*cit)->apply(tp2);
@@ -783,16 +794,16 @@ namespace BALL
 			const Camera& camera = stage_->getCamera();
 
 			String text((String)tr("ViewPoint:") + " ("
-					+ String(camera.getViewPoint().x) + "|" 
-					+ String(camera.getViewPoint().y) + "|" 
-					+ String(camera.getViewPoint().z) 
-					+ ")   " + (String)tr("LookAt:") + " (" 
-					+ String(camera.getLookAtPosition().x) + "|" 
-					+ String(camera.getLookAtPosition().y) + "|" 
-					+ String(camera.getLookAtPosition().z) 
-					+ ")   " + (String)tr("LookUp") + ": (" 
-					+ String(camera.getLookUpVector().x) + "|" 
-					+ String(camera.getLookUpVector().y) + "|" 
+					+ String(camera.getViewPoint().x) + "|"
+					+ String(camera.getViewPoint().y) + "|"
+					+ String(camera.getViewPoint().z)
+					+ ")   " + (String)tr("LookAt:") + " ("
+					+ String(camera.getLookAtPosition().x) + "|"
+					+ String(camera.getLookAtPosition().y) + "|"
+					+ String(camera.getLookAtPosition().z)
+					+ ")   " + (String)tr("LookUp") + ": ("
+					+ String(camera.getLookUpVector().x) + "|"
+					+ String(camera.getLookUpVector().y) + "|"
 					+ String(camera.getLookUpVector().z) + ")");
 
 			setStatusbarText(text);
@@ -921,7 +932,7 @@ namespace BALL
 			Vector3 px;
 			for (Position i = 0; i <= size; i+=1)
 			{
-				if (i % 10 == 0) 
+				if (i % 10 == 0)
 				{
 					color = color2;
 				}
@@ -1072,8 +1083,6 @@ namespace BALL
 
 			readLights_(inifile);
 			light_settings_->updateFromStage();
-
-			material_settings_->rendererChanged();
 		}
 
 		void Scene::initializePreferencesTab(Preferences &preferences)
@@ -1091,17 +1100,17 @@ namespace BALL
 
 		void Scene::finalizePreferencesTab(Preferences &preferences)
 		{
-			if (light_settings_) 
+			if (light_settings_)
 			{
 				preferences.removeEntry(light_settings_);
 				light_settings_ = 0;
 			}
-			if (stage_settings_) 
+			if (stage_settings_)
 			{
 				preferences.removeEntry(stage_settings_);
 				stage_settings_= 0;
 			}
-			if (material_settings_) 
+			if (material_settings_)
 			{
 				preferences.removeEntry(material_settings_);
 				material_settings_= 0;
@@ -1147,7 +1156,7 @@ namespace BALL
 					notify_(new RepresentationMessage(*coordinate_rep, RepresentationMessage::REMOVE));
 				}
 			}
-			else if (!showed_coordinate && stage_->coordinateSystemEnabled()) 
+			else if (!showed_coordinate && stage_->coordinateSystemEnabled())
 			{
 				createCoordinateSystem();
 			}
@@ -1306,16 +1315,16 @@ namespace BALL
 				shortcut_registry->registerShortcut("Shortcut|Display|Show_Coordinate_System|here", new_action);
 			}
 
-			insertMenuEntry(MainControl::DISPLAY, tr("Add new GL Window"), this, SLOT(addGlWindow()), 
+			insertMenuEntry(MainControl::DISPLAY, tr("Add new GL Window"), this, SLOT(addGlWindow()),
 			                "Shortcut|Display|Add_new_GL_Window", QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 #ifdef BALL_HAS_RTFACT
-			insertMenuEntry(MainControl::DISPLAY, tr("Add new RTfact Window"), this, SLOT(addRTfactWindow()), 
+			insertMenuEntry(MainControl::DISPLAY, tr("Add new RTfact Window"), this, SLOT(addRTfactWindow()),
 			                "Shortcut|Display|Add_new_RTfact_Window", QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 #endif
 			// ======================== Display->Animation ===============================================
 			String help_url = "tips.html#animations";
 
-			record_animation_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Record"), this, 
+			record_animation_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Record"), this,
 			                                           SLOT(dummySlot()), "Shortcut|Display|Animation|Record", QKeySequence(),
 																								 tr("Record an animation for later processing"),
 																								 UIOperationMode::MODE_ADVANCED);
@@ -1325,8 +1334,8 @@ namespace BALL
 				record_animation_action_->setCheckable(true);
 			}
 
-			clear_animation_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Clear"), this, 
-			                                          SLOT(clearRecordedAnimation()), "Shortcut|Display|Animation|Clear", 
+			clear_animation_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Clear"), this,
+			                                          SLOT(clearRecordedAnimation()), "Shortcut|Display|Animation|Clear",
 																								QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 			if (clear_animation_action_)
 			{
@@ -1335,7 +1344,7 @@ namespace BALL
 
 			main_control.insertPopupMenuSeparator(MainControl::DISPLAY_ANIMATION, UIOperationMode::MODE_ADVANCED);
 
-			start_animation_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Start"), this, 
+			start_animation_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Start"), this,
 			                                          SLOT(startAnimation()), "Shortcut|Display|Animation|Start",
 																								QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 			if (start_animation_action_)
@@ -1343,7 +1352,7 @@ namespace BALL
 				setMenuHelp(start_animation_action_, help_url);
 			}
 
-			cancel_animation_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Stop"), this, 
+			cancel_animation_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Stop"), this,
 			                                           SLOT(stopAnimation()), "Shortcut|Display|Animation|Stop",
 																								 QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 
@@ -1355,7 +1364,7 @@ namespace BALL
 
 			main_control.insertPopupMenuSeparator(MainControl::DISPLAY_ANIMATION, UIOperationMode::MODE_ADVANCED);
 
-			animation_export_PNG_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Export PNG"), this, 
+			animation_export_PNG_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Export PNG"), this,
 			                                               SLOT(dummySlot()), "Shortcut|Display|Animation|Export_PNG",
 																										 QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 
@@ -1365,7 +1374,7 @@ namespace BALL
 				animation_export_PNG_action_->setCheckable(true);
 			}
 
-			animation_export_POV_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Export POV"), this, 
+			animation_export_POV_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Export POV"), this,
 			                                               SLOT(dummySlot()), "Shortcut|Display|Animation|Export_POV",
 																										 QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 
@@ -1375,7 +1384,7 @@ namespace BALL
 				animation_export_POV_action_->setCheckable(true);
 			}
 
-			animation_repeat_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Repeat"), this, 
+			animation_repeat_action_ = insertMenuEntry(MainControl::DISPLAY_ANIMATION, tr("Repeat"), this,
 			                                           SLOT(dummySlot()), "Shortcut|Display|Animation|Repeat",
 																								 QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 
@@ -1388,7 +1397,7 @@ namespace BALL
 			// ======================== Display->Stereo ===============================================
 			main_control.insertPopupMenuSeparator(MainControl::DISPLAY, UIOperationMode::MODE_ADVANCED);
 
-			no_stereo_action_ = insertMenuEntry(MainControl::DISPLAY_STEREO, tr("No Stereo"), this, 
+			no_stereo_action_ = insertMenuEntry(MainControl::DISPLAY_STEREO, tr("No Stereo"), this,
 			                                    SLOT(exitStereo()), "Shortcut|Display|Stereo|No_Stereo",
 																					QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 
@@ -1409,7 +1418,7 @@ namespace BALL
 				setMenuHelp(enter_stereo_action_, "tips.html#3D");
 			}
 
-			//active_stereo_action_ = insertMenuEntry(MainControl::DISPLAY_STEREO, tr("Shutter Glasses"), this, 
+			//active_stereo_action_ = insertMenuEntry(MainControl::DISPLAY_STEREO, tr("Shutter Glasses"), this,
 			//                                        SLOT(enterActiveStereo()), "Shortcut|Display|Stereo|Shutter_Glasses",
 			//																				QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 
@@ -1429,8 +1438,8 @@ namespace BALL
 			//	dual_stereo_action_->setCheckable(true);
 			//}
 
-			//dual_stereo_different_display_action_ = insertMenuEntry(MainControl::DISPLAY_STEREO, 
-			//                                                        tr("Side by Side on Different Displays"), this, 
+			//dual_stereo_different_display_action_ = insertMenuEntry(MainControl::DISPLAY_STEREO,
+			//                                                        tr("Side by Side on Different Displays"), this,
 			//																												SLOT(enterDualStereoDifferentDisplays()),
 			//																												"Shortcut|Display|Stereo|Side_by_Side_on_Different_Displays",
 			//																												QKeySequence(), tr(""),
@@ -1444,69 +1453,69 @@ namespace BALL
 			// ======================== Display->Viewpoint ===============================================
 			getMainControl()->insertPopupMenuSeparator(MainControl::DISPLAY_VIEWPOINT, UIOperationMode::MODE_ADVANCED);
 
-			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("&Store Viewpoint"), this, 
+			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("&Store Viewpoint"), this,
 			                SLOT(storeViewPoint()), "Shortcut|Display|Viewpoint|Store",
 											QKeySequence(), tr("Store the current viewpoint"), UIOperationMode::MODE_ADVANCED);
 
-			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("&Restore Viewpoint"), this, 
+			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("&Restore Viewpoint"), this,
 			                SLOT(restoreViewPoint()), "Shortcut|Display|Viewpoint|Restore", QKeySequence(),
 											tr("Restore the viewpoint"), UIOperationMode::MODE_ADVANCED);
 
 			getMainControl()->insertPopupMenuSeparator(MainControl::DISPLAY_VIEWPOINT, UIOperationMode::MODE_ADVANCED);
 
 			String description("Shortcut|Display|Viewpoint|Show_Vie&wpoint");
-			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("Show Viewpoint"), this, 
+			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("Show Viewpoint"), this,
 			                SLOT(showViewPoint_()), description, QKeySequence("Ctrl+W"),
 											tr("Print the coordinates of the current viewpoint"), UIOperationMode::MODE_ADVANCED);
 
 
 			description = "Shortcut|Display|Viewpoint|Set_Viewpoint";
-			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("Set Viewpoi&nt"), this, 
+			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("Set Viewpoi&nt"), this,
 			                SLOT(setViewPoint_()), description, QKeySequence("Ctrl+N"),
 											tr("Move the viewpoint to the given coordinates"), UIOperationMode::MODE_ADVANCED);
 
 			description = "Shortcut|Display|Viewpoint|Reset_Camera";
-			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("Rese&t Camera"), this, 
-			                SLOT(resetCamera_()), description, QKeySequence(), 
+			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("Rese&t Camera"), this,
+			                SLOT(resetCamera_()), description, QKeySequence(),
 											tr("Reset the camera to the orgin (0,0,0)"), UIOperationMode::MODE_ADVANCED);
 
 			getMainControl()->insertPopupMenuSeparator(MainControl::DISPLAY_VIEWPOINT, UIOperationMode::MODE_ADVANCED);
 
 			description = "Shortcut|Display|Viewpoint|Limit_View_Volume";
-			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("Limit View Volume"), this, 
+			insertMenuEntry(MainControl::DISPLAY_VIEWPOINT, tr("Limit View Volume"), this,
 			                SLOT(setupViewVolume()), description, QKeySequence(),
 											tr(""), UIOperationMode::MODE_ADVANCED);
 
 			description = "Shortcut|File|Export|PNG";
-			QAction* screenshot_action = insertMenuEntry(MainControl::FILE_EXPORT, tr("PNG..."), this, 
+			QAction* screenshot_action = insertMenuEntry(MainControl::FILE_EXPORT, tr("PNG..."), this,
 			                                             SLOT(showExportPNGDialog()), description, QKeySequence("Alt+P"),
 																									 tr("Export a PNG image file from the Scene"),
 																									 UIOperationMode::MODE_ADVANCED);
 			setIcon(screenshot_action, "actions/screenshot", false);
 
 			description = "Shortcut|File|Export|POVRay";
-			QAction* pov_action = insertMenuEntry(MainControl::FILE_EXPORT, tr("POVRa&y scene"), this, 
+			QAction* pov_action = insertMenuEntry(MainControl::FILE_EXPORT, tr("POVRa&y scene"), this,
  			                                      SLOT(exportPOVRay()), description, QKeySequence("Ctrl+Y"),
-																						tr("Export a POVRay file from the Scene"), 
+																						tr("Export a POVRay file from the Scene"),
 																						UIOperationMode::MODE_ADVANCED);
 			setIcon(pov_action, "mimetype/text-x-povray", false);
 			setMenuHelp(pov_action, "tips.html#povray");
 
 			description = "Shortcut|File|Export|XML3D";
-			QAction* xml3d_action = insertMenuEntry(MainControl::FILE_EXPORT, tr("XML3D as XHTML"), this, 
+			QAction* xml3d_action = insertMenuEntry(MainControl::FILE_EXPORT, tr("XML3D as XHTML"), this,
 																						SLOT(exportXML3D()), description, QKeySequence(""),
-																						tr("Export a XML3D/XHTML file from the Scene"), 
+																						tr("Export a XML3D/XHTML file from the Scene"),
 																						UIOperationMode::MODE_ADVANCED);
 			setMenuHelp(xml3d_action, "tips.html#XML3D");
-			
+
 			description = "Shortcut|File|Export|VRML";
-			insertMenuEntry(MainControl::FILE_EXPORT, tr("3D Prototyping Export"), this, 
+			insertMenuEntry(MainControl::FILE_EXPORT, tr("3D Prototyping Export"), this,
 			                SLOT(showExportVRMLDialog()), description, QKeySequence(),
 											tr("Export a VRML or stl file from the scene"),
 											UIOperationMode::MODE_ADVANCED);
 
 			// ====================================== MODES =====================================
-			switch_grid_ = NULL;	
+			switch_grid_ = NULL;
 			if (UIOperationMode::instance().getMode() <= UIOperationMode::MODE_ADVANCED)
 			{
 				description = "Shortcut|ShowRuler";
@@ -1520,7 +1529,7 @@ namespace BALL
 				shortcut_registry->registerShortcut(description, switch_grid_);
 
 				// and push the icons whose actions are defined somewhere else
-				// into the toolbar_actions_view 
+				// into the toolbar_actions_view
 				toolbar_actions_view_controls_.push_back(screenshot_action);
 			}
 
@@ -1532,7 +1541,7 @@ namespace BALL
 				toggle_continuous_loop_action_ = new QAction(tr("Toggle continuous loop"), this);
 				toggle_continuous_loop_action_->setObjectName(toggle_continuous_loop_action_->text());
 				connect(toggle_continuous_loop_action_, SIGNAL(triggered()), this, SLOT(toggleContinuousLoop()));
-				toggle_continuous_loop_action_->setCheckable(true);
+                toggle_continuous_loop_action_->setCheckable(true);
 				toggle_continuous_loop_action_->setChecked(false);
 				toggle_continuous_loop_action_->setIcon(loader.getIcon("actions/continuous-loop"));
 				toolbar_actions_view_controls_.push_back(toggle_continuous_loop_action_);
@@ -1543,10 +1552,10 @@ namespace BALL
 #endif
 
 			description = "Shortcut|File|Print";
-			insertMenuEntry(MainControl::FILE, tr("Print"), this, SLOT(printScene()), description, QKeySequence(), 
+			insertMenuEntry(MainControl::FILE, tr("Print"), this, SLOT(printScene()), description, QKeySequence(),
 			                tr("Print the scene"), UIOperationMode::MODE_ADVANCED);
 
-			window_menu_entry_ = insertMenuEntry(MainControl::WINDOWS, tr("Scene"), this, SLOT(switchShowWidget()), "", 
+			window_menu_entry_ = insertMenuEntry(MainControl::WINDOWS, tr("Scene"), this, SLOT(switchShowWidget()), "",
 			                                     QKeySequence(), tr(""), UIOperationMode::MODE_ADVANCED);
 			if (window_menu_entry_)
 			{
@@ -1701,9 +1710,9 @@ namespace BALL
 			QPoint fps_point;
 
 			if (show_fps_)
-				fps_string = createFPSInfo_();
+				fps_string = createFPSInfo_(renderer->renderer);
 
-			// draw all renderable texts 
+			// draw all renderable texts
 			// TODO: does this work for dependent renderers?
 			QPaintDevice* current_dev = dynamic_cast<QPaintDevice*>(renderer->target);
 
@@ -1820,7 +1829,7 @@ namespace BALL
 					onNotify(static_cast<NotificationEvent*>(evt)->getMessage());
 					notify_(static_cast<NotificationEvent*>(evt)->getMessage());
 					break;
-				case RENDER_TO_BUFFER_FINISHED_EVENT: 
+				case RENDER_TO_BUFFER_FINISHED_EVENT:
 					handleRenderToBufferFinishedEvent_(static_cast<RenderToBufferFinishedEvent*>(evt));
 					break;
 				default:
@@ -1898,13 +1907,13 @@ namespace BALL
 			//										v3.x, v3.y, v3.z, 0,
 			//											 0,    0,    0, 1);
 
-			//if (  (track_rotation.getAxis().getSquareLength() < 1e-6) 
+			//if (  (track_rotation.getAxis().getSquareLength() < 1e-6)
 			//		|| fabs(track_rotation.getAngle()) < 1e-4)
 			//	return;
 
 			//Matrix4x4 qmat;
 			//track_rotation.getRotationMatrix(qmat);
-			//Matrix4x4 rotation = to_origin;	
+			//Matrix4x4 rotation = to_origin;
 			//rotation *= qmat;
 			//to_origin.transpose();
 			//rotation *= to_origin;
@@ -1969,7 +1978,7 @@ namespace BALL
 			info_point_ = mapFromGlobal(info_point_);
 
 			if (!rect().contains(info_point_) ||
-					!lockComposites()) 
+					!lockComposites())
 			{
 				return;
 			}
@@ -2032,7 +2041,7 @@ namespace BALL
 				string += this_string;
 			}
 
-			if (string == "") 
+			if (string == "")
 			{
 				unlockComposites();
 				return;
@@ -2081,7 +2090,7 @@ namespace BALL
 			//prepare the filename
 			QString filename = ts.getFilename();
 			QString vrml_end = ".wrl";
-			QString stl_end = ".stl"; 
+			QString stl_end = ".stl";
 			filename.remove( vrml_end );
 			filename.remove( stl_end );
 
@@ -2090,7 +2099,7 @@ namespace BALL
 			RepresentationList::const_iterator rit;
 
 			if ( ve || se)
-			{	
+			{
 				if ( ts.split() )
 					//every representation gets its own file
 				{
@@ -2155,9 +2164,9 @@ namespace BALL
 							(*rit)->setHidden(false);
 						}
 						count++;
-					}								
+					}
 
-					QString vtemp = filename;				
+					QString vtemp = filename;
 
 					//export as requested
 					if (ve)
@@ -2178,14 +2187,14 @@ namespace BALL
 						{
 							change = true;
 						}
-					}	
+					}
 				}
 			}
 
 			//it is very important to restore the representations just when a basestats array was created
 			//as he is only created if an export was made whenever the export is started the "change" boolean is set true
 			if ( change )
-			{	
+			{
 				//now we have to restore the basestats:
 				bool *base = ts.basestats;
 				count = 0;
@@ -2201,13 +2210,13 @@ namespace BALL
 					else
 					{
 						(*rit)->setHidden(true);
-					}	
+					}
 					count ++;
-				}		
+				}
 				setWorkingDirFromFilename_(ascii(filename));
 				vrml_nr_ ++;
 			}
-			getMainControl()->redrawAllRepresentations();			
+			getMainControl()->redrawAllRepresentations();
 		}
 
 		void Scene::printScene()
@@ -2219,11 +2228,11 @@ namespace BALL
 			setStatusbarText((String)tr("printing.."));
 
 			QPainter p;
-			if(!p.begin(&printer)) return; 
+			if(!p.begin(&printer)) return;
 
 			// TODO: push into renderSetup
 			QImage pic = main_display_->grabFrameBuffer();
-			p.drawImage(0,0, pic);	
+			p.drawImage(0,0, pic);
 			p.end();
 
 			setStatusbarText((String)tr("finished printing"));
@@ -2236,7 +2245,7 @@ namespace BALL
 			screenshot_nr_ ++;
 
 			exportPNG(filename);
-			Log.info() << (String)tr("Exporting PNG to ") 
+			Log.info() << (String)tr("Exporting PNG to ")
 				<< Directory().getPath() << FileSystem::PATH_SEPARATOR
 				<< filename << std::endl;
 
@@ -2273,7 +2282,7 @@ namespace BALL
 			if (!offscreen_rendering_)
 				return renderers_[main_renderer_]->exportPNG(filename);
 
-			// ok, we have to do this the hard way...	
+			// ok, we have to do this the hard way...
 
 			// What kind of renderer do we have to encapsulate?
 			if (RTTI::isKindOf<GLRenderer>(*(renderers_[main_renderer_]->renderer)))
@@ -2576,6 +2585,13 @@ namespace BALL
 			boost::shared_ptr<RenderSetup> main_renderer_ptr = renderers_[main_renderer_];
 
 			stopContinuousLoop();
+#ifdef BALL_HAS_RTFACT
+			if (UIOperationMode::instance().getMode() <= UIOperationMode::MODE_ADVANCED)
+			{
+				toggle_continuous_loop_action_->setEnabled(new_type == RenderSetup::RTFACT_RENDERER);
+			}
+#endif
+
 			main_renderer_ptr->stop();
 
 			main_renderer_ptr->loop_mutex.lock();
@@ -2720,9 +2736,9 @@ namespace BALL
 #endif
 			Renderer::StereoMode mode = stage_settings_->getStereoMode();
 
-			if (mode == Renderer::DUAL_VIEW_STEREO || mode == Renderer::TOP_BOTTOM_STEREO) 
+			if (mode == Renderer::DUAL_VIEW_STEREO || mode == Renderer::TOP_BOTTOM_STEREO)
 			{
-				// in both cases (side by side and top bottom), we can 
+				// in both cases (side by side and top bottom), we can
 				// use the same code
 				GLRenderWindow* left_widget = new GLRenderWindow(left_screen, "left eye", Qt::FramelessWindowHint);
 				left_widget->setDoNotResize(true);
@@ -3101,15 +3117,15 @@ namespace BALL
 				if (!renderers_[i]->isContinuous() && (renderers_[i]->getRendererType() != RenderSetup::OPENGL_RENDERER))
 				{
 					renderers_[i]->useContinuousLoop(true);
+					if (UIOperationMode::instance().getMode() <= UIOperationMode::MODE_ADVANCED)
+					{
+						toggle_continuous_loop_action_->setChecked(true);
+					}
+
 					renderers_[i]->loop_mutex.lock();
 					renderers_[i]->wait_for_render.wakeAll();
 					renderers_[i]->loop_mutex.unlock();
-					// set the menu buttons correctly
-					//stop_continuous_loop_action_->setEnabled(true);
-					//start_continuous_loop_action_->setEnabled(false);	
-					// set the icon
-					//toggle_continuous_loop_action_->setChecked(true);
-				}
+        }
 			}
 			setStatusbarText(tr("Switched continuous loop on"), true);
 #endif
@@ -3125,11 +3141,10 @@ namespace BALL
 				if (renderers_[i]->isContinuous())
 				{
 					renderers_[i]->useContinuousLoop(false);
-					// set the menu buttons correctly
-					//stop_continuous_loop_action_->setEnabled(false);
-					//start_continuous_loop_action_->setEnabled(true);
-					// set the icon
-					//toggle_continuous_loop_action_->setChecked(false);
+					if (UIOperationMode::instance().getMode() <= UIOperationMode::MODE_ADVANCED)
+					{
+						toggle_continuous_loop_action_->setChecked(false);
+					}
 				}
 			}
 			setStatusbarText(tr("Switched continuous loop off"), true);
@@ -3308,8 +3323,7 @@ namespace BALL
 				 */
 		}
 
-#ifdef BALL_HAS_RTFACT
-		void Scene::updateAllRTMaterials()
+		void Scene::updateAllMaterials()
 		{
 			RepresentationManager& pm = getMainControl()->getRepresentationManager();
 
@@ -3325,11 +3339,11 @@ namespace BALL
 			updateGL();
 		}
 
-		void Scene::updateRTMaterialForRepresentation(Representation* rep, const Stage::RaytracingMaterial& new_material)
+		void Scene::updateMaterialForRepresentation(Representation* rep, const Stage::Material& new_material)
 		{
-			rep->clearProperty("RTFact::Material");
-			boost::shared_ptr<PersistentObject> p(new Stage::RaytracingMaterial(new_material));
-			NamedProperty rt_mat_property("RTFact::Material", p);
+			rep->clearProperty("Rendering::Material");
+			boost::shared_ptr<PersistentObject> p(new Stage::Material(new_material));
+			NamedProperty rt_mat_property("Rendering::Material", p);
 
 			rep->setProperty(rt_mat_property);
 
@@ -3340,7 +3354,6 @@ namespace BALL
 
 			updateGL();
 		}
-#endif
 
 		void Scene::lightsUpdated(bool redraw)
 		{
@@ -3368,7 +3381,7 @@ namespace BALL
 			//       is called *after* switching to stereo!
 			//
 			// TODO: - change this to something more sensible!
-			//       - call something in RenderSetup instead!	
+			//       - call something in RenderSetup instead!
 			Position texname = 0;
 
 			for (Position i=0; i<renderers_.size(); ++i)
@@ -3471,14 +3484,14 @@ namespace BALL
 					return RaytracingWindowPtr(main_display_);
 					break;
 
-				default: 
+				default:
 					return RaytracingWindowPtr(main_display_);
 					break;
 			}
 		}
 #endif
 
-		void AnimationThread::mySleep(Size msec) 
+		void AnimationThread::mySleep(Size msec)
 		{
 			msleep(msec);
 			while (scene_ != 0 && scene_->isUpdateRunning())
@@ -4011,7 +4024,7 @@ namespace BALL
 			if (bond_order_dialog.ILP_button->isChecked())
 			{
 				abop.options[AssignBondOrderProcessor::Option::ALGORITHM] = AssignBondOrderProcessor::Algorithm::ILP;
-			} 
+			}
 			else if (bond_order_dialog.ASTAR_button->isChecked())
 			{
 				abop.options[AssignBondOrderProcessor::Option::ALGORITHM] = AssignBondOrderProcessor::Algorithm::A_STAR;
@@ -4139,8 +4152,10 @@ namespace BALL
 			{
 				ait->getPosition() += Vector3(random(rng), random(rng), random(rng));
 			}
-			ms->chooseMMFF94();
-
+			
+			Position current_ff_id = ms->getForceFieldID();
+			ms->chooseForceField(current_ff_id);
+			
 			MinimizationDialog& md = ms->getMinimizationDialog();
 			md.storeValues();
 			md.setMaxIterations(30);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/ball.git



More information about the debian-med-commit mailing list