Index: coeffs/numbers.cc
===================================================================
--- coeffs/numbers.cc	(revision bd6142c14705f6b8f27233e5ed1c2e662e4688a2)
+++ coeffs/numbers.cc	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
@@ -368,5 +368,5 @@
      n->nGetUnit = nrnGetUnit;
      n->nExtGcd = nrnExtGcd;
-     n->nName= ndName;
+     n->nName= nrnName;
 #ifdef LDEBUG
      n->nDBTest=nrnDBTest;
Index: coeffs/rmodulo2m.cc
===================================================================
--- coeffs/rmodulo2m.cc	(revision bd6142c14705f6b8f27233e5ed1c2e662e4688a2)
+++ coeffs/rmodulo2m.cc	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
@@ -8,17 +8,16 @@
 
 #include <string.h>
-#include <kernel/mod2.h>
+#include "config.h"
 
 #ifdef HAVE_RINGS
-#include <omalloc/mylimits.h>
-#include <kernel/structs.h>
-#include <kernel/febase.h>
-#include <omalloc/omalloc.h>
-#include <kernel/numbers.h>
-#include <kernel/longrat.h>
-#include <kernel/mpr_complex.h>
-#include <kernel/ring.h>
-#include <kernel/rmodulo2m.h>
-#include <kernel/si_gmp.h>
+#include <mylimits.h>
+#include "coeffs.h"
+#include "output.h"
+#include "omalloc.h"
+#include "numbers.h"
+#include "longrat.h"
+#include "mpr_complex.h"
+#include "rmodulo2m.h"
+#include "si_gmp.h"
 
 int nr2mExp;
@@ -644,2 +643,3 @@
 }
 #endif
+/* #ifdef HAVE_RINGS */
Index: coeffs/rmodulo2m.h
===================================================================
--- coeffs/rmodulo2m.h	(revision bd6142c14705f6b8f27233e5ed1c2e662e4688a2)
+++ coeffs/rmodulo2m.h	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
@@ -15,63 +15,61 @@
                                bit pattern '11..1' of length m */
 
-number  nr2mCopy        (number a);
-BOOLEAN nr2mGreaterZero (number k);
-number  nr2mMult        (number a, number b);
-number  nr2mInit        (int i, const ring r);
-int     nr2mInt         (number &n, const ring r);
-number  nr2mAdd         (number a, number b);
-number  nr2mSub         (number a, number b);
-void    nr2mPower       (number a, int i, number * result);
-BOOLEAN nr2mIsZero      (number a);
-BOOLEAN nr2mIsOne       (number a);
-BOOLEAN nr2mIsMOne      (number a);
-BOOLEAN nr2mIsUnit      (number a);
-number  nr2mGetUnit     (number a);
-number  nr2mDiv         (number a, number b);
-number  nr2mIntDiv      (number a,number b);
-number  nr2mMod         (number a,number b);
-number  nr2mNeg         (number c);
-number  nr2mInvers      (number c);
-BOOLEAN nr2mGreater     (number a, number b);
-BOOLEAN nr2mDivBy       (number a, number b);
-int     nr2mDivComp     (number a, number b);
-BOOLEAN nr2mEqual       (number a, number b);
-number  nr2mLcm         (number a,number b, ring r);
-number  nr2mGcd         (number a,number b,ring r);
-number  nr2mExtGcd      (number a, number b, number *s, number *t);
+number  nr2mCopy        (number a, const coeffs r);
+BOOLEAN nr2mGreaterZero (number k, const coeffs r);
+number  nr2mMult        (number a, number b, const coeffs r);
+number  nr2mInit        (int i, const coeffs r);
+int     nr2mInt         (number &n, const coeffs r);
+number  nr2mAdd         (number a, number b, const coeffs r);
+number  nr2mSub         (number a, number b, const coeffs r);
+void    nr2mPower       (number a, int i, number * result, const coeffs r);
+BOOLEAN nr2mIsZero      (number a, const coeffs r);
+BOOLEAN nr2mIsOne       (number a, const coeffs r);
+BOOLEAN nr2mIsMOne      (number a, const coeffs r);
+BOOLEAN nr2mIsUnit      (number a, const coeffs r);
+number  nr2mGetUnit     (number a, const coeffs r);
+number  nr2mDiv         (number a, number b, const coeffs r);
+number  nr2mIntDiv      (number a,number b, const coeffs r);
+number  nr2mMod         (number a,number b, const coeffs r);
+number  nr2mNeg         (number c, const coeffs r);
+number  nr2mInvers      (number c, const coeffs r);
+BOOLEAN nr2mGreater     (number a, number b, const coeffs r);
+BOOLEAN nr2mDivBy       (number a, number b, const coeffs r);
+int     nr2mDivComp     (number a, number b, const coeffs r);
+BOOLEAN nr2mEqual       (number a, number b, const coeffs r);
+number  nr2mLcm         (number a, number b, const coeffs r);
+number  nr2mGcd         (number a, number b, const coeffs r);
+number  nr2mExtGcd      (number a, number b, number *s, number *t, const coeffs r);
 nMapFunc nr2mSetMap     (const ring src, const ring dst);
-void    nr2mWrite       (number &a, const ring r);
-const char *  nr2mRead  (const char *s, number *a);
-char *  nr2mName        (number n);
+void    nr2mWrite       (number &a, const coeffs r);
+const char *  nr2mRead  (const char *s, number *a, const coeffs r);
+char *  nr2mName        (number n, const coeffs r);
 #ifdef LDEBUG
-BOOLEAN nr2mDBTest      (number a, const char *f, const int l);
+BOOLEAN nr2mDBTest      (number a, const char *f, const int l, const coeffs r);
 #endif
-void    nr2mSetExp(int c, const ring r);
-void    nr2mInitExp(int c, const ring r);
+void    nr2mSetExp(int c, const coeffs r);
+void    nr2mInitExp(int c, const coeffs r);
 
 
-static inline number nr2mMultM(number a, number b)
+static inline number nr2mMultM(number a, number b, const coeffs r)
 {
   return (number)
-    ((((NATNUMBER) a) * ((NATNUMBER) b)) & ((NATNUMBER) currRing->nr2mModul));
+    ((((NATNUMBER) a) * ((NATNUMBER) b)) & ((NATNUMBER) r->nr2mModul));
 }
 
-static inline number nr2mAddM(number a, number b)
+static inline number nr2mAddM(number a, number b, const coeffs r)
 {
   return (number)
-    ((((NATNUMBER) a) + ((NATNUMBER) b)) & ((NATNUMBER) currRing->nr2mModul));
+    ((((NATNUMBER) a) + ((NATNUMBER) b)) & ((NATNUMBER) r->nr2mModul));
 }
 
-static inline number nr2mSubM(number a, number b)
+static inline number nr2mSubM(number a, number b, const coeffs r)
 {
-  return (number)((NATNUMBER)a < (NATNUMBER)b ?
-                     currRing->nr2mModul - (NATNUMBER)b + (NATNUMBER)a + 1 :
-                     (NATNUMBER)a - (NATNUMBER)b);
+  return (number)((NATNUMBER)a<(NATNUMBER)b ?
+                       r->nr2mModul-(NATNUMBER)b+(NATNUMBER)a + 1: (NATNUMBER)a-(NATNUMBER)b);
 }
 
-#define nr2mNegM(A) (number)(currRing->nr2mModul - (NATNUMBER)(A) + 1)
+#define nr2mNegM(A,r) (number)(r->nr2mModul-(NATNUMBER)(A) + 1)
 #define nr2mEqualM(A,B)  ((A)==(B))
 
-number nr2mMapQ(number from);
 #endif
 #endif
Index: coeffs/rmodulon.cc
===================================================================
--- coeffs/rmodulon.cc	(revision bd6142c14705f6b8f27233e5ed1c2e662e4688a2)
+++ coeffs/rmodulon.cc	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
@@ -8,18 +8,18 @@
 
 #include <string.h>
-#include <kernel/mod2.h>
-#include <omalloc/mylimits.h>
-#include <kernel/structs.h>
-#include <kernel/febase.h>
-#include <omalloc/omalloc.h>
-#include <kernel/numbers.h>
-#include <kernel/longrat.h>
-#include <kernel/mpr_complex.h>
-#include <kernel/ring.h>
-#include <kernel/rmodulon.h>
-#include <kernel/si_gmp.h>
+#include "config.h"
 
 #ifdef HAVE_RINGS
