Index: src/Parser/FormatParserStorage.cpp
===================================================================
--- src/Parser/FormatParserStorage.cpp	(revision 5c6946cfd5f8773c487f84e0b4a983678eec8c83)
+++ src/Parser/FormatParserStorage.cpp	(revision bb6193865ee69d221ba8b130353ded6a0f4eb7e3)
@@ -28,4 +28,5 @@
 #include "Parser/MpqcParser.hpp"
 #include "Parser/PcpParser.hpp"
+#include "Parser/PdbParser.hpp"
 #include "Parser/TremoloParser.hpp"
 #include "Parser/XyzParser.hpp"
@@ -58,4 +59,5 @@
   ParserNames[mpqc] = "mpqc";
   ParserNames[pcp] = "pcp";
+  ParserNames[pdb] = "pdb";
   ParserNames[tremolo] = "tremolo";
   ParserNames[xyz] = "xyz";
@@ -66,4 +68,5 @@
   ParserSuffix[mpqc] = "in";
   ParserSuffix[pcp] = "conf";
+  ParserSuffix[pdb] = "pdb";
   ParserSuffix[tremolo] = "data";
   ParserSuffix[xyz] = "xyz";
@@ -71,4 +74,5 @@
   ParserAddFunction[mpqc] = &FormatParserStorage::addMpqc;
   ParserAddFunction[pcp] = &FormatParserStorage::addPcp;
+  ParserAddFunction[pdb] = &FormatParserStorage::addPdb;
   ParserAddFunction[tremolo] = &FormatParserStorage::addTremolo;
   ParserAddFunction[xyz] = &FormatParserStorage::addXyz;
@@ -135,4 +139,16 @@
   } else
     DoeLog(1) && (eLog() << Verbose(1) << "Parser pcp is already present." << endl);
+}
+
+
+/** Adds an PdbParser to the storage.
+ */
+void FormatParserStorage::addPdb()
+{
+  if (!ParserPresent[pdb]) {
+    ParserList[pdb] = new PdbParser();
+    ParserPresent[pdb] = true;
+  } else
+    DoeLog(1) && (eLog() << Verbose(1) << "Parser pdb is already present." << endl);
 }
 
@@ -203,4 +219,6 @@
   } else if (suffix == ParserSuffix[pcp]) {
     getPcp().load(&input);
+  } else if (suffix == ParserSuffix[pdb]) {
+    getPdb().load(&input);
   } else if (suffix == ParserSuffix[tremolo]) {
     getTremolo().load(&input);
@@ -234,4 +252,14 @@
 }
 
