Index: src/Parser/TremoloParser.cpp
===================================================================
--- src/Parser/TremoloParser.cpp	(revision 67ab71acd6bc1af77192d3984502c597446d439b)
+++ src/Parser/TremoloParser.cpp	(revision 05e2edeb4381b4ecb7c744e4a9837e2607de986d)
@@ -56,4 +56,5 @@
 
 #include <algorithm>
+#include <boost/bind.hpp>
 #include <boost/lambda/lambda.hpp>
 #include <boost/lexical_cast.hpp>
@@ -103,5 +104,7 @@
  */
 FormatParser< tremolo >::FormatParser()  :
-  FormatParser_common(NULL)
+  FormatParser_common(NULL),
+  idglobalizer(boost::bind(&FormatParser< tremolo >::getGlobalId, this, _1)),
+  idlocalizer(boost::bind(&FormatParser< tremolo >::getLocalId, this, _1))
 {
   createKnownTypesByIdentity();
@@ -160,6 +163,6 @@
       boost::bind(&atom::getId, _1));
   processNeighborInformation(atoms);
-  adaptImprData();
-  adaptTorsion();
+  adaptImprData(atoms);
+  adaptTorsion(atoms);
 
   // append usedFields to global usedFields, is made unique on save, clear after use
@@ -424,4 +427,12 @@
         writeNeighbors(file, atoi(it->substr(it->find("=") + 1, 1).c_str()), currentAtom);
         break;
+      case TremoloKey::imprData :
+      case TremoloKey::torsion :
+        LOG(3, "Writing type " << knownKeyNames[currentField]);
+        *file << adaptIdDependentDataString(
+            additionalAtomData[currentAtom->getId()].get(currentField),
+            idlocalizer)
+            << "\t";
+        break;
       case TremoloKey::resSeq :
         if (additionalAtomData.count(currentAtom->getId())) {
@@ -810,8 +821,12 @@
  *
  * \param string in which atom IDs should be adapted
+ * \param idgetter function pointer to change the id
  *
  * \return input string with modified atom IDs
  */
-std::string FormatParser< tremolo >::adaptIdDependentDataString(std::string data) {
+std::string FormatParser< tremolo >::adaptIdDependentDataString(
+    const std::string &data,
+    const boost::function<int (const int)> &idgetter
+    ) {
   // there might be no IDs
   if (data == "-") {
@@ -825,8 +840,8 @@
 
   line >> id;
-  result << getGlobalId(id);
+  result << idgetter(id);
   while (line.good()) {
     line >> separator >> id;
-    result << separator << getGlobalId(id);
+    result << separator << idgetter(id);
   }
 
@@ -834,34 +849,40 @@
 }
 
-/**
- * Corrects the atom IDs in each imprData entry to the corresponding world IDs
+/** Corrects the atom IDs in each imprData entry to the corresponding world IDs
  * as they might differ from the originally read IDs.
- */
-void FormatParser< tremolo >::adaptImprData() {
+ *
+ * \param atoms currently parsed in atoms
+ */
+void FormatParser< tremolo >::adaptImprData(const std::vector<atomId_t> &atoms) {
   if (!isUsedField(usedFields_load, "imprData")) {
     return;
   }
 
-  for(std::map<const atomId_t, TremoloAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin();
-    currentInfo != additionalAtomData.end(); currentInfo++
-  ) {
-    currentInfo->second.imprData = adaptIdDependentDataString(currentInfo->second.imprData);
-  }
-}
-
-/**
- * Corrects the atom IDs in each torsion entry to the corresponding world IDs
+  for (std::vector<atomId_t>::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
+    ASSERT(additionalAtomData.count(*iter) != 0,
+        "FormatParser< tremolo >::processNeighborInformation() - global id "
+        +toString(*iter)+" unknown in additionalAtomData.");
+    TremoloAtomInfoContainer &currentInfo = additionalAtomData[*iter];
+    currentInfo.imprData = adaptIdDependentDataString(currentInfo.imprData, idglobalizer);
+  }
+}
+
+/** Corrects the atom IDs in each torsion entry to the corresponding world IDs
  * as they might differ from the originally read IDs.
- */
-void FormatParser< tremolo >::adaptTorsion() {
+ *
+ * \param atoms currently parsed in atoms
+ */
+void FormatParser< tremolo >::adaptTorsion(const std::vector<atomId_t> &atoms) {
   if (!isUsedField(usedFields_load, "torsion")) {
     return;
   }
 
-  for(std::map<const atomId_t, TremoloAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin();
-    currentInfo != additionalAtomData.end(); currentInfo++
-  ) {
-    currentInfo->second.torsion = adaptIdDependentDataString(currentInfo->second.torsion);
-  }
-}
-
+  for (std::vector<atomId_t>::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) {
+    ASSERT(additionalAtomData.count(*iter) != 0,
+        "FormatParser< tremolo >::processNeighborInformation() - global id "
+        +toString(*iter)+" unknown in additionalAtomData.");
+    TremoloAtomInfoContainer &currentInfo = additionalAtomData[*iter];
+    currentInfo.torsion = adaptIdDependentDataString(currentInfo.torsion, idglobalizer);
+  }
+}
+
Index: src/Parser/TremoloParser.hpp
===================================================================
--- src/Parser/TremoloParser.hpp	(revision 67ab71acd6bc1af77192d3984502c597446d439b)
+++ src/Parser/TremoloParser.hpp	(revision 05e2edeb4381b4ecb7c744e4a9837e2607de986d)
@@ -14,4 +14,5 @@
 #endif
 
+#include <boost/function.hpp>
 #include <string>
 
@@ -99,7 +100,7 @@
   void readNeighbors(std::stringstream* line, const int numberOfNeighbors, const int atomId);
   void processNeighborInformation(const std::vector<atomId_t> &atoms);
-  void adaptImprData();
-  void adaptTorsion();
-  std::string adaptIdDependentDataString(std::string data);
+  void adaptImprData(const std::vector<atomId_t> &atoms);
+  void adaptTorsion(const std::vector<atomId_t> &atoms);
+  std::string adaptIdDependentDataString(const std::string &data, const boost::function<int (const int)> &idgetter);
   bool isUsedField(const usedFields_t &fields, const std::string &fieldName) const;
   void writeNeighbors(std::ostream* file, const int numberOfNeighbors, const atom* currentAtom);
@@ -140,4 +141,10 @@
    */
   TremoloAtomInfoContainer defaultAdditionalData;
+
+  //!> bound function to convert id to global id, stored to avoid creation many times
+  const boost::function<int (const int)> idglobalizer;
+
+  //!> bound function to convert id to local id, stored to avoid creation many times
+  const boost::function<int (const int)> idlocalizer;
 };
 
Index: src/Parser/unittests/ParserTremoloUnitTest.cpp
===================================================================
--- src/Parser/unittests/ParserTremoloUnitTest.cpp	(revision 67ab71acd6bc1af77192d3984502c597446d439b)
+++ src/Parser/unittests/ParserTremoloUnitTest.cpp	(revision 05e2edeb4381b4ecb7c744e4a9837e2607de986d)
@@ -108,5 +108,5 @@
   World::getInstance();
 
-  setVerbosity(5);
+  setVerbosity(2);
 
   parser = new FormatParser<tremolo>();
@@ -128,5 +128,5 @@
 
 void ParserTremoloUnitTest::readTremoloPreliminaryCommentsTest() {
-  cout << "Testing the tremolo parser." << endl;
+//  cout << "Testing the tremolo parser." << endl;
   stringstream input, output;
 
@@ -150,5 +150,5 @@
     std::vector<atom *> atoms = World::getInstance().getAllAtoms();
     parser->save(&output, atoms);
-    std::cout << output.str() << std::endl;
+//    std::cout << output.str() << std::endl;
     CPPUNIT_ASSERT(output.str().find("hydrogen") != string::npos);
     input.clear();
@@ -229,6 +229,6 @@
     parser->save(&output, atoms);
     CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
-    std::cout << output.str() << std::endl;
-    CPPUNIT_ASSERT(output.str().find("2-0,0-2") != string::npos);
+//    std::cout << output.str() << std::endl;
+    CPPUNIT_ASSERT(output.str().find("3-1,1-3") != string::npos);
     input.clear();
     output.clear();
@@ -246,6 +246,6 @@
     parser->save(&output, atoms);
     CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
-    std::cout << output.str() << std::endl;
-    CPPUNIT_ASSERT(output.str().find("2-0,0-2") != string::npos);
+//    std::cout << output.str() << std::endl;
+    CPPUNIT_ASSERT(output.str().find("3-1,1-3") != string::npos);
     input.clear();
     output.clear();
@@ -268,5 +268,5 @@
   }
 
-  cout << "testing the tremolo parser is done" << endl;
-}
-
+//  cout << "testing the tremolo parser is done" << endl;
+}
+
