Index: src/Parser/FormatParser.cpp
===================================================================
--- src/Parser/FormatParser.cpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/FormatParser.cpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -52,5 +52,6 @@
   }
 
-  save(saveStream);
+  std::vector<atom *> atoms = World::getInstance().getAllAtoms();
+  save(saveStream, atoms);
 }
 
Index: src/Parser/FormatParser.hpp
===================================================================
--- src/Parser/FormatParser.hpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/FormatParser.hpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -13,4 +13,6 @@
 #include "parser.hpp"
 
+class atom;
+
 /**
  * General parser which observes the change tracker.
@@ -20,5 +22,5 @@
   FormatParser();
   virtual ~FormatParser();
-  virtual void save(std::ostream* file)=0;
+  virtual void save(std::ostream* file, const std::vector<atom *> &atoms)=0;
   virtual void load(std::istream* file)=0;
   void setOstream(std::ostream* file);
Index: src/Parser/FormatParserStorage.cpp
===================================================================
--- src/Parser/FormatParserStorage.cpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/FormatParserStorage.cpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -36,4 +36,6 @@
 
 #include "Helpers/Assert.hpp"
+
+#include "molecule.hpp"
 
 #include "Patterns/Singleton_impl.hpp"
@@ -224,5 +226,5 @@
  * \return true - parsing ok, false - suffix unknown
  */
