diff --git a/TODO b/TODO
index 4a81d46292eb908680e2e99d3f5dca852a98b023..0f9d2f7879eb5474267db91c7e58daac8e9e3658 100644
--- a/TODO
+++ b/TODO
@@ -37,11 +37,11 @@ SEBASTIAN
  - history > file.txt
  - in calc mode: ni[0.1] should not exit calc mode
  - after "g\n": gxl is mixed up with gxf+/gxf-
+ - when oio is called with parameter, do not print list
 
 = vorrangig =
 
  - error bars # in manip und opr, oder ?
- - when oio is called with parameter, do not print list
  - what is dn?
  - plot errorbars on/off
  - set fit range
diff --git a/pub/src/calc.cpp b/pub/src/calc.cpp
index cb7a837544828e366e2c65fe300fec9bdd45efe2..0ba374a0339dd58e3d17aa2f85c9d183a551c576 100644
--- a/pub/src/calc.cpp
+++ b/pub/src/calc.cpp
@@ -14,7 +14,8 @@
 #include <readln.h>
 
 #include "mystd.h"
-#include "olm.h"
+#include "olf.h"
+#include "mem.h"
 #include "expr.h"
 #include "calc.h"
 
diff --git a/pub/src/curve.cpp b/pub/src/curve.cpp
index 3691cce5d6ac7dfea412f870585e6d31c4dab0b9..2178bb7bd87c8ed2b1b75f1f6fcc81d52d7bd900 100644
--- a/pub/src/curve.cpp
+++ b/pub/src/curve.cpp
@@ -20,20 +20,22 @@ using namespace std;
 using boost::format;
 
 #include "mystd.h"
-#include "olm.h"
+#include "olf.h"
+#include "mem.h"
 #include "curve.h"
 #include "expr.h"
 #include "xax_lex.h"
 
+
 //! local functions (wouldn't suffice "static" ??)
 
 namespace NCurveFile
 {
-    void IntegrateFile(
-        POlc fin, const int k, const string& mode,
-        const int ip, const string& name, const CCoord& ico );
+    void IntegralPropertyExec(
+        POlc fin, int k, const string& mode,
+        int ip, const string& name, const CCoord& ico );
     double NumericIntegral(
-        POlc fc, PCurve c, int k, int j, double low, double hig );
+        POlc fc, int k, int j, double low, double hig );
     // parameters for numeric integration:
     double numint_bound_low=-INFINITY, numint_bound_hig=INFINITY;
     // tuning parameters:
@@ -677,7 +679,7 @@ void NCurveFile::SetIntTuningPars( string which )
 
 //! Outer wrapper: dialog, loop over files and parameters
 
-void NCurveFile::IntegralProperty(void)
+void NCurveFile::IntegralProperty()
 {
     if( NRead::stack_empty() )
         cout << "Generate integral file:\n"
@@ -710,23 +712,23 @@ void NCurveFile::IntegralProperty(void)
             CList parsel( mode, 0, fin->nPar()-1 );
             for( uint iv=0; iv<parsel.size(); ++iv ){
                 int ip = parsel.V[iv];
-                IntegrateFile( fin, fiter.k(),
-                               "p", ip, "p"+strg(ip), fin->PCo[ip] );
+                IntegralPropertyExec(
+                    fin, fiter.k(), "p", ip, "p"+strg(ip), fin->PCo[ip] );
             }
-        } else // other integrals
-            IntegrateFile( fin, fiter.k(), mode, -1, mode,
-                           CCoord( "mode", "" ) );
+        } else { // other integrals
+            IntegralPropertyExec(
+                fin, fiter.k(), mode, -1, mode, CCoord( "mode", "" ) );
+        }
     }
 }
 
 
 //! Extract exactly one integral from each curve of fin.
 