+/** Returns reference to the output PdbParser, adds if not present.
+ * \return reference to the output PdbParser
+ */
+PdbParser &FormatParserStorage::getPdb()
+{
+  if (!ParserPresent[pdb])
+    addPdb();
+  return dynamic_cast<PdbParser &>(*ParserList[pdb]);
+}
+
 /** Returns reference to the output TremoloParser, adds if not present.
  * \return reference to the output TremoloParser
Index: src/Parser/FormatParserStorage.hpp
===================================================================
--- src/Parser/FormatParserStorage.hpp	(revision 5c6946cfd5f8773c487f84e0b4a983678eec8c83)
+++ src/Parser/FormatParserStorage.hpp	(revision bb6193865ee69d221ba8b130353ded6a0f4eb7e3)
@@ -22,4 +22,5 @@
 class FormatParser;
 class MpqcParser;
+class PdbParser;
 class PcpParser;
 class TremoloParser;
@@ -27,5 +28,5 @@
 
 // enum has to be outside of class for operator++ to be possible
-enum ParserTypes { mpqc, pcp, tremolo, xyz, ParserTypes_end, ParserTypes_begin = mpqc };
+enum ParserTypes { mpqc, pcp, pdb, tremolo, xyz, ParserTypes_end, ParserTypes_begin = mpqc };
 typedef enum ParserTypes ParserTypes;
 
@@ -38,4 +39,5 @@
   void addMpqc();
   void addPcp();
+  void addPdb();
   void addTremolo();
   void addXyz();
@@ -46,4 +48,5 @@
   MpqcParser &getMpqc();
   PcpParser &getPcp();
+  PdbParser &getPdb();
   TremoloParser &getTremolo();
   XyzParser &getXyz();
Index: src/Parser/PdbParser.cpp
===================================================================
--- src/Parser/PdbParser.cpp	(revision 5c6946cfd5f8773c487f84e0b4a983678eec8c83)
+++ src/Parser/PdbParser.cpp	(revision bb6193865ee69d221ba8b130353ded6a0f4eb7e3)
@@ -26,11 +26,15 @@
 #include "World.hpp"
 #include "atom.hpp"
+#include "bond.hpp"
 #include "element.hpp"
-#include "bond.hpp"
+#include "molecule.hpp"
 #include "periodentafel.hpp"
 #include "Descriptors/AtomIdDescriptor.hpp"
+
 #include <map>
 #include <vector>
 
+#include <iostream>
+#include <iomanip>
 
 using namespace std;
@@ -40,30 +44,17 @@
  */
 PdbParser::PdbParser() {
-  knownKeys[" "] = TremoloKey::noKey; // with this we can detect invalid keys
-  knownKeys["x"] = TremoloKey::x;
-  knownKeys["u"] = TremoloKey::u;
-  knownKeys["F"] = TremoloKey::F;
-  knownKeys["stress"] = TremoloKey::stress;
-  knownKeys["Id"] = TremoloKey::Id;
-  knownKeys["neighbors"] = TremoloKey::neighbors;
-  knownKeys["imprData"] = TremoloKey::imprData;
-  knownKeys["GroupMeasureTypeNo"] = TremoloKey::GroupMeasureTypeNo;
-  knownKeys["Type"] = TremoloKey::Type;
-  knownKeys["extType"] = TremoloKey::extType;
-  knownKeys["name"] = TremoloKey::name;
-  knownKeys["resName"] = TremoloKey::resName;
-  knownKeys["chainID"] = TremoloKey::chainID;
-  knownKeys["resSeq"] = TremoloKey::resSeq;
-  knownKeys["occupancy"] = TremoloKey::occupancy;
-  knownKeys["tempFactor"] = TremoloKey::tempFactor;
-  knownKeys["segID"] = TremoloKey::segID;
-  knownKeys["Charge"] = TremoloKey::Charge;
-  knownKeys["charge"] = TremoloKey::charge;
-  knownKeys["GrpTypeNo"] = TremoloKey::GrpTypeNo;
-  knownKeys["torsion"] = TremoloKey::torsion;
-
-  // default behavior: use all possible keys on output
-  for (std::map<std::string, TremoloKey::atomDataKey>::iterator iter = knownKeys.begin(); iter != knownKeys.end(); ++iter)
-    usedFields.push_back(iter->first);
+  knownKeys[" "] = PdbKey::noKey; // with this we can detect invalid keys
+  knownKeys["x"] = PdbKey::x;
+  knownKeys["Id"] = PdbKey::Id;
+  knownKeys["Type"] = PdbKey::Type;
+  knownKeys["extType"] = PdbKey::extType;
+  knownKeys["name"] = PdbKey::name;
+  knownKeys["resName"] = PdbKey::resName;
+  knownKeys["chainID"] = PdbKey::chainID;
+  knownKeys["resSeq"] = PdbKey::resSeq;
+  knownKeys["occupancy"] = PdbKey::occupancy;
+  knownKeys["tempFactor"] = PdbKey::tempFactor;
+  knownKeys["segID"] = PdbKey::segID;
+  knownKeys["charge"] = PdbKey::charge;
 }
 