-bool FormatParserStorage::get(std::istream &input, std::string suffix)
+bool FormatParserStorage::load(std::istream &input, std::string suffix)
 {
   if (suffix == ParserSuffixes[mpqc]) {
@@ -243,4 +245,44 @@
 }
 
+/** Stores all selected atoms in an ostream depending on its suffix
+ * \param &output output stream
+ * \param suffix
+ * \return true - storing ok, false - suffix unknown
+ */
+bool FormatParserStorage::saveSelectedAtoms(std::ostream &output, std::string suffix)
+{
+  std::vector<atom *> atoms = World::getInstance().getSelectedAtoms();
+  return save(output, suffix, atoms);
+}
+
+/** Stores all selected atoms in an ostream depending on its suffix
+ * We store in the order of the atomic ids, not in the order they appear in the molecules.
+ * Hence, we first create a vector from all selected molecules' atoms.
+ * \param &output output stream
+ * \param suffix
+ * \return true - storing ok, false - suffix unknown
+ */
+bool FormatParserStorage::saveSelectedMolecules(std::ostream &output, std::string suffix)
+{
+  std::vector<molecule *> molecules = World::getInstance().getSelectedMolecules();
+  std::map<size_t, atom *> IdAtoms;
+  for (std::vector<molecule *>::const_iterator MolIter = molecules.begin();
+      MolIter != molecules.end();
+      ++MolIter) {
+    for(molecule::atomSet::const_iterator AtomIter = (*MolIter)->begin();
+        AtomIter != (*MolIter)->end();
+        ++AtomIter) {
+      IdAtoms.insert( make_pair((*AtomIter)->getId(), (*AtomIter)) );
+    }
+  }
+  std::vector<atom *> atoms;
+  atoms.reserve(IdAtoms.size());
+  for (std::map<size_t, atom *>::const_iterator iter = IdAtoms.begin();
+      iter != IdAtoms.end();
+      ++iter) {
+    atoms.push_back(iter->second);
+  }
+  return save(output, suffix, atoms);
+}
 
 /** Stores world in an ostream depending on its suffix
@@ -249,16 +291,27 @@
  * \return true - storing ok, false - suffix unknown
  */
-bool FormatParserStorage::put(std::ostream &output, std::string suffix)
+bool FormatParserStorage::saveWorld(std::ostream &output, std::string suffix)
+{
+  std::vector<atom *> atoms = World::getInstance().getAllAtoms();
+  return save(output, suffix, atoms);
+}
+
+/** Stores a given vector of \a atoms in an ostream depending on its suffix
+ * \param &output output stream
+ * \param suffix
+ * \return true - storing ok, false - suffix unknown
+ */
+bool FormatParserStorage::save(std::ostream &output, std::string suffix, const std::vector<atom *> &atoms)
 {
   if (suffix == ParserSuffixes[mpqc]) {
-    getMpqc().save(&output);
+    getMpqc().save(&output, atoms);
   } else if (suffix == ParserSuffixes[pcp]) {
-    getPcp().save(&output);
+    getPcp().save(&output, atoms);
   } else if (suffix == ParserSuffixes[pdb]) {
-    getPdb().save(&output);
+    getPdb().save(&output, atoms);
   } else if (suffix == ParserSuffixes[tremolo]) {
-    getTremolo().save(&output);
+    getTremolo().save(&output, atoms);
   } else if (suffix == ParserSuffixes[xyz]) {
-    getXyz().save(&output);
+    getXyz().save(&output, atoms);
   } else {
     DoeLog(1) && (eLog() << Verbose(1) << "Unknown suffix " << suffix << " to for FormatParserStorage::put()." << endl);
Index: src/Parser/FormatParserStorage.hpp
===================================================================
--- src/Parser/FormatParserStorage.hpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/FormatParserStorage.hpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -20,4 +20,5 @@
 #include <vector>
 
+class atom;
 class FormatParser;
 class MpqcParser;
@@ -45,6 +46,9 @@
   bool add(ParserTypes type);
 
-  bool get(std::istream &input, std::string suffix);
-  bool put(std::ostream &output, std::string suffix);
+  bool load(std::istream &input, std::string suffix);
+  bool save(std::ostream &output, std::string suffix, const std::vector<atom *> &atoms);
+  bool saveSelectedAtoms(std::ostream &output, std::string suffix);
+  bool saveSelectedMolecules(std::ostream &output, std::string suffix);
+  bool saveWorld(std::ostream &output, std::string suffix);
   MpqcParser &getMpqc();
   PcpParser &getPcp();
Index: src/Parser/MpqcParser.cpp
===================================================================
--- src/Parser/MpqcParser.cpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/MpqcParser.cpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -53,18 +53,25 @@
 }
 
-void MpqcParser::save(ostream *file)
+/**
+ * Saves the \a atoms into as a MPQC file.
+ *
+ * \param file where to save the state
+ * \param atoms atoms to store
+ */
+void MpqcParser::save(ostream *file, const std::vector<atom *> &atoms)
 {
   DoLog(0) && (Log() << Verbose(0) << "Saving changes to MPQC ." << std::endl);
 
   if (HessianPresent)
-    saveHessian(file);
+    saveHessian(file, atoms);
   else
-    saveSimple(file);
+    saveSimple(file, atoms);
 }
 
 /** Saves all atoms and data into a MPQC config file without hessian.
  * \param *file output stream
+ * \param atoms atoms to store
  */
-void MpqcParser::saveSimple(ostream *file)
+void MpqcParser::saveSimple(ostream *file, const std::vector<atom *> &atoms)
 {
   Vector center;
@@ -112,6 +119,7 @@
 /** Saves all atoms and data into a MPQC config file with hessian.
  * \param *file output stream
+ * \param atoms atoms to store
  */
-void MpqcParser::saveHessian(ostream *file)
+void MpqcParser::saveHessian(ostream *file, const std::vector<atom *> &atoms)
 {
   Vector center;
Index: src/Parser/MpqcParser.hpp
===================================================================
--- src/Parser/MpqcParser.hpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/MpqcParser.hpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -22,5 +22,5 @@
   ~MpqcParser();
   void load(std::istream* file);
-  void save(std::ostream* file);
+  void save(std::ostream* file, const std::vector<atom *> &atoms);
 
   void setHessian(bool hessian);
@@ -30,6 +30,6 @@
   bool HessianPresent;
 
-  void saveSimple(std::ostream *file);
-  void saveHessian(std::ostream *file);
+  void saveSimple(std::ostream *file, const std::vector<atom *> &atoms);
+  void saveHessian(std::ostream *file, const std::vector<atom *> &atoms);
 };
 
Index: src/Parser/PcpParser.cpp
===================================================================
--- src/Parser/PcpParser.cpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/PcpParser.cpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -368,8 +368,11 @@
 }
 
-/** Saves the World into a PCP config file.
- * \param *file output stream to save to
- */
-void PcpParser::save(std::ostream* file)
+/**
+ * Saves the \a atoms into as a PCP file.
+ *
+ * \param file where to save the state
+ * \param atoms atoms to store
+ */
+void PcpParser::save(std::ostream* file, const std::vector<atom *> &atoms)
 {
   DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl);
@@ -379,6 +382,5 @@
   if (!file->fail()) {
     // calculate number of Psis
-    vector<atom *> allatoms = World::getInstance().getAllAtoms();
-    CalculateOrbitals(allatoms);
+    CalculateOrbitals(atoms);
     *file << "# ParallelCarParinello - main configuration file - created with molecuilder" << endl;
     *file << endl;
@@ -468,6 +470,6 @@
     *file << "RelativeCoord\t" << RelativeCoord << "\t# whether ion coordinates are relative (1) or absolute (0)" << endl;
     map<int, int> ZtoIndexMap;
-    OutputElements(file, allatoms, ZtoIndexMap);
-    OutputAtoms(file, allatoms, ZtoIndexMap);
+    OutputElements(file, atoms, ZtoIndexMap);
+    OutputAtoms(file, atoms, ZtoIndexMap);
   } else {
     DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file." << endl);
@@ -479,8 +481,8 @@
  * \param &allatoms all atoms to store away
  */
-void PcpParser::CalculateOrbitals(vector<atom *> &allatoms)
+void PcpParser::CalculateOrbitals(const std::vector<atom *> &allatoms)
 {
   PlaneWaveSpecifics.MaxPsiDouble = PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.PsiType = 0;
-  for (vector<atom *>::iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) {
+  for (vector<atom *>::const_iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) {
     PlaneWaveSpecifics.MaxPsiDouble += (*runner)->getType()->getNoValenceOrbitals();
   }
@@ -512,10 +514,10 @@
  * \param &ZtoIndexMap map of which atoms belong to which ion number
  */
-void PcpParser::OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
+void PcpParser::OutputElements(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
 {
   map<int, int> PresentElements;
   pair <   map<int, int>::iterator, bool > Inserter;
   // insert all found elements into the map
-  for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
+  for (vector<atom *>::const_iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
     Inserter = PresentElements.insert(pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1));
     if (!Inserter.second) // increase if present
@@ -542,5 +544,5 @@
  * \param &ZtoIndexMap map of which atoms belong to which ion number
  */
-void PcpParser::OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
+void PcpParser::OutputAtoms(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap)
 {
   *file << "#Ion_TypeNr._Nr.R[0]    R[1]    R[2]    MoveType (0 MoveIon, 1 FixedIon)" << endl;
@@ -548,5 +550,5 @@
   pair <   map<int, int>::iterator, bool > Inserter;
   int nr = 0;
-  for (vector<atom *>::iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
+  for (vector<atom *>::const_iterator AtomRunner = allatoms.begin();AtomRunner != allatoms.end();++AtomRunner) {
     Inserter = ZtoCountMap.insert( pair<int, int>((*AtomRunner)->getType()->getAtomicNumber(), 1) );
     if (!Inserter.second)
Index: src/Parser/PcpParser.hpp
===================================================================
--- src/Parser/PcpParser.hpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/PcpParser.hpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -20,5 +20,5 @@
   ~PcpParser();
   void load(std::istream* file);
-  void save(std::ostream* file);
+  void save(std::ostream* file, const std::vector<atom *> &atoms);
 
   bool operator==(const PcpParser& b) const;
@@ -27,7 +27,7 @@
 
   void ParseThermostats(class ConfigFileBuffer * const fb);
-  void OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);
-  void OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);
-  void CalculateOrbitals(vector<atom *> &allatoms);
+  void OutputAtoms(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);
+  void OutputElements(ostream *file, const std::vector<atom *> &allatoms, map<int, int> &ZtoIndexMap);
+  void CalculateOrbitals(const std::vector<atom *> &allatoms);
 
   class StructParallelization {
Index: src/Parser/PdbParser.cpp
===================================================================
--- src/Parser/PdbParser.cpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/PdbParser.cpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -145,9 +145,11 @@
 
 /**
- * Saves the World's current state into as a PDB file.
+ * Saves the \a atoms into as a PDB file.
  *
  * \param file where to save the state
- */
-void PdbParser::save(ostream* file) {
+ * \param atoms atoms to store
+ */
+void PdbParser::save(ostream* file, const std::vector<atom *> &AtomList)
+{
   DoLog(0) && (Log() << Verbose(0) << "Saving changes to pdb." << std::endl);
   {
@@ -168,12 +170,11 @@
   atomIdMap.clear();
   {
-    std::vector<atom *> AtomList = World::getInstance().getAllAtoms();
-    std::vector<molecule *> MolList = World::getInstance().getAllMolecules();
     std::map<size_t,size_t> MolIdMap;
     size_t MolNo = 1;  // residue number starts at 1 in pdb
-    for (std::vector<molecule *>::const_iterator iter = MolList.begin();
-        iter != MolList.end();
-        ++iter) {
-      MolIdMap[(*iter)->getId()] = MolNo++;
+    for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
+      const molecule *mol = (*atomIt)->getMolecule();
+      if ((mol != NULL) && (MolIdMap.find(mol->getId()) == MolIdMap.end())) {
+        MolIdMap[mol->getId()] = MolNo++;
+      }
     }
     const size_t MaxMol = MolNo;
@@ -188,5 +189,5 @@
     // write ATOMs
     int AtomNo = 1; // serial number starts at 1 in pdb
-    for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
+    for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
       PdbAtomInfoContainer &atomInfo = getadditionalAtomData(*atomIt);
       // gather info about residue
@@ -231,5 +232,5 @@
 
     // write CONECTs
-    for (vector<atom *>::iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
+    for (vector<atom *>::const_iterator atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
       writeNeighbors(file, 4, *atomIt);
     }
Index: src/Parser/PdbParser.hpp
===================================================================
--- src/Parser/PdbParser.hpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/PdbParser.hpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -23,5 +23,5 @@
   ~PdbParser();
   void load(std::istream* file);
-  void save(std::ostream* file);
+  void save(std::ostream* file, const std::vector<atom *> &atoms);
 
   bool operator==(const PdbParser& b) const;
Index: src/Parser/TremoloParser.cpp
===================================================================
--- src/Parser/TremoloParser.cpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/TremoloParser.cpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -117,12 +117,13 @@
 
 /**
- * Saves the World's current state into as a tremolo file.
+ * Saves the \a atoms into as a tremolo file.
  *
  * \param file where to save the state
- */
-void TremoloParser::save(ostream* file) {
+ * \param atoms atoms to store
+ */
+void TremoloParser::save(ostream* file, const std::vector<atom *> &AtomList) {
   DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl);
 
-  vector<atom*>::iterator atomIt;
+  vector<atom*>::const_iterator atomIt;
   vector<string>::iterator it;
 
@@ -132,5 +133,4 @@
   }
   *file << endl;
-  vector<atom *> AtomList = World::getInstance().getAllAtoms();
   for (atomIt = AtomList.begin(); atomIt != AtomList.end(); atomIt++) {
     saveLine(file, *atomIt);
Index: src/Parser/TremoloParser.hpp
===================================================================
--- src/Parser/TremoloParser.hpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/TremoloParser.hpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -26,5 +26,5 @@
   ~TremoloParser();
   void load(std::istream* file);
-  void save(std::ostream* file);
+  void save(std::ostream* file, const std::vector<atom *> &atoms);
   void setFieldsForSave(std::string atomDataLine);
 
Index: src/Parser/XyzParser.cpp
===================================================================
--- src/Parser/XyzParser.cpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/XyzParser.cpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -78,9 +78,10 @@
 
 /**
- * Saves the current state of the World into the given XYZ file.
+ * Saves the \a atoms into as a XYZ file.
  *
- * \param XYZ file
+ * \param file where to save the state
+ * \param atoms atoms to store
  */
-void XyzParser::save(ostream* file) {
+void XyzParser::save(ostream* file, const std::vector<atom *> &atoms) {
   DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl);
   //if (comment == "") {
@@ -95,8 +96,7 @@
       comment += time;
   //}
-  *file << World::getInstance().numAtoms() << endl << "\t" << comment << endl;
+  *file << atoms.size() << endl << "\t" << comment << endl;
 
-  vector<atom*> atoms = World::getInstance().getAllAtoms();
-  for(vector<atom*>::iterator it = atoms.begin(); it != atoms.end(); it++) {
+  for(vector<atom*>::const_iterator it = atoms.begin(); it != atoms.end(); it++) {
     *file << noshowpoint << (*it)->getType()->getSymbol() << "\t" << (*it)->at(0) << "\t" << (*it)->at(1) << "\t" << (*it)->at(2) << endl;
   }
Index: src/Parser/XyzParser.hpp
===================================================================
--- src/Parser/XyzParser.hpp	(revision 0bbfa1f442f20bde96b5119e3b620b99bc8c62d9)
+++ src/Parser/XyzParser.hpp	(revision fc5c3aecf61bf757b27c7c4f9060569db2b116c7)
@@ -20,5 +20,5 @@
   ~XyzParser();
   void load(std::istream* file);
-  void save(std::ostream* file);
+  void save(std::ostream* file, const std::vector<atom *> &atoms);
 
 private:
