Index: src/Parser/FormatParser_common.cpp
===================================================================
--- src/Parser/FormatParser_common.cpp	(revision 0aa122d5f3137de21e283fdaa583b526d33a6540)
+++ src/Parser/FormatParser_common.cpp	(revision d08ab389fd2efbb426bd7cda87ea43a90ce9d3f6)
@@ -52,4 +52,7 @@
   if (parameters != NULL)
     delete parameters;
+  // clear id translation maps
+  LocaltoGobalIdMap.clear();
+  GlobaltoLocalIdMap.clear();
 }
 
@@ -95,5 +98,61 @@
  * \param ostream where to save the World's state
  */
-void FormatParser_common::setOstream(ostream* output) {
+void FormatParser_common::setOstream(ostream* output)
+{
   saveStream = output;
 }
+
+/** Function to be called when beginning to parse a new file.
+ *
+ * Resets internal translation maps.
+ *
+ */
+void FormatParser_common::resetIdAssociations()
+{
+  LocaltoGobalIdMap.clear();
+  GlobaltoLocalIdMap.clear();
+}
+
+/** Installs an association between a local id from a parsed file and the
+ * global, unique one.
+ *
+ * @param local local atom id
+ * @param global global atom id
+ */
+void FormatParser_common::associateLocaltoGlobalId(const int local, const int global)
+{
+  ASSERT(LocaltoGobalIdMap.count(local) == 0,
+      "FormatParser_common::associateLocaltoGlobalId() - local id "
+      +toString(local)+" is already contained.");
+  ASSERT(GlobaltoLocalIdMap.count(global) == 0,
+      "FormatParser_common::associateLocaltoGlobalId() - global id "
+      +toString(global)+" is already contained.");
+  LocaltoGobalIdMap[local] = global;
+  GlobaltoLocalIdMap[global] = local;
+}
+
+/** Getter for the global id to a given \a local one.
+ *
+ * @param local local atom id
+ * @return global atom id, -1 if unknown
+ */
+int FormatParser_common::getGlobalId(const int local) const
+{
+  IdtoIdMap::const_iterator iter = LocaltoGobalIdMap.find(local);
+  if(iter == LocaltoGobalIdMap.end())
+    return -1;
+  return iter->second;
+}
+
+/** Getter for the local id to a given \a global one.
+ *
+ * @param global global atom id
+ * @return local atom id, -1 if unknown
+ */
+int FormatParser_common::getLocalId(const int global) const
+{
+  IdtoIdMap::const_iterator iter = GlobaltoLocalIdMap.find(global);
+  if(iter == GlobaltoLocalIdMap.end())
+    return -1;
+  return iter->second;
+}
Index: src/Parser/FormatParser_common.hpp
===================================================================
--- src/Parser/FormatParser_common.hpp	(revision 0aa122d5f3137de21e283fdaa583b526d33a6540)
+++ src/Parser/FormatParser_common.hpp	(revision d08ab389fd2efbb426bd7cda87ea43a90ce9d3f6)
@@ -15,4 +15,5 @@
 
 #include <iosfwd>
+#include <map>
 
 #include "CodePatterns/Observer/Observer.hpp"
@@ -49,7 +50,22 @@
   virtual void AtomRemoved(atomId_t) {};
 
+  // functions to add atoms and bonds with ids relative to the parsed file
+  void resetIdAssociations();
+  void associateLocaltoGlobalId(const int local, const int global);
+  int getGlobalId(const int local) const;
+  int getLocalId(const int global) const;
+
 private:
   //!> Output stream to write to when save() is called.
   std::ostream* saveStream;
+
+  //!> typedef for atomic id-to-id map
+  typedef std::map<int, int> IdtoIdMap;
+
+  //!> Maps original atom IDs received from the parsed file to atom IDs in the world.
+  IdtoIdMap LocaltoGobalIdMap;
+
+  //!> Maps atom IDs in the World to those received from the parsed file.
+  IdtoIdMap GlobaltoLocalIdMap;
 };
 
Index: src/Parser/PdbParser.cpp
===================================================================
--- src/Parser/PdbParser.cpp	(revision 0aa122d5f3137de21e283fdaa583b526d33a6540)
+++ src/Parser/PdbParser.cpp	(revision d08ab389fd2efbb426bd7cda87ea43a90ce9d3f6)
@@ -76,5 +76,4 @@
   PdbAtomInfoContainer::clearknownDataKeys();
   additionalAtomData.clear();
-  atomIdMap.clear();
 }
 
@@ -118,6 +117,6 @@
   enum PdbKey::KnownTokens token;
 
-  // reset atomIdMap for this file (to correctly parse CONECT entries)
-  atomIdMap.clear();
+  // reset id maps for this file (to correctly parse CONECT entries)
+  resetIdAssociations();
 
   bool NotEndOfFile = true;