@@ -72,5 +63,4 @@
  */
 PdbParser::~PdbParser() {
-  usedFields.clear();
   additionalAtomData.clear();
   atomIdMap.clear();
@@ -84,141 +74,135 @@
  */
 void PdbParser::load(istream* file) {
-  string line;
-  string::size_type location;
-
-  usedFields.clear();
-  while (file->good()) {
-    std::getline(*file, line, '\n');
-    if (usedFields.empty()) {
-      location = line.find("ATOMDATA", 0);
-      if (location != string::npos) {
-       parseAtomDataKeysLine(line, location + 8);
+//  string line;
+//  string::size_type location;
+//
+//  usedFields.clear();
+//  while (file->good()) {
+//    std::getline(*file, line, '\n');
+//    if (usedFields.empty()) {
+//      location = line.find("ATOMDATA", 0);
+//      if (location != string::npos) {
+//       parseAtomDataKeysLine(line, location + 8);
+//      }
+//    }
+//    if (line.length() > 0 && line.at(0) != '#') {
+//      readAtomDataLine(line);
+//    }
+//  }
+//
+//  processNeighborInformation();
+//  adaptImprData();
+//  adaptTorsion();
+}
+
+/**
+ * Saves the World's current state into as a tremolo file.
+ *
+ * \param file where to save the state
+ */
+void PdbParser::save(ostream* file) {
+  DoLog(0) && (Log() << Verbose(0) << "Saving changes to pdb." << std::endl);
+
+  {
+    // add initial remark
+    *file << "REMARK created by molecuilder on ";
+    time_t now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
+    // ctime ends in \n\0, we have to cut away the newline
+    std::string time(ctime(&now));
+    size_t pos = time.find('\n');
+    if (pos != 0)
+      *file << time.substr(0,pos);
+    else
+      *file << time;
+    *file << endl;
+  }
+
+  {
+    vector<atom *> AtomList = World::getInstance().getAllAtoms();
+
+    std::vector<int> elementNo(MAX_ELEMENTS,1);
+    char name[MAXSTRINGSIZE];
+
+    // write ATOMs
+    int AtomNo = 1; // serial number starts at 1 in pdb
+    int MolNo = 1;  // residue number starts at 1 in pdb
+    for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
+      const size_t  Z = (*atomIt)->getType()->getAtomicNumber();
+      sprintf(name, "%2s%02d",(*atomIt)->getType()->getSymbol().c_str(), elementNo[Z]);
+      elementNo[Z] = (elementNo[Z]+1) % 100;   // confine to two digits
+      const molecule *mol = (*atomIt)->getMolecule();
+      if (mol == NULL) {  // for homeless atoms, MolNo = 0 is reserved
+        MolNo = 0;
+      } else {
+        MolNo = mol->getId();
       }
+      saveLine(file, *atomIt, name, AtomNo, MolNo);
+      atomIdMap.insert( pair<int, int>((*atomIt)->getId(), AtomNo) );
+      AtomNo++;
     }
-    if (line.length() > 0 && line.at(0) != '#') {
-      readAtomDataLine(line);
+
+    // write CONECTs
+    for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
+      writeNeighbors(file, 4, *atomIt);
     }
   }
 
-  processNeighborInformation();
-  adaptImprData();
-  adaptTorsion();
-}
-
-/**
- * Saves the World's current state into as a tremolo file.
- *
- * \param file where to save the state
- */
-void PdbParser::save(ostream* file) {
-  DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl);
-
-  vector<atom*>::iterator atomIt;
-  vector<string>::iterator it;
-
-  *file << "# ATOMDATA";
-  for (it=usedFields.begin(); it < usedFields.end(); it++) {
-    *file << "\t" << *it;
-  }
+  // END
+  *file << "END" << endl;
+}
+
+/**
+ * Writes one line of tremolo-formatted data to the provided stream.
+ *
+ * \param stream where to write the line to
+ * \param *currentAtom the atom of which information should be written
+ * \param *name name of atom, i.e. H01
+ * \param AtomNo serial number of atom
+ * \param ResidueNo number of residue
+ */
+void PdbParser::saveLine(ostream* file, const atom* currentAtom, const char *name, const int AtomNo, const int ResidueNo) {
+  *file << "ATOM ";
+  *file << setw(6) << AtomNo; /* atom serial number */
+  *file << setw(1) << " ";
+  *file << setfill(' ') << left << setw(4) << name << right;  /* atom name */
+  *file << setw(1) << " ";
+  *file << setfill(' ') << setw(3) << ((currentAtom->getMolecule() != NULL) ? currentAtom->getMolecule()->getName().substr(0,3) : "-");  /* residue name */
+  *file << setw(1) << " ";
+  *file << setfill(' ') << setw(1) << (char)('a'+(unsigned char)(AtomNo % 26)); /* letter for chain */
+  *file << setw(4) << ResidueNo; /* residue sequence number */
+  *file << setw(4) << "    ";
+  for (int i=0;i<NDIM;i++) {
+    *file << setw(8) << setprecision(3) << showpoint << currentAtom->at(i); /* positional coordinate in Angstroem */
+  }
+  *file << setw(6) << setprecision(2) << showpoint << (double)currentAtom->getType()->getValence(); /* occupancy */
+  *file << setw(6) << setprecision(2) << showpoint << (double)currentAtom->getType()->getNoValenceOrbitals(); /* temperature factor */
+  *file << noshowpoint;
+  *file << setw(6) << "      ";
+  *file << setw(4) << "0";
+  *file << setfill(' ') << setw(2) << currentAtom->getType()->getSymbol();
+  *file << setw(2) << "0";
+
   *file << endl;
-  vector<atom *> AtomList = World::getInstance().getAllAtoms();
-  for (atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
-    saveLine(file, *atomIt);
-  }
-}
-
-/**
- * Sets the keys for which data should be written to the stream when save is
- * called.
- *
- * \param string of field names with the same syntax as for an ATOMDATA line
- *        but without the prexix "ATOMDATA"
- */
-void PdbParser::setFieldsForSave(std::string atomDataLine) {
-  parseAtomDataKeysLine(atomDataLine, 0);
-}
-
-
-/**
- * Writes one line of tremolo-formatted data to the provided stream.
- *
- * \param stream where to write the line to
- * \param reference to the atom of which information should be written
- */
-void PdbParser::saveLine(ostream* file, atom* currentAtom) {
-  vector<string>::iterator it;
-  TremoloKey::atomDataKey currentField;
-
-  for (it = usedFields.begin(); it != usedFields.end(); it++) {
-    currentField = knownKeys[it->substr(0, it->find("="))];
-    switch (currentField) {
-      case TremoloKey::x :
-        // for the moment, assume there are always three dimensions
-        *file << currentAtom->at(0) << "\t";
-        *file << currentAtom->at(1) << "\t";
-        *file << currentAtom->at(2) << "\t";
-        break;
-      case TremoloKey::u :
-        // for the moment, assume there are always three dimensions
-        *file << currentAtom->AtomicVelocity[0] << "\t";
-        *file << currentAtom->AtomicVelocity[1] << "\t";
-        *file << currentAtom->AtomicVelocity[2] << "\t";
-        break;
-      case TremoloKey::Type :
-        *file << currentAtom->getType()->getSymbol() << "\t";
-        break;
-      case TremoloKey::Id :
-        *file << currentAtom->getId() << "\t";
-        break;
-      case TremoloKey::neighbors :
-        writeNeighbors(file, atoi(it->substr(it->find("=") + 1, 1).c_str()), currentAtom);
-        break;
-      default :
-        *file << (additionalAtomData.find(currentAtom->getId()) != additionalAtomData.end()
-          ? additionalAtomData[currentAtom->getId()].get(currentField)
-          : defaultAdditionalData.get(currentField));
-        *file << "\t";
-        break;
+}
+
+/**
+ * Writes the neighbor information of one atom to the provided stream.
+ *
+ * \param *file  where to write neighbor information to
+ * \param MaxnumberOfNeighbors of neighbors
+ * \param *currentAtom to the atom of which to take the neighbor information
+ */
+void PdbParser::writeNeighbors(ostream* file, int MaxnumberOfNeighbors, atom* currentAtom) {
+  if (!currentAtom->ListOfBonds.empty()) {
+    *file << "CONECT";
+    int MaxNo = 0;
+    for(BondList::iterator currentBond = currentAtom->ListOfBonds.begin(); currentBond != currentAtom->ListOfBonds.end(); ++currentBond) {
+      if (MaxNo < MaxnumberOfNeighbors) {
+        ASSERT(atomIdMap.find((*currentBond)->GetOtherAtom(currentAtom)->getId()) != atomIdMap.end(), "Id of atom not stored in PdbParser::atomIdMap.");
+        *file << setw(5) << atomIdMap[(*currentBond)->GetOtherAtom(currentAtom)->getId()];
+      }
+      MaxNo++;
     }
-  }
-
-  *file << endl;
-}
-
-/**
- * Writes the neighbor information of one atom to the provided stream.
- *
- * \param stream where to write neighbor information to
- * \param number of neighbors
- * \param reference to the atom of which to take the neighbor information
- */
-void PdbParser::writeNeighbors(ostream* file, int numberOfNeighbors, atom* currentAtom) {
-  BondList::iterator currentBond = currentAtom->ListOfBonds.begin();
-  for (int i = 0; i < numberOfNeighbors; i++) {
-    *file << (currentBond != currentAtom->ListOfBonds.end()
-        ? (*currentBond)->GetOtherAtom(currentAtom)->getId() : 0) << "\t";
-  }
-}
-
-/**
- * Stores keys from the ATOMDATA line.
- *
- * \param line to parse the keys from
- * \param with which offset the keys begin within the line
- */
-void PdbParser::parseAtomDataKeysLine(string line, int offset) {
-  string keyword;
-  stringstream lineStream;
-
-  lineStream << line.substr(offset);
-  usedFields.clear();
-  while (lineStream.good()) {
-    lineStream >> keyword;
-    if (knownKeys[keyword.substr(0, keyword.find("="))] == TremoloKey::noKey) {
-      // TODO: throw exception about unknown key
-      cout << "Unknown key: " << keyword << " is not part of the tremolo format specification." << endl;
-      break;
-    }
-    usedFields.push_back(keyword);
+    *file << endl;
   }
 }
@@ -231,52 +215,52 @@
  */
 void PdbParser::readAtomDataLine(string line) {
-  vector<string>::iterator it;
-  stringstream lineStream;
-  atom* newAtom = World::getInstance().createAtom();
-  TremoloAtomInfoContainer *atomInfo = NULL;
-  additionalAtomData[newAtom->getId()] = *(new TremoloAtomInfoContainer);
-  atomInfo = &additionalAtomData[newAtom->getId()];
-  TremoloKey::atomDataKey currentField;
-  string word;
-  int oldId;
-  double tmp;
-
-  lineStream << line;
-  for (it = usedFields.begin(); it < usedFields.end(); it++) {
-    currentField = knownKeys[it->substr(0, it->find("="))];
-    switch (currentField) {
-      case TremoloKey::x :
-        // for the moment, assume there are always three dimensions
-        for (int i=0;i<NDIM;i++) {
-          lineStream >> tmp;
-          newAtom->set(i, tmp);
-        }
-        break;
-      case TremoloKey::u :
-        // for the moment, assume there are always three dimensions
-        lineStream >> newAtom->AtomicVelocity[0];
-        lineStream >> newAtom->AtomicVelocity[1];
-        lineStream >> newAtom->AtomicVelocity[2];
-        break;
-      case TremoloKey::Type :
-        char type[3];
-        lineStream >> type;
-        newAtom->setType(World::getInstance().getPeriode()->FindElement(type));
-        ASSERT(newAtom->getType(), "Type was not set for this atom");
-        break;
-      case TremoloKey::Id :
-        lineStream >> oldId;
-        atomIdMap[oldId] = newAtom->getId();
-        break;
-      case TremoloKey::neighbors :
-        readNeighbors(&lineStream,
-            atoi(it->substr(it->find("=") + 1, 1).c_str()), newAtom->getId());
-        break;
-      default :
-        lineStream >> word;
-        atomInfo->set(currentField, word);
-        break;
-    }
-  }
+//  vector<string>::iterator it;
+//  stringstream lineStream;
+//  atom* newAtom = World::getInstance().createAtom();
+//  PdbAtomInfoContainer *atomInfo = NULL;
+//  additionalAtomData[newAtom->getId()] = *(new PdbAtomInfoContainer);
+//  atomInfo = &additionalAtomData[newAtom->getId()];
+//  PdbKey::atomDataKey currentField;
+//  string word;
+//  int oldId;
+//  double tmp;
+//
+//  lineStream << line;
+//  for (it = usedFields.begin(); it < usedFields.end(); it++) {
+//    currentField = knownKeys[it->substr(0, it->find("="))];
+//    switch (currentField) {
+//      case PdbKey::x :
+//        // for the moment, assume there are always three dimensions
+//        for (int i=0;i<NDIM;i++) {
+//          lineStream >> tmp;
+//          newAtom->set(i, tmp);
+//        }
+//        break;
+//      case PdbKey::u :
+//        // for the moment, assume there are always three dimensions
+//        lineStream >> newAtom->AtomicVelocity[0];
+//        lineStream >> newAtom->AtomicVelocity[1];
+//        lineStream >> newAtom->AtomicVelocity[2];
+//        break;
+//      case PdbKey::Type :
+//        char type[3];
+//        lineStream >> type;
+//        newAtom->setType(World::getInstance().getPeriode()->FindElement(type));
+//        ASSERT(newAtom->getType(), "Type was not set for this atom");
+//        break;
+//      case PdbKey::Id :
+//        lineStream >> oldId;
+//        atomIdMap[oldId] = newAtom->getId();
+//        break;
+//      case PdbKey::neighbors :
+//        readNeighbors(&lineStream,
+//            atoi(it->substr(it->find("=") + 1, 1).c_str()), newAtom->getId());
+//        break;
+//      default :
+//        lineStream >> word;
+//        atomInfo->set(currentField, word);
+//        break;
+//    }
+//  }
 }
 
@@ -289,31 +273,13 @@
  */
 void PdbParser::readNeighbors(stringstream* line, int numberOfNeighbors, int atomId) {
-  int neighborId = 0;
-  for (int i = 0; i < numberOfNeighbors; i++) {
-    *line >> neighborId;
-    // 0 is used to fill empty neighbor positions in the tremolo file.
-    if (neighborId > 0) {
-      additionalAtomData[atomId].neighbors.push_back(neighborId);
-    }
-  }
-}
-
-/**
- * Checks whether the provided name is within the list of used fields.
- *
- * \param field name to check
- *
- * \return true if the field name is used
- */
-bool PdbParser::isUsedField(string fieldName) {
-  bool fieldNameExists = false;
-  for (vector<string>::iterator usedField = usedFields.begin(); usedField != usedFields.end(); usedField++) {
-    if (usedField->substr(0, usedField->find("=")) == fieldName)
-      fieldNameExists = true;
-  }
-
-  return fieldNameExists;
-}
-
+//  int neighborId = 0;
+//  for (int i = 0; i < numberOfNeighbors; i++) {
+//    *line >> neighborId;
+//    // 0 is used to fill empty neighbor positions in the tremolo file.
+//    if (neighborId > 0) {
+//      additionalAtomData[atomId].neighbors.push_back(neighborId);
+//    }
+//  }
+}
 
 /**
@@ -323,18 +289,18 @@
  */
 void PdbParser::processNeighborInformation() {
-  if (!isUsedField("neighbors")) {
-    return;
-  }
-
-  for(map<int, TremoloAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin();
-    currentInfo != additionalAtomData.end(); currentInfo++
-  ) {
-    for(vector<int>::iterator neighbor = currentInfo->second.neighbors.begin();
-      neighbor != currentInfo->second.neighbors.end(); neighbor++
-    ) {
-      World::getInstance().getAtom(AtomById(currentInfo->first))
-          ->addBond(World::getInstance().getAtom(AtomById(atomIdMap[*neighbor])));
-    }
-  }
+//  if (!isUsedField("neighbors")) {
+//    return;
+//  }
+//
+//  for(map<int, PdbAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin();
+//    currentInfo != additionalAtomData.end(); currentInfo++
+//  ) {
+//    for(vector<int>::iterator neighbor = currentInfo->second.neighbors.begin();
+//      neighbor != currentInfo->second.neighbors.end(); neighbor++
+//    ) {
+//      World::getInstance().getAtom(AtomById(currentInfo->first))
+//          ->addBond(World::getInstance().getAtom(AtomById(atomIdMap[*neighbor])));
+//    }
+//  }
 }
 
@@ -349,63 +315,27 @@
  */
 string PdbParser::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();
-}
-
-/**
- * Corrects the atom IDs in each imprData entry to the corresponding world IDs
- * as they might differ from the originally read IDs.
- */
-void PdbParser::adaptImprData() {
-  if (!isUsedField("imprData")) {
-    return;
-  }
-
-  for(map<int, 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
- * as they might differ from the originally read IDs.
- */
-void PdbParser::adaptTorsion() {
-  if (!isUsedField("torsion")) {
-    return;
-  }
-
-  for(map<int, TremoloAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin();
-    currentInfo != additionalAtomData.end(); currentInfo++
-  ) {
-    currentInfo->second.torsion = adaptIdDependentDataString(currentInfo->second.torsion);
-  }
-}
-
-
-TremoloAtomInfoContainer::TremoloAtomInfoContainer() :
-  F("0"),
-  stress("0"),
-  imprData("-"),
-  GroupMeasureTypeNo("0"),
-  extType("-"),
+//  // 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 "";
+}
+
+
+PdbAtomInfoContainer::PdbAtomInfoContainer() :
   name("-"),
   resName("-"),
@@ -415,60 +345,35 @@
   tempFactor("0"),
   segID("0"),
-  Charge("0"),
-  charge("0"),
-  GrpTypeNo("0"),
-  torsion("-"),
-  neighbors(vector<int>(0, 5))
+  charge("0")
 {}
 
-void TremoloAtomInfoContainer::set(TremoloKey::atomDataKey key, string value) {
+void PdbAtomInfoContainer::set(PdbKey::PdbDataKey key, string value) {
   switch (key) {
-    case TremoloKey::F :
-      F = value;
-      break;
-    case TremoloKey::stress :
-      stress = value;
-     break;
-    case TremoloKey::imprData :
-      imprData = value;
-      break;
-    case TremoloKey::GroupMeasureTypeNo :
-      GroupMeasureTypeNo = value;
-      break;
-    case TremoloKey::extType :
+    case PdbKey::extType :
       extType = value;
       break;
-    case TremoloKey::name :
+    case PdbKey::name :
       name = value;
       break;
-    case TremoloKey::resName :
+    case PdbKey::resName :
       resName = value;
       break;
-    case TremoloKey::chainID :
+    case PdbKey::chainID :
       chainID = value;
       break;
-    case TremoloKey::resSeq :
+    case PdbKey::resSeq :
       resSeq = value;
       break;
-    case TremoloKey::occupancy :
+    case PdbKey::occupancy :
       occupancy = value;
       break;
-    case TremoloKey::tempFactor :
+    case PdbKey::tempFactor :
       tempFactor = value;
       break;
-    case TremoloKey::segID :
+    case PdbKey::segID :
       segID = value;
       break;
-    case TremoloKey::Charge :
-      Charge = value;
-      break;
-    case TremoloKey::charge :
+    case PdbKey::charge :
       charge = value;
-      break;
-    case TremoloKey::GrpTypeNo :
-      GrpTypeNo = value;
-      break;
-    case TremoloKey::torsion :
-      torsion = value;
       break;
     default :
@@ -478,38 +383,24 @@
 }
 
-string TremoloAtomInfoContainer::get(TremoloKey::atomDataKey key) {
+string PdbAtomInfoContainer::get(PdbKey::PdbDataKey key) {
   switch (key) {
-    case TremoloKey::F :
-      return F;
-    case TremoloKey::stress :
-      return stress;
-    case TremoloKey::imprData :
-      return imprData;
-    case TremoloKey::GroupMeasureTypeNo :
-      return GroupMeasureTypeNo;
-    case TremoloKey::extType :
+    case PdbKey::extType :
       return extType;
-    case TremoloKey::name :
+    case PdbKey::name :
       return name;
-    case TremoloKey::resName :
+    case PdbKey::resName :
       return resName;
-    case TremoloKey::chainID :
+    case PdbKey::chainID :
       return chainID;
-    case TremoloKey::resSeq :
+    case PdbKey::resSeq :
       return resSeq;
-    case TremoloKey::occupancy :
+    case PdbKey::occupancy :
       return occupancy;
-    case TremoloKey::tempFactor :
+    case PdbKey::tempFactor :
       return tempFactor;
-    case TremoloKey::segID :
+    case PdbKey::segID :
       return segID;
-    case TremoloKey::Charge :
-      return Charge;
-    case TremoloKey::charge :
+    case PdbKey::charge :
       return charge;
-    case TremoloKey::GrpTypeNo :
-      return GrpTypeNo;
-    case TremoloKey::torsion :
-      return torsion;
     default :
       cout << "Unknown key: " << key << endl;
Index: src/Parser/PdbParser.hpp
===================================================================
--- src/Parser/PdbParser.hpp	(revision 5c6946cfd5f8773c487f84e0b4a983678eec8c83)
+++ src/Parser/PdbParser.hpp	(revision bb6193865ee69d221ba8b130353ded6a0f4eb7e3)
@@ -13,18 +13,12 @@
 
 /**
- * Known keys for the ATOMDATA line.
+ * Known keys for the Pdb line.
  */
-class TremoloKey {
+class PdbKey {
 public:
-  enum atomDataKey {
+  enum PdbDataKey {
     noKey,
     x,
-    u,
-    F,
-    stress,
     Id,
-    neighbors,
-    imprData,
-    GroupMeasureTypeNo,
     Type,
     extType,
@@ -36,8 +30,5 @@
     tempFactor,
     segID,
-    Charge,
-    charge,
-    GrpTypeNo,
-    torsion
+    charge
   };
 };
@@ -46,15 +37,11 @@
  * Holds tremolo-specific information which is not store in the atom class.
  */
-class TremoloAtomInfoContainer {
+class PdbAtomInfoContainer {
 public:
-  TremoloAtomInfoContainer();
-  void set(TremoloKey::atomDataKey key, std::string value);
-  std::string get(TremoloKey::atomDataKey key);
-  std::string F;
-  std::string stress;
-  std::string imprData;
-  std::string GroupMeasureTypeNo;
+  PdbAtomInfoContainer();
+  void set(PdbKey::PdbDataKey key, std::string value);
+  std::string get(PdbKey::PdbDataKey key);
+  std::string name;
   std::string extType;
-  std::string name;
   std::string resName;
   std::string chainID;
@@ -63,9 +50,5 @@
   std::string tempFactor;
   std::string segID;
-  std::string Charge;
   std::string charge;
-  std::string GrpTypeNo;
-  std::string torsion;
-  std::vector<int> neighbors;
 };
 
@@ -80,5 +63,4 @@
   void load(std::istream* file);
   void save(std::ostream* file);
-  void setFieldsForSave(std::string atomDataLine);
 
 
@@ -93,15 +75,11 @@
   bool isUsedField(std::string fieldName);
   void writeNeighbors(std::ostream* file, int numberOfNeighbors, atom* currentAtom);
-  void saveLine(std::ostream* file, atom* currentAtom);
+  void saveLine(ostream* file, const atom* currentAtom, const char *name, const int AtomNo, const int ResdueNo);
+;
 
   /**
    * Map to associate the known keys with numbers.
    */
-  std::map<std::string, TremoloKey::atomDataKey> knownKeys;
-
-  /**
-   * Fields used in the tremolo file.
-   */
-  std::vector<std::string> usedFields;
+  std::map<std::string, PdbKey::PdbDataKey> knownKeys;
 
   /**
@@ -109,10 +87,10 @@
    * file.
    */
-  std::map<int, TremoloAtomInfoContainer> additionalAtomData;
+  std::map<int, PdbAtomInfoContainer> additionalAtomData;
 
   /**
    * Default additional atom data.
    */
-  TremoloAtomInfoContainer defaultAdditionalData;
+  PdbAtomInfoContainer defaultAdditionalData;
 
   /**
Index: tests/regression/Simple_configuration/2/post/test.pdb
===================================================================
--- tests/regression/Simple_configuration/2/post/test.pdb	(revision bb6193865ee69d221ba8b130353ded6a0f4eb7e3)
+++ tests/regression/Simple_configuration/2/post/test.pdb	(revision bb6193865ee69d221ba8b130353ded6a0f4eb7e3)
@@ -0,0 +1,3 @@
+REMARK created by molecuilder on Fri Aug 27 12:18:33 2010
+ATOM      1  H01 non b   1        10.0    10.0    10.0   1.0   1.0         0 H 0
+END
Index: tests/regression/testsuite-simple_configuration.at
===================================================================
--- tests/regression/testsuite-simple_configuration.at	(revision 5c6946cfd5f8773c487f84e0b4a983678eec8c83)
+++ tests/regression/testsuite-simple_configuration.at	(revision bb6193865ee69d221ba8b130353ded6a0f4eb7e3)
@@ -13,6 +13,6 @@
 AT_SETUP([Simple configuration - parsing xyz file])
 AT_KEYWORDS([configuration])
-AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz .], 0)
-AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp xyz -p test.xyz], 0, [ignore], [ignore])
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz parsertest.xyz], 0)
+AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp pdb xyz -p parsertest.xyz], 0, [ignore], [ignore])
 AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1	10.000000000	10.000000000	10.000000000	0 # molecule nr 0
 ], [ignore])
@@ -20,4 +20,5 @@
 AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/$file], 0, [ignore], [ignore])
 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/$file], 0, [ignore], [ignore])
+AT_CHECK([file=test.pdb; diff -I '.*created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/$file], 0, [ignore], [ignore])
 AT_CLEANUP
 