-  extern omBin gmp_nrz_bin;
+#include <mylimits.h>
+#include "coeffs.h"
+#include "output.h"
+#include "omalloc.h"
+#include "numbers.h"
+#include "longrat.h"
+#include "mpr_complex.h"
+#include "rmodulon.h"
+#include "si_gmp.h"
+
+extern omBin gmp_nrz_bin;
 
 int_number nrnMinusOne = NULL;
@@ -570,2 +570,3 @@
 }
 #endif
+/* #ifdef HAVE_RINGS */
Index: coeffs/rmodulon.h
===================================================================
--- coeffs/rmodulon.h	(revision bd6142c14705f6b8f27233e5ed1c2e662e4688a2)
+++ coeffs/rmodulon.h	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
@@ -15,44 +15,41 @@
 #endif
 
-number  nrnCopy        (number a);
 number  cfrnCopy       (number a, const ring r);
-int     nrnSize        (number a);
+int     nrnSize        (number a, const ring r);
 void    nrnDelete      (number *a, const ring r);
-BOOLEAN nrnGreaterZero (number k);
-number  nrnMult        (number a, number b);
+BOOLEAN nrnGreaterZero (number k, const ring r);
+number  nrnMult        (number a, number b, const ring r);
 number  nrnInit        (int i, const ring r);
 int     nrnInt         (number &n, const ring r);
-number  nrnAdd         (number a, number b);
-number  nrnSub         (number a, number b);
-void    nrnPower       (number a, int i, number * result);
-BOOLEAN nrnIsZero      (number a);
-BOOLEAN nrnIsOne       (number a);
-BOOLEAN nrnIsMOne      (number a);
-BOOLEAN nrnIsUnit      (number a);
-number  nrnGetUnit     (number a);
-number  nrnDiv         (number a, number b);
-number  nrnMod         (number a,number b);
-number  nrnIntDiv      (number a,number b);
-number  nrnNeg         (number c);
-number  nrnInvers      (number c);
-BOOLEAN nrnGreater     (number a, number b);
-BOOLEAN nrnDivBy       (number a, number b);
-int     nrnDivComp     (number a, number b);
-BOOLEAN nrnEqual       (number a, number b);
-number  nrnLcm         (number a,number b, ring r);
-number  nrnGcd         (number a,number b,ring r);
-number  nrnExtGcd      (number a, number b, number *s, number *t);
+number  nrnAdd         (number a, number b, const ring r);
+number  nrnSub         (number a, number b, const ring r);
+void    nrnPower       (number a, int i, number * result, const ring r);
+BOOLEAN nrnIsZero      (number a, const ring r);
+BOOLEAN nrnIsOne       (number a, const ring r);
+BOOLEAN nrnIsMOne      (number a, const ring r);
+BOOLEAN nrnIsUnit      (number a, const ring r);
+number  nrnGetUnit     (number a, const ring r);
+number  nrnDiv         (number a, number b, const ring r);
+number  nrnMod         (number a,number b, const ring r);
+number  nrnIntDiv      (number a,number b, const ring r);
+number  nrnNeg         (number c, const ring r);
+number  nrnInvers      (number c, const ring r);
+BOOLEAN nrnGreater     (number a, number b, const ring r);
+BOOLEAN nrnDivBy       (number a, number b, const ring r);
+int     nrnDivComp     (number a, number b, const ring r);
+BOOLEAN nrnEqual       (number a, number b, const ring r);
+number  nrnLcm         (number a,number b, const ring r);
+number  nrnGcd         (number a,number b, const ring r);
+number  nrnExtGcd      (number a, number b, number *s, number *t, const ring r);
 nMapFunc nrnSetMap     (const ring src, const ring dst);
 #define  nrnWrite      nrzWrite
-const char *  nrnRead  (const char *s, number *a);
-char *  nrnName        (number n);
+const char *  nrnRead  (const char *s, number *a, const ring r);
+char *  nrnName        (number n, const ring r);
 #ifdef LDEBUG
-BOOLEAN nrnDBTest      (number a, const char *f, const int l);
+BOOLEAN nrnDBTest      (number a, const char *f, const int l, const ring r);
 #endif
-void    nrnSetExp(int c, ring r);
-void    nrnInitExp(int c, ring r);
+void    nrnSetExp(int c, const ring r);
+void    nrnInitExp(int c, const ring r);
 
-number nrnMapQ(number from);
-number nrnMapGMP(number from);
 #endif
 #endif