@@ -192,13 +191,12 @@
 
   // re-distribute serials
+  resetIdAssociations();
   // (new atoms might have been added)
-  // (serials must be consistent over time steps)
-  atomIdMap.clear();
   int AtomNo = 1; // serial number starts at 1 in pdb
   for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
     PdbAtomInfoContainer &atomInfo = getadditionalAtomData(*atomIt);
-    setSerial((*atomIt)->getId(), AtomNo);
+    associateLocaltoGlobalId(AtomNo, (*atomIt)->getId());
     atomInfo.set(PdbKey::serial, toString(AtomNo));
-    AtomNo++;
+    ++AtomNo;
   }
 
@@ -305,5 +303,4 @@
   // don't insert here as this is our check whether we are in the first time step
   //additionalAtomData.insert( std::make_pair(id, defaultAdditionalData) );
-  //SerialSet.insert(id);
 }
 
@@ -321,6 +318,4 @@
 //      +toString(id)+" to remove.");
   if (iter != additionalAtomData.end()) {
-    ConvertTo<size_t> toSize_t;
-    SerialSet.erase(toSize_t((iter->second).get<std::string>(PdbKey::serial)));
     additionalAtomData.erase(iter);
   }
@@ -439,9 +434,9 @@
       if (MaxNo >= MaxnumberOfNeighbors) {
         *file << "CONECT";
-        *file << setw(5) << getSerial(currentAtom->getId());
+        *file << setw(5) << getLocalId(currentAtom->getId());
         charsleft = 80-6-5;
         MaxNo = 0;
       }
-      *file << setw(5) << getSerial((*currentBond)->GetOtherAtom(currentAtom)->getId());
+      *file << setw(5) << getLocalId((*currentBond)->GetOtherAtom(currentAtom)->getId());
       charsleft -= 5;
       MaxNo++;
@@ -460,28 +455,4 @@
 }
 
-/** Retrieves a value from  FormatParser< pdb >::atomIdMap.
- * \param atomid key
- * \return value
- */
-size_t FormatParser< pdb >::getSerial(const size_t atomid) const
-{
-  ASSERT(atomIdMap.find(atomid) != atomIdMap.end(), 
-      "FormatParser< pdb >::getAtomId: atomid "+toString(atomid)+" not present in Map.");
-  return (atomIdMap.find(atomid)->second);
-}
-
-/** Sets an entry in  FormatParser< pdb >::atomIdMap.
- * \param localatomid key
- * \param atomid value
- * \return true - key not present, false - value present
- */
-void FormatParser< pdb >::setSerial(const size_t localatomid, const size_t atomid)
-{
-  pair<std::map<size_t,size_t>::iterator, bool > inserter;
-//  LOG(1, "FormatParser< pdb >::setAtomId() - Inserting (" << localatomid << " -> " << atomid << ").");
-  inserter = atomIdMap.insert( make_pair(localatomid, atomid) );
-  ASSERT(inserter.second, "FormatParser< pdb >::setAtomId: atomId already present in Map.");
-}
-
 /** Either returns present atom with given id or a newly created one.
  *
@@ -489,18 +460,17 @@
  * @return
  */