-void NCurveFile::IntegrateFile( POlc fin, const int k,
-                                const string& mode, const int ip,
-                                const string& name, const CCoord& ico )
+void NCurveFile::IntegralPropertyExec(
+    POlc fin, int k, const string& mode, int ip,
+    const string& name, const CCoord& ico )
 {
-    throw string( "TODO broken after M rewrite" );
     POld fout( new COld );
     PSpec S( new CSpec );
 
@@ -734,8 +736,7 @@ void NCurveFile::IntegrateFile( POlc fin, const int k,
     bool savable = ( nz > 0 );
 
     if( savable ){
-        cerr << "TODO Integrate file should copy from fc to fd\n";
-        fout = POld( new COld() );
+        fout = POld( new COld( fin.get() ) );
         if( fout->name.substr(0,4)=="fit_" )
             fout->name.replace( 0, 4, "" );
         fout->name.insert( 0, name + "_" );
@@ -762,11 +763,8 @@ void NCurveFile::IntegrateFile( POlc fin, const int k,
         else if ( mode=="q2" )
             val = fin->VC(j)->Quality[2];
         else if ( mode=="i" )
-            throw string( "TODO integration disabled during M rewrite" );
-/*
-            val = NumericIntegral( fin, fin->VC(j), k, j,
+            val = NumericIntegral( fin, k, j,
                                    numint_bound_low, numint_bound_hig );
-*/
         else
             throw string("invalid mode");
 
@@ -798,7 +796,7 @@ void NCurveFile::IntegrateFile( POlc fin, const int k,
 //! Numeric integration of one curve.
 
 double NCurveFile::NumericIntegral(
-    POlc fc, PCurve c, int k, int j, double low, double hig )
+    POlc fc, int k, int j, double low, double hig )
 {
     EvalDatTyp data;
     data.fc = fc;
@@ -847,7 +845,6 @@ namespace NCurveFile
    - Obtain x = cum(ilow) + (cum(ihig)-cum(ilow))*(r-ilow/2^m).
 */
 
-/*
 void NCurveFile::CumulativeDistribution(void)
 {
     static int nb = 3;
@@ -862,16 +859,16 @@ void NCurveFile::CumulativeDistribution(void)
     NOlm::IterateC fiter;
     POlc fin;
     while( (fin=fiter()) ){
-        POld fPhi( new COld );
-        fPhi->name = "Phi_" + fin->name;
-        fPhi->xco = CCoord( "r", "" );
-        fPhi->yco = CCoord( "Phi^-1(r)", "" );
-        fPhi->ZCo = fin->ZCo;
-        fPhi->lDoc = fin->lDoc;
-        fPhi->lDoc.push_back( "cumulative distribution" );
+        POld fout( new COld );
+        fout->name = "Phi_" + fin->name;
+        fout->xco = CCoord( "r", "" );
+        fout->yco = CCoord( "Phi^-1(r)", "" );
+        fout->ZCo = fin->ZCo;
+        fout->lDoc = fin->lDoc;
+        fout->lDoc.push_back( "cumulative distribution" );
         
         for( uint j=0; j<fin->nJ(); j++ ){
-            const PCurve C = fin->VC(j);
+            PCurve C = fin->VC(j);
             PSpec S( new CSpec );
             S->z = C->z;
             S->x.resize( (1<<nb)+1 );
@@ -888,13 +885,13 @@ void NCurveFile::CumulativeDistribution(void)
             data.j = j;
             DivideInterval( S->y, 0, 1<<nb, data );
 
-            fPhi->V.push_back(S);
+            fout->V.push_back(S);
         }
 
-        NOlm::OloAdd( fPhi );
+        NOlm::OloAdd( fout );
     }
 }
-*/
+
 
 //! Calculate Phi^-1(r) by recursively dividing Phi-intervals.
 
@@ -902,15 +899,14 @@ void NCurveFile::CumulativeDistribution(void)
 #include <gsl/gsl_math.h>
 #include <gsl/gsl_roots.h>
 
-/*
 double IntervalDifference( double mid, void *data )
 {
     const CumDisDatTyp *mydata = (const CumDisDatTyp*) data;
     int j = mydata->j, k = mydata->k;
     POlc fc = mydata->fc;
-    return NCurveFile::NumericIntegral( fc, fc->VC(j), k, j,
+    return NCurveFile::NumericIntegral( fc, k, j,
                                         mydata->low, mid )
-        -  NCurveFile::NumericIntegral( fc, fc->VC(j), k, j,
+        -  NCurveFile::NumericIntegral( fc, k, j,
                                         mid, mydata->hig );
 }
 
@@ -958,4 +954,3 @@ void NCurveFile::DivideInterval(
     DivideInterval( Y, ilow, imid, data );
     DivideInterval( Y, imid, ihig, data );
 }
-*/
diff --git a/pub/src/edif.cpp b/pub/src/edif.cpp
index 49b98c34a23b9e62659e984b13c8dd7296bb35df..b92e385dd37079fc299d378c9d9e994c787c265b 100644
--- a/pub/src/edif.cpp
+++ b/pub/src/edif.cpp
@@ -15,7 +15,8 @@
 #include <ask_simple_value.h>
 
 #include "mystd.h"
-#include "olm.h"
+#include "olf.h"
+#include "mem.h"
 #include "expr.h" // only for EditCoord
 #include "edif.h"
 #include "index.h"
diff --git a/pub/src/expr.cpp b/pub/src/expr.cpp
index f1c702da3c46140970c682375708e68bcf171f85..0de1884bb2d0b142e8af34a091483f6d99f4efaf 100644
--- a/pub/src/expr.cpp
+++ b/pub/src/expr.cpp
@@ -14,7 +14,8 @@
 #include <readln.h>
 
 #include "mystd.h"
-#include "olm.h" // for cross-references
+#include "olf.h"
+#include "mem.h"
 #include "func.h"
 #include "expr.h"
 
diff --git a/pub/src/file_in.cpp b/pub/src/file_in.cpp
index 08cde24cc2ea4fc012a07314473d2a9f1425d6e0..62dd4bc9081c83333d7c7808cbbb92a714ba5178 100644
--- a/pub/src/file_in.cpp
+++ b/pub/src/file_in.cpp
@@ -6,16 +6,18 @@
 //**************************************************************************//
 
 #include <stdlib.h>
-#include <map>
+#include <string.h>
 #include <iostream>
 #include <fstream>
+#include <map>
 
-#include "mystd.h"
-#include "olm.h"
 #include <ask_simple_value.h>
-#include "file_in.h"
 #include <yaml-cpp.h>
-#include <string.h>
+
+#include "mystd.h"
+#include "olf.h"
+#include "mem.h"
+#include "file_in.h"
 
 using namespace std;
 
diff --git a/pub/src/file_out.cpp b/pub/src/file_out.cpp
index 9a3884f01fcf1c54ed4c244206efd2e080d2b7e0..382352cd07c91d45a53e2d8b9118fff7d7ef9787 100644
--- a/pub/src/file_out.cpp
+++ b/pub/src/file_out.cpp
@@ -7,12 +7,14 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <map>
 #include <iostream>
+#include <map>
 
-#include "mystd.h"
-#include "olm.h"
 #include <ask_simple_value.h>
+
+#include "mystd.h"
+#include "olf.h"
+#include "mem.h"
 #include "file_out.h"
 
 using namespace std;
diff --git a/pub/src/frida2.cpp b/pub/src/frida2.cpp
index eac4c73d20193ba0a2cc35f735838bc5107810b8..e3d6d03ad8951d5f311fb7042276294ec9cb2bb9 100644
--- a/pub/src/frida2.cpp
+++ b/pub/src/frida2.cpp
@@ -15,7 +15,8 @@
 #include <readln.h>
 
 #include "mystd.h"
-#include "olm.h"
+#include "olf.h"
+#include "mem.h"
 #include "calc.h"
 #include "dualplot.h"
 #include "opr.h"
@@ -190,10 +191,8 @@ int main()
             } else if (cmd == "cylg") {
                 NCurveFile::SetProperties("ylg");
 
-/* TODO
             } else if (cmd == "c_cd") {
                 NCurveFile::CumulativeDistribution();
-*/
 
             } else if (cmd.substr(0,2) == "cs") {
                 NCurveFile::SetFitTuningPars(cmd.substr(2));
@@ -280,10 +279,7 @@ int main()
             } else if (cmd == "fe2") {
                 NFileOut::Save( "tab" );
             } else if (cmd == "fc") {
-                cerr << "TODO: restore copy";
-/*
                 NOlm::OlfCopy();
-*/
             } else if (cmd == "fx") {
                 NOlm::OlfExchange();
             } else if (cmd == "fdel") {
diff --git a/pub/src/manip.cpp b/pub/src/manip.cpp
index 2d0f800749eb7a3d8b134b3c7ff4102790f257ea..d1bbf49693376dd6b090ef7eae638f7ef7504a5b 100644
--- a/pub/src/manip.cpp
+++ b/pub/src/manip.cpp
@@ -16,7 +16,8 @@
 #include <ask_simple_value.h>
 
 #include "mystd.h"
-#include "olm.h"
+#include "olf.h"
+#include "mem.h"
 #include "expr.h" // for sort, symmetrize
 #include "manip.h"
 #include "xax_lex.h"
diff --git a/pub/src/mem.cpp b/pub/src/mem.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b00afc41d66a0f74148413e6e4f5f23efdd1cb1a
--- /dev/null
+++ b/pub/src/mem.cpp
@@ -0,0 +1,150 @@
+//**************************************************************************//
+//* FRIDA: fast reliable interactive data analysis                         *//
+//* mem.cpp: online memory                                                 *//
+//* (C) Joachim Wuttke 1990-, v2(C++) 2001-                                *//
+//* http://frida.sourceforge.net                                           *//
+//**************************************************************************//
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <iostream>
+#include <algorithm>
+
+#include <ask_simple_value.h>
+
+using namespace std;
+
+#include "mystd.h"
+#include "olf.h"
+#include "mem.h"
+
+
+namespace NOlm { // on-line memory (in olm.h predefined as extern)
+    // the data:
+    vector<POlo> MOM;
+
+    // the current selection:
+    class CList FSel;
+    class CList FSelOld;
+    class CList FSelNew;
+    bool overwrite;
+};
+
+
+//! Receive new file selection.
+
+void NOlm::SelPush( CList& _FSel )
+{
+    FSelOld = FSel;
+    FSel = _FSel;
+}
+
+
+//! Go back to previous file selection.
+
+void NOlm::SelPop()
+{
+    FSel = FSelOld;
+    FSelOld = CList();
+}
+
+
+//! Assert that file selection is not empty.
+
+void NOlm::SelAssert()
+{
+    if( !FSel.size() )
+        throw string( "empty operand file list" );
+}
+
+
+//! Append copy of file *olo to online memory.
+
+void NOlm::OloAdd( POlo f, int k )
+{
+    f->as_on_disk = false;
+    if( overwrite && k!=-1 ){
+        // replace input file
+        if( k>=MOM.size() )
+            throw string( "BUG: inconsistent k in OlfAdd" );
+        MOM[k] = f;
+    } else {
+        // append at end of online memory
+        MOM.push_back( f );
+        FSelNew.append( MOM.size()-1 );
+    }
+}
+
+void NOlm::OloAdd( POld fd, int k ) { OloAdd( (POlo)fd, k ); }
+void NOlm::OloAdd( POlc fc, int k ) { OloAdd( (POlo)fc, k ); }
+
+
+//! Remove selected files from online memory.
+
+void NOlm::OlfDel()
+{
+    for (uint i = FSel.size()-1; i!=(uint)-1; --i) {
+        MOM.erase(MOM.begin()+FSel.V[i]);
+    }
+    SelPop();
+    SelPop();
+    if( MOM.size() > 0 )
+        FSel = CList(0,MOM.size()-1);
+    else
+        FSel = CList();
+}
+
+
+//! Append copy of selected files to online memory.
+
+void NOlm::OlfCopy()
+{
+    IterateO fiter;
+    POlo fin;
+    while ( (fin=fiter()) ){
+        POlo fout( fin->new_olo() );
+        // TODO copy z
+        OloAdd( fout );
+    }
+}
+
+
+//! Move files to end of online memory.
+
+void NOlm::OlfExchange()
+{
+    FSelOld = FSel;
+    FSel = CList();
+    vector<POlo> aux;
+    for (uint i = FSelOld.size()-1; i!=(uint)-1; --i) {
+        aux.push_back( MOM[FSelOld.V[i]] );
+        MOM.erase( MOM.begin()+FSelOld.V[i] );
+    }
+    for ( uint i=0; i<FSelOld.size(); ++i ){
+        MOM.push_back( aux[i] );
+        FSel.append( MOM.size()-1 );
+    }
+}
+
+
+//! Interactive spectrum selection.
+
+void NOlm::JSelAsk( string quest, string *jSel, CList *jLis )
+{
+    if ( FSel.size()<=0 )
+        throw string( "query spectrum selection: no files to operate on" );
+
+    IterateO fiter;
+    POlo f;
+    uint nJmax = 0;
+    while ( (f=fiter()) )
+        nJmax = max( nJmax, f->nJ() );
+
+    if ( nJmax==1 )
+        *jLis = CList("0");
+    else {
+        *jSel = wask( quest, *jSel );
+        *jLis = CList ( *jSel, 0, nJmax-1 );
+    }
+}
+
diff --git a/pub/src/mem.h b/pub/src/mem.h
new file mode 100644
index 0000000000000000000000000000000000000000..73491967567f3f3679ca68abe472ae174c3ef776
--- /dev/null
+++ b/pub/src/mem.h
@@ -0,0 +1,62 @@
+//! The online memory.
+
+namespace NOlm {
+    // the data:
+    extern vector<POlo> MOM; // the mother of all on-line data
+
+    // the current selection:
+    extern CList FSel;
+    extern CList FSelOld;
+    extern CList FSelNew;
+    extern bool overwrite;
+
+    // modify selection or/and data:
+    void SelPush( CList& _FSel );
+    void SelPop();
+    void SelAssert();
+    void OloAdd( POlo olo, int k=-1 );
+    void OloAdd( POld old, int k=-1 );
+    void OloAdd( POlc olc, int k=-1 );
+    void OlfDel();
+    void OlfExchange();
+    void OlfCopy();
+
+    // spectrum selection:
+    void JSelAsk( string quest, string *jSel, CList *JSel );
+
+    class IterateBase { // iterator over FSel (virtual base)
+    protected:
+        uint iV;
+        CList Sel;
+    public:
+        IterateBase() { Sel = FSel; reset(); };
+        void reset() { iV = 0; };
+        void choose_all() { Sel = CList(0,MOM.size()-1); };
+        uint k() const { return Sel.V[iV-1]; }
+        uint iteration() const { return iV-1; }
+        uint size() const { return Sel.V.size(); }
+    };
+    class IterateO : public IterateBase { // all types
+    public:
+        POlo operator()() {
+            if (iV>=Sel.size()) return POlo();
+            return MOM[Sel.V[iV++]];
+        };
+    };
+    class IterateD : public IterateBase { // must be data file
+    public:
+        POld operator()() {
+            POld e;
+            while ( iV<Sel.size() && !(e = P2D( MOM[Sel.V[iV++]] )) ) {};
+            return e;
+        };
+    };
+    class IterateC : public IterateBase { // must be curve file
+    public:
+        POlc operator()() {
+            POlc e;
+            while ( iV<Sel.size() && !(e = P2C( MOM[Sel.V[iV++]] )) ) {};
+            return e;
+        };
+    };
+};
diff --git a/pub/src/olf.cpp b/pub/src/olf.cpp
index ccce9ad09ea0f9133aafaaad8c7cd37be154fef8..f646d8285402f9115860c8b97db72327268b7a12 100644
--- a/pub/src/olf.cpp
+++ b/pub/src/olf.cpp
@@ -1,6 +1,6 @@
 //**************************************************************************//
 //* FRIDA: fast reliable interactive data analysis                         *//
-//* olm.cpp: online memory                                                 *//
+//* olf.cpp: online files                                                  *//
 //* (C) Joachim Wuttke 1990-, v2(C++) 2001-                                *//
 //* http://frida.sourceforge.net                                           *//
 //**************************************************************************//
@@ -9,11 +9,13 @@
 #include <stdio.h>
 #include <iostream>
 #include <algorithm>
+
+#include <ask_simple_value.h>
+
 using namespace std;
 
 #include "mystd.h"
-#include "olm.h"
-#include <ask_simple_value.h>
+#include "olf.h"
 
 //***************************************************************************//
 //* class COld                                                              *//
@@ -62,156 +64,3 @@ boost::shared_ptr<class COlo> COlc::new_olo() const
     ret->V.clear();
     return ret;
 }
-
-//***************************************************************************//
-//* namespace NOlm                                                          *//
-//***************************************************************************//
-
-namespace NOlm { // on-line memory (in olm.h predefined as extern)
-    // the data:
-    vector<POlo> MOM;
-
-    // the current selection:
-    class CList FSel;
-    class CList FSelOld;
-    class CList FSelNew;
-    bool overwrite;
-};
-
-
-//***************************************************************************//
-//* NOlm: basic administration of online memory                             *//
-//***************************************************************************//
-
-
-//! Receive new file selection.
-
-void NOlm::SelPush( CList& _FSel )
-{
-    FSelOld = FSel;
-    FSel = _FSel;
-}
-
-//! Go back to previous file selection.
-
-void NOlm::SelPop()
-{
-    FSel = FSelOld;
-    FSelOld = CList();
-}
-
-//! Assert that file selection is not empty.
-
-void NOlm::SelAssert()
-{
-    if( !FSel.size() )
-        throw string( "empty operand file list" );
-}
-
-//! Append copy of file *olo to online memory.
-
-void NOlm::OloAdd( POlo f, int k )
-{
-    f->as_on_disk = false;
-    if( overwrite && k!=-1 ){
-        // replace input file
-        if( k>=MOM.size() )
-            throw string( "BUG: inconsistent k in OlfAdd" );
-        MOM[k] = f;
-    } else {
-        // append at end of online memory
-        MOM.push_back( f );
-        FSelNew.append( MOM.size()-1 );
-    }
-}
-
-void NOlm::OloAdd( POld fd, int k ) { OloAdd( (POlo)fd, k ); }
-void NOlm::OloAdd( POlc fc, int k ) { OloAdd( (POlo)fc, k ); }
-
-//! Remove selected files from online memory.
-
-void NOlm::OlfDel()
-{
-    for (uint i = FSel.size()-1; i!=(uint)-1; --i) {
-        MOM.erase(MOM.begin()+FSel.V[i]);
-    }
-    SelPop();
-    SelPop();
-    if( MOM.size() > 0 )
-        FSel = CList(0,MOM.size()-1);
-    else
-        FSel = CList();
-}
-
-//! Append copy of selected files to online memory.
-
-void NOlm::OlfCopy()
-{
-    IterateO iter;
-    POlo f;
-    while ((f=iter()))
-        OloAdd( f );
-}
-
-//! Move files to end of online memory.
-
-void NOlm::OlfExchange()
-{
-    FSelOld = FSel;
-    FSel = CList();
-    vector<POlo> aux;
-    IterateO iter;
-    POlo f;
-    for (uint i = FSelOld.size()-1; i!=(uint)-1; --i) {
-        aux.push_back( MOM[FSelOld.V[i]] );
-        MOM.erase( MOM.begin()+FSelOld.V[i] );
-    }
-    for ( uint i=0; i<FSelOld.size(); ++i ){
-        MOM.push_back( aux[i] );
-        FSel.append( MOM.size()-1 );
-    }
-}
-
-//! For each file in selection, set fno, fin, fout, and call exec(...).
-
-/* TODO
-void NOlm::OlfLoop(void(*exec)(int fno, COld *fin, COld *fout))
-{
-    IterateD fiter;
-    COld *fin, ftmp, *fout;
-    int fno;
-    while((fin=fiter())) {
-        fno = fiter.SelNo();
-        cout << "-> operate on file " << fno << "\n";
-        OUT_TO_IN( overwrite, fin, ftmp, fout );
-
-        exec(fno, fin, fout);
-
-        if(!(overwrite)) OloAdd( ftmp );
-    }
-}
-    */
-
-
-//***************************************************************************//
-//* NOlm: spectrum selection                                                    *//
-//***************************************************************************//
-
-void NOlm::JSelAsk( string quest, string *jSel, CList *jLis )
-{
-    if ( FSel.size()<=0 )
-        throw string( "query spectrum selection: no files to operate on" );
-
-    IterateO iter;
-    POlo f;
-    uint nJmax = 0;
-    while ( (f=iter()) )
-        nJmax = max( nJmax, f->nJ() );
-
-    if ( nJmax==1 )
-        *jLis = CList("0");
-    else {
-        *jSel = wask( quest, *jSel );
-        *jLis = CList ( *jSel, 0, nJmax-1 );
-    }
-}
diff --git a/pub/src/olf.h b/pub/src/olf.h
index 2756a65a79fcf4c28e900f2367b3aac199668532..f95e1723bb1eb513bd28630380a2b070736625bd 100644
--- a/pub/src/olf.h
+++ b/pub/src/olf.h
@@ -43,7 +43,7 @@ class COlo {
 class COld : public COlo {
  public:
     COld() {};
-    COld( class COlc const* c );
+    COld( class COlc const* fc );
 
     PSpec VS( uint j ) const {
         PSpec p = boost::dynamic_pointer_cast<CSpec>( V[j] );
@@ -66,7 +66,7 @@ class COld : public COlo {
 
 //! Online curve file.
 
-class COlc : public COlo { 
+class COlc : public COlo {
  public:
     // basic records (offline and online):
     string expr;
@@ -108,80 +108,3 @@ typedef boost::shared_ptr<COlc> POlc;
 
 #define P2D(p) boost::dynamic_pointer_cast<COld>(p)
 #define P2C(p) boost::dynamic_pointer_cast<COlc>(p)
-
-
-//! The online memory.
-
-namespace NOlm {
-    // the data:
-    extern vector<POlo> MOM; // the mother of all on-line data
-
-    // the current selection:
-    extern CList FSel;
-    extern CList FSelOld;
-    extern CList FSelNew;
-    extern bool overwrite;
-
-    // modify selection or/and data:
-    void SelPush( CList& _FSel );
-    void SelPop();
-    void SelAssert();
-    void OloAdd( POlo olo, int k=-1 );
-    void OloAdd( POld old, int k=-1 );
-    void OloAdd( POlc olc, int k=-1 );
-    void OlfDel();
-    void OlfExchange();
-    void OlfCopy();
-
-    // spectrum selection:
-    void JSelAsk( string quest, string *jSel, CList *JSel );
-
-    class Iterate { // iterator over FSel (virtual base)
-    protected:
-        uint iV;
-        CList Sel;
-    public:
-        Iterate() { Sel = FSel; reset(); };
-        void reset() { iV = 0; };
-        void choose_all() { Sel = CList(0,MOM.size()-1); };
-        uint k() const { return Sel.V[iV-1]; }
-        uint iteration() const { return iV-1; }
-        uint size() const { return Sel.V.size(); }
-    };
-    class IterateO : public Iterate { // all types
-    public:
-        POlo operator()() {
-            if (iV>=Sel.size()) return POlo();
-            return MOM[Sel.V[iV++]];
-        };
-    };
-    class IterateD : public Iterate { // must be data file
-    public:
-        POld operator()() {
-            POld e;
-            while ( iV<Sel.size() && !(e = P2D( MOM[Sel.V[iV++]] )) ) {};
-            return e;
-        };
-    };
-    class IterateC : public Iterate { // must be curve file
-    public:
-        POlc operator()() {
-            POlc e;
-            while ( iV<Sel.size() && !(e = P2C( MOM[Sel.V[iV++]] )) ) {};
-            return e;
-        };
-    };
-};
-
-
-//! Chunks of frequently used code.
-
-/*
-#define OUT_TO_IN( overwrite, fin, ftmp, fout ) \
-    if (overwrite) {                            \
-        fout = fin;                             \
-    } else {                                    \
-        ftmp = *fin;                            \
-        fout = &ftmp;                           \
-    }
-*/
diff --git a/pub/src/opr.cpp b/pub/src/opr.cpp
index 0e76ec5bf7fee3db3876373ee320874b6f53eed8..16a2a00a47599af48cde452c94b0a8925e1162d4 100644
--- a/pub/src/opr.cpp
+++ b/pub/src/opr.cpp
@@ -12,12 +12,14 @@
 #include <boost/format.hpp>
 
 #include <ask_simple_value.h>
+#include <readln.h>
 
 using boost::format;
 using namespace std;
 
 #include "mystd.h"
-#include "olm.h"
+#include "olf.h"
+#include "mem.h"
 #include "expr.h"
 #include "opr.h"
 #include "xax_lex.h"
@@ -829,17 +831,18 @@ void NIntOld::Opr()
 {
     NOlm::SelAssert();
 
-    printf("integral properties:\n"
-           "   1:                     2: one y\n"
-           "   3: <y> average         4: stddev in y\n"
-           "   5: x(max y)            6: y(max y)\n"
-           "   7: x(min y)            8: y(min y)\n"
-           "   9: sum                10: integral\n"
-           "  11: x(int<arg)\n"
-           "  13: max x(y>0)\n"
-           "  15: center of gravity  16: stddev in x\n"
-           "  17: correl.coeff (x<->y)\n"
-        );
+    if( NRead::stack_empty() )
+        cout <<
+            "integral properties:\n"
+            "   1:                     2: one y\n"
+            "   3: <y> average         4: stddev in y\n"
+            "   5: x(max y)            6: y(max y)\n"
+            "   7: x(min y)            8: y(min y)\n"
+            "   9: sum                10: integral\n"
+            "  11: x(int<arg)\n"
+            "  13: max x(y>0)\n"
+            "  15: center of gravity  16: stddev in x\n"
+            "  17: correl.coeff (x<->y)\n";
     mod = iask("Choice", mod );
 	
     if        (mod== 0) {
diff --git a/pub/src/plot.cpp b/pub/src/plot.cpp
index 97c8e5120815778bd6518cf5787581f10b60d5af..e6a823c85c0d95cdb19d7b7a775b17405c7caae2 100644
--- a/pub/src/plot.cpp
+++ b/pub/src/plot.cpp
@@ -9,16 +9,17 @@
 #include <math.h>
 #include <iostream>
 #include <algorithm>
+#include <boost/format.hpp>
 
 #include <ask_simple_value.h>
 
 #include "mystd.h"
-#include "olm.h"
+#include "olf.h"
+#include "mem.h"
 #include "expr.h"
 #include "dualplot.h"
 #include "plot.h"
 
-#include <boost/format.hpp>
 using boost::format;
 
 namespace NPlot {
diff --git a/pub/src/rssm.cpp b/pub/src/rssm.cpp
index 0ce3ff90e2c44b635765e13dd709d19a4159164e..d7de2c98a12fad0ee75af5fc23eb4770f57f1d52 100644
--- a/pub/src/rssm.cpp
+++ b/pub/src/rssm.cpp
@@ -7,16 +7,18 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <time.h>
 #include <iostream>
 #include <fstream>
 
-#include "mystd.h"
-#include "olm.h"
+#include <yaml-cpp.h>
 #include <ask_simple_value.h>
+
+#include "mystd.h"
+#include "olf.h"
+#include "mem.h"
 #include "rssm.h"
-#include <yaml-cpp.h>
-#include <string.h>
 
 using namespace std;
 
diff --git a/pub/src/special2.cpp b/pub/src/special2.cpp
index 8d4a631b351d4545cf9c2ee0706ebb49fb798b07..91aac3822bbc0f89c4dcf43c5d159849872e15f5 100644
--- a/pub/src/special2.cpp
+++ b/pub/src/special2.cpp
@@ -5,10 +5,12 @@
 #include <string>
 #include <vector>
 
+#include <ask_simple_value.h>
+
 using namespace std;
 
-#include "olm.h"
-#include <ask_simple_value.h>
+#include "olf.h"
+#include "mem.h"
 #include "special.h"
 
 namespace NSpecial {