Index: src/menu.cpp
===================================================================
--- src/menu.cpp	(revision 7c6f7347a55d7eaa5d6e2a0da8b6a11252f4dff5)
+++ src/menu.cpp	(revision 096214873dde5e791e08ce2990d335c95d4d57fb)
@@ -29,4 +29,5 @@
 #include "Menu/SeperatorItem.hpp"
 #include "Menu/DisplayMenuItem.hpp"
+#include "Menu/SubMenuItem.hpp"
 #include "Actions/MethodAction.hpp"
 #include "Views/StreamStringView.hpp"
@@ -986,95 +987,4 @@
 };
 
-
-/** Submenu for creating new molecules.
- * \param *periode periodentafel
- * \param *molecules list of molecules to add to
- */
-void oldmenu::EditMolecules(periodentafel *periode, MoleculeListClass *molecules)
-{
-  TextMenu *edit_molecules_menu = new TextMenu(Log() << Verbose(0), "Edit Molecules");
-
-  Action *createMoleculeAction = new MethodAction(boost::bind(&oldmenu::createNewMolecule,this,periode,molecules));
-  new ActionMenuItem('c',"create new molecule",edit_molecules_menu,createMoleculeAction);
-
-  Action *loadMoleculeAction = new MethodAction(boost::bind(&oldmenu::loadFromXYZ,this,periode,molecules));
-  new ActionMenuItem('l',"load molecule from xyz file",edit_molecules_menu,loadMoleculeAction);
-
-  Action *changeFilenameAction = new MethodAction(boost::bind(&oldmenu::changeName,this,molecules));
-  new ActionMenuItem('n',"change molecule's name",edit_molecules_menu,changeFilenameAction);
-
-  Action *giveFilenameAction = new MethodAction(boost::bind(&oldmenu::setMoleculeFilename,this,molecules));
-  new ActionMenuItem('N',"give molecules filename",edit_molecules_menu,giveFilenameAction);
-
-  Action *parseAtomsAction = new MethodAction(boost::bind(&oldmenu::parseXYZIntoMolecule,this,molecules));
-  new ActionMenuItem('p',"parse atoms in xyz file into molecule",edit_molecules_menu,parseAtomsAction);
-
-  Action *eraseMoleculeAction = new MethodAction(boost::bind(&oldmenu::eraseMolecule,this,molecules));
-  new ActionMenuItem('r',"remove a molecule",edit_molecules_menu,eraseMoleculeAction);
-
-  Action *returnAction = new MethodAction(boost::bind(&TextMenu::doQuit,edit_molecules_menu));
-  MenuItem *returnItem = new ActionMenuItem('q',"return to Main menu",edit_molecules_menu,returnAction);
-
-  edit_molecules_menu->addDefault(returnItem);
-
-
-  edit_molecules_menu->display();
-
-  delete edit_molecules_menu;
-  delete createMoleculeAction;
-  delete loadMoleculeAction;
-  delete changeFilenameAction;
-  delete giveFilenameAction;
-  delete parseAtomsAction;
-  delete eraseMoleculeAction;
-  delete returnAction;
-
-#if 0
-  char choice;  // menu choice char
-
-  Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl;
-  Log() << Verbose(0) << "c - create new molecule" << endl;
-  Log() << Verbose(0) << "l - load molecule from xyz file" << endl;
-  Log() << Verbose(0) << "n - change molecule's name" << endl;
-  Log() << Verbose(0) << "N - give molecules filename" << endl;
-  Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl;
-  Log() << Verbose(0) << "r - remove a molecule" << endl;
-  Log() << Verbose(0) << "all else - go back" << endl;
-  Log() << Verbose(0) << "===============================================" << endl;
-  Log() << Verbose(0) << "INPUT: ";
-  cin >> choice;
-
-  switch (choice) {
-    default:
-      Log() << Verbose(0) << "Not a valid choice." << endl;
-      break;
-    case 'c':
-        createNewMolecule(periode,molecules);
-      break;
-
-    case 'l': // load from XYZ file
-      loadFromXYZ(periode,molecules);
-      break;
-
-    case 'n':
-      changeName(molecules);
-      break;
-
-    case 'N':
-      setMoleculeFilename(molecules);
-      break;
-
-    case 'p': // parse XYZ file
-      parseXYZIntoMolecule(molecules);
-      break;
-
-    case 'r':
-      eraseMolecule(molecules);
-      break;
-  }
-#endif
-};
-
-
 /** Submenu for merging molecules.
  * \param *periode periodentafel
@@ -1301,6 +1211,6 @@
   new ActionMenuItem('a',"set molecule (in)active",main_menu,setMoleculeAction);
 
-  Action *editMoleculeAction = new MethodAction(boost::bind(&oldmenu::EditMolecules,this,periode, molecules));
-  new ActionMenuItem('e',"edit molecules (load, parse, save)",main_menu,editMoleculeAction);
+  TextMenu *edit_molecules_menu = new TextMenu(Log() << Verbose(0), "Edit Molecules");
+  new SubMenuItem('e',"edit molecules (load, parse, save)",main_menu,edit_molecules_menu);
 
   Action *manipulateMoleculeAction = new MethodAction(boost::bind(&oldmenu::ManipulateMolecules,this,periode, molecules, configuration));
@@ -1329,12 +1239,39 @@
   new ActionMenuItem('q',"quit",main_menu,quitAction);
 
+  // build the EditMoleculesMenu
+  Action *createMoleculeAction = new MethodAction(boost::bind(&oldmenu::createNewMolecule,this,periode,molecules));
+  new ActionMenuItem('c',"create new molecule",edit_molecules_menu,createMoleculeAction);
+
+  Action *loadMoleculeAction = new MethodAction(boost::bind(&oldmenu::loadFromXYZ,this,periode,molecules));
+  new ActionMenuItem('l',"load molecule from xyz file",edit_molecules_menu,loadMoleculeAction);
+
+  Action *changeFilenameAction = new MethodAction(boost::bind(&oldmenu::changeName,this,molecules));
+  new ActionMenuItem('n',"change molecule's name",edit_molecules_menu,changeFilenameAction);
+
+  Action *giveFilenameAction = new MethodAction(boost::bind(&oldmenu::setMoleculeFilename,this,molecules));
+  new ActionMenuItem('N',"give molecules filename",edit_molecules_menu,giveFilenameAction);
+
+  Action *parseAtomsAction = new MethodAction(boost::bind(&oldmenu::parseXYZIntoMolecule,this,molecules));
+  new ActionMenuItem('p',"parse atoms in xyz file into molecule",edit_molecules_menu,parseAtomsAction);
+
+  Action *eraseMoleculeAction = new MethodAction(boost::bind(&oldmenu::eraseMolecule,this,molecules));
+  new ActionMenuItem('r',"remove a molecule",edit_molecules_menu,eraseMoleculeAction);
+
+  Action *returnAction = new MethodAction(boost::bind(&TextMenu::doQuit,edit_molecules_menu));
+  MenuItem *returnItem = new ActionMenuItem('q',"return to Main menu",edit_molecules_menu,returnAction);
+
+  edit_molecules_menu->addDefault(returnItem);
 
   main_menu->display();
 
 
+  delete main_menu;
+
+  // delete all actions and views contained in Menu
+  // TODO: find a better way to handle this
+
   delete moleculeView;
 
   delete setMoleculeAction;
-  delete editMoleculeAction;
   delete manipulateMoleculeAction;
   delete mergeMoleculeAction;
@@ -1345,5 +1282,11 @@
   delete quitAction;
 
-  delete main_menu;
+  delete createMoleculeAction;
+  delete loadMoleculeAction;
+  delete changeFilenameAction;
+  delete giveFilenameAction;
+  delete parseAtomsAction;
+  delete eraseMoleculeAction;
+  delete returnAction;
 };
 
Index: src/menu.hpp
===================================================================
--- src/menu.hpp	(revision 7c6f7347a55d7eaa5d6e2a0da8b6a11252f4dff5)
+++ src/menu.hpp	(revision 096214873dde5e791e08ce2990d335c95d4d57fb)
@@ -38,5 +38,4 @@
   void AlignAtoms(periodentafel *, molecule *);
   void CenterAtoms(molecule *);
-  void EditMolecules(periodentafel *, MoleculeListClass *);
   void FragmentAtoms(molecule *, config *);
   void ManipulateAtoms(periodentafel *, MoleculeListClass *, config *);