-atom* FormatParser< pdb >::getAtomToParse(std::string id_string) const
+atom* FormatParser< pdb >::getAtomToParse(std::string id_string)
 {
   // get the local ID
   ConvertTo<int> toInt;
-  unsigned int AtomID = toInt(id_string);
-  LOG(4, "INFO: Local id is "+toString(AtomID)+".");
+  const unsigned int AtomID_local = toInt(id_string);
+  LOG(4, "INFO: Local id is "+toString(AtomID_local)+".");
   // get the atomic ID if present
   atom* newAtom = NULL;
-  if (atomIdMap.count((size_t)AtomID)) {
-    std::map<size_t, size_t>::const_iterator iter = atomIdMap.find(AtomID);
-    AtomID = iter->second;
-    LOG(4, "INFO: Global id present as " << AtomID << ".");
+  if (getGlobalId(AtomID_local) != -1) {
+    const unsigned int AtomID_global = getGlobalId(AtomID_local);
+    LOG(4, "INFO: Global id present as " << AtomID_global << ".");
     // check if atom exists
-    newAtom = World::getInstance().getAtom(AtomById(AtomID));
+    newAtom = World::getInstance().getAtom(AtomById(AtomID_global));
     LOG(5, "INFO: Listing all present atoms with id.");
     BOOST_FOREACH(atom *_atom, World::getInstance().getAllAtoms())
@@ -510,4 +480,5 @@
   if (newAtom == NULL) {
     newAtom = World::getInstance().createAtom();
+    const unsigned int AtomID_global = newAtom->getId();
     LOG(4, "INFO: No association to global id present, creating atom.");
   } else {
@@ -607,5 +578,5 @@
       "FormatParser< pdb >::readAtomDataLine() - additionalAtomData present though atom is newly parsed.");
   if (FirstTimestep) {
-    LOG(3,"INFO: Parsing new atom.");
+    LOG(3,"INFO: Parsing new atom "+toString(*newAtom)+" "+toString(newAtom->getId())+".");
   } else {
     LOG(3,"INFO: Parsing present atom "+toString(*newAtom)+".");
@@ -616,13 +587,4 @@
   string word;
   ConvertTo<size_t> toSize_t;
-
-  // assign highest+1 instead, but then beware of CONECT entries! Another map needed!
-//  if (!Inserter.second) {
-//    const size_t id = (*SerialSet.rbegin())+1;
-//    SerialSet.insert(id);
-//    atomInfo.set(PdbKey::serial, toString(id));
-//    ELOG(2, "Serial " << atomInfo.get<std::string>(PdbKey::serial) << " already present, "
-//        << "assigning " << toString(id) << " instead.");
-//  }
 
   // check whether serial exists, if so, assign next available
@@ -648,11 +610,6 @@
     // then fill info container
     readPdbAtomInfoContainer(atomInfo, line);
-    // set the serial
-    std::pair< std::set<size_t>::const_iterator, bool> Inserter =
-      SerialSet.insert(toSize_t(atomInfo.get<std::string>(PdbKey::serial)));
-    ASSERT(Inserter.second,
-        "FormatParser< pdb >::readAtomDataLine() - ATOM contains entry with serial "
-        +atomInfo.get<std::string>(PdbKey::serial)+" already present!");
-    setSerial(toSize_t(atomInfo.get<std::string>(PdbKey::serial)), newAtom->getId());
+    // associate local with global id
+    associateLocaltoGlobalId(toSize_t(atomInfo.get<std::string>(PdbKey::serial)), newAtom->getId());
     // set position
     Vector tempVector;
@@ -791,5 +748,5 @@
         ListOfNeighbors.push_back(otherid);
       else
-        ELOG(2, "FormatParser< pdb >::readNeighbors() - discarding conect entry with id 0.");
+        ELOG(2, "FormatParser< pdb >::readNeighbors() - discarding CONECT entry with id 0.");
     } else  {
       break;
@@ -799,46 +756,14 @@
 
   // add neighbours
-  atom *_atom = World::getInstance().getAtom(AtomById(getSerial(id)));
+  atom *_atom = World::getInstance().getAtom(AtomById(getGlobalId(id)));
   LOG(2, "STATUS: Atom " << _atom->getId() << " gets " << ListOfNeighbors.size() << " more neighbours.");
   for (std::list<size_t>::const_iterator iter = ListOfNeighbors.begin();
       iter != ListOfNeighbors.end();
       ++iter) {
-    atom * const _Otheratom = World::getInstance().getAtom(AtomById(getSerial(*iter)));
+    atom * const _Otheratom = World::getInstance().getAtom(AtomById(getGlobalId(*iter)));
     LOG(3, "INFO: Adding Bond (" << *_atom << "," << *_Otheratom << ")");
     _atom->addBond(_step, _Otheratom);
   }
 }
-
-/**
- * Replaces atom IDs read from the file by the corresponding world IDs. All IDs
- * IDs of the input string will be replaced; expected separating characters are
- * "-" and ",".
- *
- * \param string in which atom IDs should be adapted
- *
- * \return input string with modified atom IDs
- */
-//string  FormatParser< pdb >::adaptIdDependentDataString(string data) {
-//  // there might be no IDs
-//  if (data == "-") {
-//    return "-";
-//  }
-//
-//  char separator;
-//  int id;
-//  stringstream line, result;
-//  line << data;
-//
-//  line >> id;
-//  result << atomIdMap[id];
-//  while (line.good()) {
-//    line >> separator >> id;
-//    result << separator << atomIdMap[id];
-//  }
-//
-//  return result.str();
-//  return "";
-//}
-
 
 bool FormatParser< pdb >::operator==(const FormatParser< pdb >& b) const
Index: src/Parser/PdbParser.hpp
===================================================================
--- src/Parser/PdbParser.hpp	(revision 0aa122d5f3137de21e283fdaa583b526d33a6540)
+++ src/Parser/PdbParser.hpp	(revision d08ab389fd2efbb426bd7cda87ea43a90ce9d3f6)
@@ -73,9 +73,7 @@
   bool isPresentadditionalAtomData(unsigned int _id);
   PdbAtomInfoContainer& getadditionalAtomData(atom *_atom);
-  size_t getSerial(const size_t atomid) const;
-  void setSerial(const size_t localatomid, const size_t atomid);
 
   // internal helper functions
-  atom* getAtomToParse(std::string id_string) const;
+  atom* getAtomToParse(std::string id_string);
   void readPdbAtomInfoContainer(PdbAtomInfoContainer &atomInfo, std::string &line) const;
 
@@ -100,15 +98,4 @@
    */
   PdbAtomInfoContainer defaultAdditionalData;
-
-  /**
-   * Maps original atom IDs received from the parsed file to atom IDs in the
-   * world.
-   */
-  std::map<size_t, size_t> atomIdMap;
-
-  /**
-   * Ascertaining uniqueness of Ids.
-   */
-  std::set<size_t> SerialSet;
 };
 
Index: src/Parser/TremoloParser.cpp
===================================================================
--- src/Parser/TremoloParser.cpp	(revision 0aa122d5f3137de21e283fdaa583b526d33a6540)
+++ src/Parser/TremoloParser.cpp	(revision d08ab389fd2efbb426bd7cda87ea43a90ce9d3f6)
@@ -103,5 +103,4 @@
   usedFields.clear();
   additionalAtomData.clear();
-  atomIdMap.clear();
   knownKeys.clear();
 }
@@ -116,6 +115,7 @@
   string::size_type location;
 
-  // reset atomIdMap, for we now get new serials
-  atomIdMap.clear();
+  // reset the id maps
+  resetIdAssociations();
+
   LOG(1, "INFO: Clearing usedFields.");
   usedFields.clear();
@@ -444,5 +444,5 @@
         ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!");
         LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter);
-        atomIdMap[toInt(*tok_iter)] = atomid;
+        associateLocaltoGlobalId(toInt(*tok_iter), atomid);
         tok_iter++;
         break;
@@ -525,10 +525,13 @@
         neighbor != currentInfo->second.neighbors.end(); neighbor++
       ) {
-//        LOG(1, "INFO: Creating bond between ("
-//            << currentInfo->first
-//            << ") and ("
-//            << atomIdMap[*neighbor] << "|" << *neighbor << ")");
+        LOG(3, "INFO: Creating bond between ("
+            << currentInfo->first
+            << ") and ("
+            << getGlobalId(*neighbor) << "|" << *neighbor << ")");
+        ASSERT(getGlobalId(*neighbor) != -1,
+            "FormatParser< tremolo >::processNeighborInformation() - global id to local id "
+            +toString(*neighbor)+" is unknown.");
         World::getInstance().getAtom(AtomById(currentInfo->first))
-            ->addBond(WorldTime::getTime(), World::getInstance().getAtom(AtomById(atomIdMap[*neighbor])));
+            ->addBond(WorldTime::getTime(), World::getInstance().getAtom(AtomById(getGlobalId(*neighbor))));
       }
       currentInfo->second.neighbors_processed = true;
@@ -558,8 +561,8 @@
 
   line >> id;
-  result << atomIdMap[id];
+  result << getGlobalId(id);
   while (line.good()) {
     line >> separator >> id;
-    result << separator << atomIdMap[id];
+    result << separator << getGlobalId(id);
   }
 
Index: src/Parser/TremoloParser.hpp
===================================================================
--- src/Parser/TremoloParser.hpp	(revision 0aa122d5f3137de21e283fdaa583b526d33a6540)
+++ src/Parser/TremoloParser.hpp	(revision d08ab389fd2efbb426bd7cda87ea43a90ce9d3f6)
@@ -103,10 +103,4 @@
    */
   TremoloAtomInfoContainer defaultAdditionalData;
-
-  /**
-   * Maps original atom IDs received from the parsed file to atom IDs in the
-   * world.
-   */
-  std::map<int, int> atomIdMap;
 };
 
Index: src/Parser/unittests/ParserPdbUnitTest.cpp
===================================================================
--- src/Parser/unittests/ParserPdbUnitTest.cpp	(revision 0aa122d5f3137de21e283fdaa583b526d33a6540)
+++ src/Parser/unittests/ParserPdbUnitTest.cpp	(revision d08ab389fd2efbb426bd7cda87ea43a90ce9d3f6)
@@ -66,5 +66,5 @@
   parser = new FormatParser<pdb>();
 
-  setVerbosity(2);
+  setVerbosity(3);
 
   // we need hydrogens and oxygens in the following tests
@@ -94,5 +94,5 @@
   parser->save(&output, atoms);
 
-//  std::cout << "Save PDB is:" << std::endl;
+  //  std::cout << "Save PDB is:" << std::endl;
 //  std::cout << output.str() << std::endl;
 
