Index: coeffs/numbers.cc
===================================================================
--- coeffs/numbers.cc	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
+++ coeffs/numbers.cc	(revision 14b11bba0b33b67ddc0e94233db4a7517190715e)
@@ -80,5 +80,5 @@
 
 number ndCopy(number a) { return a; }
-number nd_Copy(number a,const coeffs r) { return r->cfCopy(a,r); }
+number nd_Copy(number a,const coeffs r) { return r->nCopy(a); }
 
 #ifdef HAVE_RINGS
@@ -295,81 +295,10 @@
   else if (nField_is_Ring_2toM(r))
   {
-     nr2mInitExp(c,r);
-     n->cfInit = nr2mInit;
-     //n->nCopy  = nr2mCopy;
-     n->n_Int  = nr2mInt;
-     n->nAdd   = nr2mAdd;
-     n->nSub   = nr2mSub;
-     n->nMult  = nr2mMult;
-     n->nDiv   = nr2mDiv;
-     n->nIntDiv       = nr2mIntDiv;
-     n->nIntMod=nr2mMod;
-     n->nExactDiv= nr2mDiv;
-     n->nNeg   = nr2mNeg;
-     n->nInvers= nr2mInvers;
-     n->nDivBy = nr2mDivBy;
-     n->nDivComp = nr2mDivComp;
-     n->nGreater = nr2mGreater;
-     n->nEqual = nr2mEqual;
-     n->nIsZero = nr2mIsZero;
-     n->nIsOne = nr2mIsOne;
-     n->nIsMOne = nr2mIsMOne;
-     n->nGreaterZero = nr2mGreaterZero;
-     n->cfWrite = nr2mWrite;
-     n->nRead = nr2mRead;
-     n->nPower = nr2mPower;
-     n->cfSetMap = nr2mSetMap;
-     n->nNormalize = nDummy2;
-     n->nLcm          = nr2mLcm;
-     n->nGcd          = nr2mGcd;
-     n->nIsUnit = nr2mIsUnit;
-     n->nGetUnit = nr2mGetUnit;
-     n->nExtGcd = nr2mExtGcd;
-     n->nName= ndName;
-#ifdef LDEBUG
-     n->nDBTest=nr2mDBTest;
-#endif
+    nr2mCoeffInit(n, c, r->cf);
   }
   /* -------------- Z/n ----------------------- */
-  else if (nField_is_Ring_ModN(r) || nField_is_Ring_PtoM(r)
-  )
-  {
-     nrnInitExp(c,r);
-     n->cfInit  = nrnInit;
-     n->cfDelete= nrnDelete;
-     n->cfCopy = cfrnCopy;
-     n->nSize  = nrnSize;
-     n->n_Int  = nrnInt;
-     n->nAdd   = nrnAdd;
-     n->nSub   = nrnSub;
-     n->nMult  = nrnMult;
-     n->nDiv   = nrnDiv;
-     n->nIntDiv= nrnIntDiv;
-     n->nIntMod= nrnMod;
-     n->nExactDiv= nrnDiv;
-     n->nNeg   = nrnNeg;
-     n->nInvers= nrnInvers;
-     n->nDivBy = nrnDivBy;
-     n->nDivComp = nrnDivComp;
-     n->nGreater = nrnGreater;
-     n->nEqual = nrnEqual;
-     n->nIsZero = nrnIsZero;
-     n->nIsOne = nrnIsOne;
-     n->nIsMOne = nrnIsMOne;
-     n->nGreaterZero = nrnGreaterZero;
-     n->cfWrite = nrnWrite;
-     n->nRead = nrnRead;
-     n->nPower = nrnPower;
-     n->cfSetMap = nrnSetMap;
-     n->nNormalize = nDummy2;
-     n->nLcm          = nrnLcm;
-     n->nGcd          = nrnGcd;
-     n->nIsUnit = nrnIsUnit;
-     n->nGetUnit = nrnGetUnit;
-     n->nExtGcd = nrnExtGcd;
-     n->nName= nrnName;
-#ifdef LDEBUG
-     n->nDBTest=nrnDBTest;
-#endif
+  else if (nField_is_Ring_ModN(r) || nField_is_Ring_PtoM(r))
+  {
+    nrnCoeffInit(n, c, r->cf);
   }
   /* -------------- Z ----------------------- */
@@ -378,4 +307,5 @@
      n->cfInit  = nrzInit;
      n->cfDelete= nrzDelete;
+     n->nCopy  = nrzCopy;
      n->cfCopy = cfrzCopy;
      n->nSize  = nrzSize;
@@ -430,5 +360,5 @@
     n->nNeg   = nlNeg;
     n->nInvers= nlInvers;
-    //n->nCopy  = nlCopy;
+    n->nCopy  = nlCopy;
     n->nGreater = nlGreater;
     n->nEqual = nlEqual;
@@ -463,5 +393,5 @@
     n->nNeg   = npNeg;
     n->nInvers= npInvers;
-    //n->nCopy  = ndCopy;
+    n->nCopy  = ndCopy;
     n->nGreater = npGreater;
     n->nEqual = npEqual;
@@ -506,5 +436,5 @@
     n->nNeg   = nfNeg;
     n->nInvers= nfInvers;
-    //n->nCopy  = ndCopy;
+    n->nCopy  = ndCopy;
     n->nGreater = nfGreater;
     n->nEqual = nfEqual;
@@ -536,5 +466,5 @@
     n->nNeg   = nrNeg;
     n->nInvers= nrInvers;
-    //n->nCopy  = ndCopy;
+    n->nCopy  = ndCopy;
     n->nGreater = nrGreater;
     n->nEqual = nrEqual;
@@ -566,5 +496,5 @@
     n->nNeg   = ngfNeg;
     n->nInvers= ngfInvers;
-    //n->nCopy  = ngfCopy;
+    n->nCopy  = ngfCopy;
     n->nGreater = ngfGreater;
     n->nEqual = ngfEqual;
@@ -597,5 +527,5 @@
     n->nNeg   = ngcNeg;
     n->nInvers= ngcInvers;
-    //n->nCopy  = ngcCopy;
+    n->nCopy  = ngcCopy;
     n->nGreater = ngcGreater;
     n->nEqual = ngcEqual;
@@ -623,5 +553,5 @@
 #endif
 #ifdef HAVE_RINGS
-  if (n->nGetUnit==(nMapFunc)NULL) n->nGetUnit=n->cfCopy;
+  if (n->nGetUnit==(nMapFunc)NULL) n->nGetUnit=n->nCopy;
 #endif
   if (!errorreported)
Index: coeffs/rmodulo2m.cc
===================================================================
--- coeffs/rmodulo2m.cc	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
+++ coeffs/rmodulo2m.cc	(revision 14b11bba0b33b67ddc0e94233db4a7517190715e)
@@ -23,8 +23,48 @@
 int nr2mExp;
 
+/* for initializing function pointers */
+void nr2mCoeffInit (n_Procs_s *n, int c, const coeffs r)
+{
+     nr2mInitExp(c, r);
+     n->cfInit  = nr2mInit;
+     n->cfCopy = nr2mCopy;
+     n->n_Int  = nr2mInt;
+     n->nAdd   = nr2mAdd;
+     n->nSub   = nr2mSub;
+     n->nMult  = nr2mMult;
+     n->nDiv   = nr2mDiv;
+     n->nIntDiv       = nr2mIntDiv;
+     n->nIntMod=nr2mMod;
+     n->nExactDiv= nr2mDiv;
+     n->nNeg   = nr2mNeg;
+     n->nInvers= nr2mInvers;
+     n->nDivBy = nr2mDivBy;
+     n->nDivComp = nr2mDivComp;
+     n->nGreater = nr2mGreater;
+     n->nEqual = nr2mEqual;
+     n->nIsZero = nr2mIsZero;
+     n->nIsOne = nr2mIsOne;
+     n->nIsMOne = nr2mIsMOne;
+     n->nGreaterZero = nr2mGreaterZero;
+     n->cfWrite = nr2mWrite;
+     n->nRead = nr2mRead;
+     n->nPower = nr2mPower;
+     n->cfSetMap = nr2mSetMap;
+     n->nNormalize = nDummy2;
+     n->nLcm          = nr2mLcm;
+     n->nGcd          = nr2mGcd;
+     n->nIsUnit = nr2mIsUnit;
+     n->nGetUnit = nr2mGetUnit;
+     n->nExtGcd = nr2mExtGcd;
+     n->nName= ndName;
+#ifdef LDEBUG
+     n->nDBTest=nr2mDBTest;
+#endif
+}
+
 /*
  * Multiply two numbers
  */
-number nr2mMult (number a, number b)
+number nr2mMult (number a, number b, const coeffs r)
 {
   if (((NATNUMBER)a == 0) || ((NATNUMBER)b == 0))
@@ -37,5 +77,5 @@
  * Give the smallest non unit k, such that a * x = k = b * y has a solution
  */
-number nr2mLcm (number a,number b,ring r)
+number nr2mLcm (number a, number b, const coeffs r)
 {
   NATNUMBER res = 0;
@@ -60,5 +100,5 @@
  * a solution.
  */
-number nr2mGcd (number a,number b,ring r)
+number nr2mGcd (number a, number b, const coeffs r)
 {
   NATNUMBER res = 0;
@@ -84,5 +124,5 @@
  * a solution.
  */
-number nr2mExtGcd (number a, number b, number *s, number *t)
+number nr2mExtGcd (number a, number b, number *s, number *t, const coeffs r)
 {
   NATNUMBER res = 0;
@@ -108,5 +148,5 @@
 }
 
-void nr2mPower (number a, int i, number * result)
+void nr2mPower (number a, int i, number * result, const coeffs r)
 {
   if (i==0)
@@ -128,5 +168,5 @@
  * create a number from int
  */
-number nr2mInit (int i, const ring r)
+number nr2mInit (int i, const coeffs r)
 {
   if (i == 0) return (number)(NATNUMBER)i;
@@ -134,7 +174,7 @@
   long ii = i;
   NATNUMBER j = (NATNUMBER)1;
-  if (ii < 0) { j = currRing->nr2mModul; ii = -ii; }
+  if (ii < 0) { j = r->nr2mModul; ii = -ii; }
   NATNUMBER k = (NATNUMBER)ii;
-  k = k & currRing->nr2mModul;
+  k = k & r->nr2mModul;
   /* now we have: from = j * k mod 2^m */
   return (number)nr2mMult((number)j, (number)k);
@@ -147,5 +187,5 @@
  * automatically casted to int
  */
-int nr2mInt(number &n, const ring r)
+int nr2mInt(number &n, const coeffs r)
 {
   NATNUMBER nn = (unsigned long)(NATNUMBER)n & r->nr2mModul;
@@ -157,20 +197,20 @@
 }
 
-number nr2mAdd (number a, number b)
+number nr2mAdd (number a, number b, const coeffs r)
 {
   return nr2mAddM(a,b);
 }
 
-number nr2mSub (number a, number b)
+number nr2mSub (number a, number b, const coeffs r)
 {
   return nr2mSubM(a,b);
 }
 
-BOOLEAN nr2mIsUnit (number a)
+BOOLEAN nr2mIsUnit (number a, const coeffs r)
 {
   return ((NATNUMBER) a % 2 == 1);
 }
 
-number  nr2mGetUnit (number k)
+number  nr2mGetUnit (number k, const coeffs r)
 {
   if (k == NULL)
@@ -182,25 +222,26 @@
 }
 
-BOOLEAN nr2mIsZero (number  a)
+BOOLEAN nr2mIsZero (number a, const coeffs r)
 {
   return 0 == (NATNUMBER)a;
 }
 
-BOOLEAN nr2mIsOne (number a)
+BOOLEAN nr2mIsOne (number a, const coeffs r)
 {
   return 1 == (NATNUMBER)a;
 }
 
-BOOLEAN nr2mIsMOne (number a)
-{
-  return (currRing->nr2mModul == (NATNUMBER)a);
-}
-
-BOOLEAN nr2mEqual (number a, number b)
+BOOLEAN nr2mIsMOne (number a, const coeffs r)
+{
+  return (r->nr2mModul  == (NATNUMBER)a) 
+        && (r->nr2mModul != 2);
+}
+
+BOOLEAN nr2mEqual (number a, number b, const coeffs r)
 {
   return nr2mEqualM(a,b);
 }
 
-BOOLEAN nr2mGreater (number a, number b)
+BOOLEAN nr2mGreater (number a, number b, const coeffs r)
 {
   return nr2mDivBy(a, b);
@@ -211,9 +252,9 @@
    2) a, b <> 0; then TRUE iff b/gcd(a, b) is a unit mod 2^m
    TRUE iff b(gcd(a, b) is a unit */
-BOOLEAN nr2mDivBy (number a, number b)
+BOOLEAN nr2mDivBy (number a, number b, const coeffs r)
 {
   if (a == NULL)
   {
-    NATNUMBER c = currRing->nr2mModul + 1;
+    NATNUMBER c = r->nr2mModul + 1;
     if (c != 0) /* i.e., if no overflow */
       return (c % (NATNUMBER)b) == 0;
@@ -233,11 +274,11 @@
   else
   {
-    number n = nr2mGcd(a, b, currRing);
-    n = nr2mDiv(b, n);
-    return nr2mIsUnit(n);
-  }
-}
-
-int nr2mDivComp(number as, number bs)
+    number n = nr2mGcd(a, b, r);
+    n = nr2mDiv(b, n, r);
+    return nr2mIsUnit(n, r);
+  }
+}
+
+int nr2mDivComp(number as, number bs, const coeffs r)
 {
   NATNUMBER a = (NATNUMBER) as;
@@ -267,8 +308,8 @@
 
 /* TRUE iff 0 < k <= 2^m / 2 */
-BOOLEAN nr2mGreaterZero (number k)
+BOOLEAN nr2mGreaterZero (number k, const coeffs r)
 {
   if ((NATNUMBER)k == 0) return FALSE;
-  if ((NATNUMBER)k > ((currRing->nr2mModul >> 1) + 1)) return FALSE;
+  if ((NATNUMBER)k > ((r->nr2mModul >> 1) + 1)) return FALSE;
   return TRUE;
 }
@@ -278,5 +319,5 @@
    and 't' such that a * s + 2^m * t = gcd(a, 2^m) = 1;
    this code will always find a positive 's' */
-void specialXGCD(unsigned long& s, unsigned long a)
+void specialXGCD(unsigned long& s, unsigned long a, const coeffs R)
 {
   int_number u = (int_number)omAlloc(sizeof(mpz_t));
@@ -289,5 +330,5 @@
   mpz_init(u2);
   int_number v = (int_number)omAlloc(sizeof(mpz_t));
-  mpz_init_set_ui(v, currRing->nr2mModul);
+  mpz_init_set_ui(v, R->nr2mModul);
   mpz_add_ui(v, v, 1); /* now: v = 2^m */
   int_number v0 = (int_number)omAlloc(sizeof(mpz_t));
@@ -319,5 +360,5 @@
   {
     /* we add 2^m = (2^m - 1) + 1 to u1: */
-    mpz_add_ui(u1, u1, currRing->nr2mModul);
+    mpz_add_ui(u1, u1, R->nr2mModul);
     mpz_add_ui(u1, u1, 1);
   }
@@ -336,14 +377,14 @@
 }
 
-NATNUMBER InvMod(NATNUMBER a)
+NATNUMBER InvMod(NATNUMBER a, const coeffs r)
 {
   assume((NATNUMBER)a % 2 != 0);
   unsigned long s;
-  specialXGCD(s, a);
+  specialXGCD(s, a, r);
   return s;
 }
 //#endif
 
-inline number nr2mInversM (number c)
+inline number nr2mInversM (number c, const coeffs r)
 {
   assume((NATNUMBER)c % 2 != 0);
@@ -351,5 +392,5 @@
 }
 
-number nr2mDiv (number a,number b)
+number nr2mDiv (number a, number b, const coeffs r)
 {
   if ((NATNUMBER)a==0)
@@ -375,5 +416,5 @@
 }
 
-number nr2mMod (number a, number b)
+number nr2mMod (number a, number b, const coeffs R)
 {
   /*
@@ -403,5 +444,5 @@
   if (b_div < 0) b_div = -b_div; // b_div now represents |b|
   NATNUMBER r = 0;
-  while ((g < currRing->nr2mModul) && (b_div > 0) && (b_div % 2 == 0))
+  while ((g < R->nr2mModul ) && (b_div > 0) && (b_div % 2 == 0))
   {
     b_div = b_div >> 1;
@@ -413,5 +454,5 @@
 }
 
-number nr2mIntDiv (number a, number b)
+number nr2mIntDiv (number a, number b, const coeffs r)
 {
   if ((NATNUMBER)a == 0)
@@ -421,5 +462,5 @@
     if ((NATNUMBER)b == 1)
       return (number)0;
-    NATNUMBER c = currRing->nr2mModul + 1;
+    NATNUMBER c = r->nr2mModul + 1;
     if (c != 0) /* i.e., if no overflow */
       return (number)(c / (NATNUMBER)b);
@@ -428,5 +469,5 @@
       /* overflow: c = 2^32 resp. 2^64, depending on platform */
       int_number cc = (int_number)omAlloc(sizeof(mpz_t));
-      mpz_init_set_ui(cc, currRing->nr2mModul); mpz_add_ui(cc, cc, 1);
+      mpz_init_set_ui(cc, r->nr2mModul); mpz_add_ui(cc, cc, 1);
       mpz_div_ui(cc, cc, (unsigned long)(NATNUMBER)b);
       unsigned long s = mpz_get_ui(cc);
@@ -443,5 +484,5 @@
 }
 
-number  nr2mInvers (number c)
+number  nr2mInvers (number c, const coeffs r)
 {
   if ((NATNUMBER)c%2==0)
@@ -453,5 +494,5 @@
 }
 
-number nr2mNeg (number c)
+number nr2mNeg (number c, const coeffs r)
 {
   if ((NATNUMBER)c==0) return c;
@@ -459,57 +500,57 @@
 }
 
-number nr2mMapMachineInt(number from)
-{
-  NATNUMBER i = ((NATNUMBER) from) & currRing->nr2mModul;
+number nr2mMapMachineInt(number from, const coeffs r)
+{
+  NATNUMBER i = ((NATNUMBER) from) % r->nr2mModul ;
   return (number) i;
 }
 
-number nr2mCopy(number a)
+number nr2mCopy(number a, const coeffs)
 {
   return a;
 }
 
-number nr2mMapZp(number from)
+number nr2mMapZp(number from, const coeffs r)
 {
   long ii = (long)from;
   NATNUMBER j = (NATNUMBER)1;
-  if (ii < 0) { j = currRing->nr2mModul; ii = -ii; }
+  if (ii < 0) { j = r->nr2mModul; ii = -ii; }
   NATNUMBER i = (NATNUMBER)ii;
-  i = i & currRing->nr2mModul;
+  i = i & r->nr2mModul;
   /* now we have: from = j * i mod 2^m */
   return (number)nr2mMult((number)i, (number)j);
 }
 
-number nr2mMapQ(number from)
+number nr2mMapQ(number from, const coeffs r)
 {
   int_number erg = (int_number) omAlloc(sizeof(mpz_t));
   mpz_init(erg);
   int_number k = (int_number) omAlloc(sizeof(mpz_t));
-  mpz_init_set_ui(k, currRing->nr2mModul);
+  mpz_init_set_ui(k, r->nr2mModul);
 
   nlGMP(from, (number)erg);
   mpz_and(erg, erg, k);
-  number r = (number)mpz_get_ui(erg);
+  number res = (number)mpz_get_ui(erg);
 
   mpz_clear(erg); omFree((ADDRESS)erg);
   mpz_clear(k);   omFree((ADDRESS)k);
 
-  return (number) r;
-}
-
-number nr2mMapGMP(number from)
+  return (number) res;
+}
+
+number nr2mMapGMP(number from, const coeffs r)
 {
   int_number erg = (int_number) omAlloc(sizeof(mpz_t));
   mpz_init(erg);
   int_number k = (int_number) omAlloc(sizeof(mpz_t));
-  mpz_init_set_ui(k, currRing->nr2mModul);
+  mpz_init_set_ui(k, r->nr2mModul);
 
   mpz_and(erg, (int_number)from, k);
-  number r = (number) mpz_get_ui(erg);
+  number res = (number) mpz_get_ui(erg);
 
   mpz_clear(erg); omFree((ADDRESS)erg);
   mpz_clear(k);   omFree((ADDRESS)k);
 
-  return (number) r;
+  return (number) res;
 }
 
@@ -568,5 +609,5 @@
  */
 
-void nr2mSetExp(int m, const ring r)
+void nr2mSetExp(int m, const coeffs r)
 {
   if (m > 1)
@@ -585,5 +626,5 @@
 }
 
-void nr2mInitExp(int m, const ring r)
+void nr2mInitExp(int m, const coeffs r)
 {
   nr2mSetExp(m, r);
@@ -592,13 +633,13 @@
 
 #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)
 {
   if ((NATNUMBER)a < 0) return FALSE;
-  if (((NATNUMBER)a & currRing->nr2mModul) != (NATNUMBER)a) return FALSE;
+  if (((NATNUMBER)a & r->nr2mModul) != (NATNUMBER)a) return FALSE;
   return TRUE;
 }
 #endif
 
-void nr2mWrite (number &a, const ring r)
+void nr2mWrite (number &a, const coeffs r)
 {
   int i = nr2mInt(a, r);
@@ -606,5 +647,5 @@
 }
 
-static const char* nr2mEati(const char *s, int *i)
+static const char* nr2mEati(const char *s, int *i, const coeffs r)
 {
 
@@ -616,8 +657,8 @@
       (*i) *= 10;
       (*i) += *s++ - '0';
-      if ((*i) >= (MAX_INT_VAL / 10)) (*i) = (*i) & currRing->nr2mModul;
+      if ((*i) >= (MAX_INT_VAL / 10)) (*i) = (*i) & r->nr2mModul;
     }
     while (((*s) >= '0') && ((*s) <= '9'));
-    (*i) = (*i) & currRing->nr2mModul;
+    (*i) = (*i) & r->nr2mModul;
   }
   else (*i) = 1;
@@ -625,5 +666,5 @@
 }
 
-const char * nr2mRead (const char *s, number *a)
+const char * nr2mRead (const char *s, number *a, const coeffs r)
 {
   int z;
Index: coeffs/rmodulo2m.h
===================================================================
--- coeffs/rmodulo2m.h	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
+++ coeffs/rmodulo2m.h	(revision 14b11bba0b33b67ddc0e94233db4a7517190715e)
@@ -14,4 +14,7 @@
 extern NATNUMBER nr2mModul; /* for storing 2^m - 1, i.e., the
                                bit pattern '11..1' of length m */
+
+/* next method is for initializing function pointers */
+void    nr2mCoeffInit   (n_Procs_s *n, int c, const coeffs r);
 
 number  nr2mCopy        (number a, const coeffs r);
Index: coeffs/rmodulon.cc
===================================================================
--- coeffs/rmodulon.cc	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
+++ coeffs/rmodulon.cc	(revision 14b11bba0b33b67ddc0e94233db4a7517190715e)
@@ -26,8 +26,50 @@
 unsigned long nrnExponent = 0;
 
+/* for initializing function pointers */
+void nrnCoeffInit (n_Procs_s *n, int c, const coeffs r)
+{
+     nrnInitExp(c, r);
+     n->cfInit  = nrnInit;
+     n->cfDelete= nrnDelete;
+     n->cfCopy = nrnCopy;
+     n->nSize  = nrnSize;
+     n->n_Int  = nrnInt;
+     n->nAdd   = nrnAdd;
+     n->nSub   = nrnSub;
+     n->nMult  = nrnMult;
+     n->nDiv   = nrnDiv;
+     n->nIntDiv= nrnIntDiv;
+     n->nIntMod= nrnMod;
+     n->nExactDiv= nrnDiv;
+     n->nNeg   = nrnNeg;
+     n->nInvers= nrnInvers;
+     n->nDivBy = nrnDivBy;
+     n->nDivComp = nrnDivComp;
+     n->nGreater = nrnGreater;
+     n->nEqual = nrnEqual;
+     n->nIsZero = nrnIsZero;
+     n->nIsOne = nrnIsOne;
+     n->nIsMOne = nrnIsMOne;
+     n->nGreaterZero = nrnGreaterZero;
+     n->cfWrite = nrnWrite;
+     n->nRead = nrnRead;
+     n->nPower = nrnPower;
+     n->cfSetMap = nrnSetMap;
+     n->nNormalize = nDummy2;
+     n->nLcm          = nrnLcm;
+     n->nGcd          = nrnGcd;
+     n->nIsUnit = nrnIsUnit;
+     n->nGetUnit = nrnGetUnit;
+     n->nExtGcd = nrnExtGcd;
+     n->nName= nrnName;
+#ifdef LDEBUG
+     n->nDBTest=nrnDBTest;
+#endif
+}
+
 /*
  * create a number from int
  */
-number nrnInit (int i, const ring r)
+number nrnInit (int i, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
@@ -37,5 +79,5 @@
 }
 
-void nrnDelete(number *a, const ring r)
+void nrnDelete(number *a, const coeffs r)
 {
   if (*a == NULL) return;
@@ -45,5 +87,5 @@
 }
 
-number nrnCopy(number a)
+number nrnCopy(number a, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
@@ -52,10 +94,5 @@
 }
 
-number cfrnCopy(number a, const ring r)
-{
-  return nrnCopy(a);
-}
-
-int nrnSize(number a)
+int nrnSize(number a, const coeffs r)
 {
   if (a == NULL) return 0;
@@ -66,5 +103,5 @@
  * convert a number to int
  */
-int nrnInt(number &n, const ring r)
+int nrnInt(number &n, const coeffs r)
 {
   return (int) mpz_get_si( (int_number) n);
@@ -74,51 +111,51 @@
  * Multiply two numbers
  */
-number nrnMult (number a, number b)
+number nrnMult (number a, number b, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
   mpz_init(erg);
   mpz_mul(erg, (int_number) a, (int_number) b);
-  mpz_mod(erg, erg, currRing->nrnModul);
-  return (number) erg;
-}
-
-void nrnPower (number a, int i, number * result)
-{
-  int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
-  mpz_init(erg);
-  mpz_powm_ui(erg, (int_number) a, i, currRing->nrnModul);
+  mpz_mod(erg, erg, r->nrnModul);
+  return (number) erg;
+}
+
+void nrnPower (number a, int i, number * result, const coeffs r)
+{
+  int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
+  mpz_init(erg);
+  mpz_powm_ui(erg, (int_number) a, i, r->nrnModul);
   *result = (number) erg;
 }
 
-number nrnAdd (number a, number b)
+number nrnAdd (number a, number b, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
   mpz_init(erg);
   mpz_add(erg, (int_number) a, (int_number) b);
-  mpz_mod(erg, erg, currRing->nrnModul);
-  return (number) erg;
-}
-
-number nrnSub (number a, number b)
+  mpz_mod(erg, erg, r->nrnModul);
+  return (number) erg;
+}
+
+number nrnSub (number a, number b, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
   mpz_init(erg);
   mpz_sub(erg, (int_number) a, (int_number) b);
-  mpz_mod(erg, erg, currRing->nrnModul);
-  return (number) erg;
-}
-
-number nrnNeg (number c)
+  mpz_mod(erg, erg, r->nrnModul);
+  return (number) erg;
+}
+
+number nrnNeg (number c, const coeffs r)
 {
 // nNeg inplace !!!
-  mpz_sub((int_number) c, currRing->nrnModul, (int_number) c);
+  mpz_sub((int_number) c, r->nrnModul, (int_number) c);
   return c;
 }
 
-number  nrnInvers (number c)
-{
-  int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
-  mpz_init(erg);
-  mpz_invert(erg, (int_number) c, currRing->nrnModul);
+number  nrnInvers (number c, const coeffs r)
+{
+  int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
+  mpz_init(erg);
+  mpz_invert(erg, (int_number) c, r->nrnModul);
   return (number) erg;
 }
@@ -128,5 +165,5 @@
  * TODO: lcm(gcd,gcd) besser als gcd(lcm) ?
  */
-number nrnLcm (number a,number b,ring r)
+number nrnLcm (number a, number b, const coeffs r)
 {
   number erg = nrnGcd(NULL, a, r);
@@ -141,5 +178,5 @@
  * a solution.
  */
-number nrnGcd (number a,number b,ring r)
+number nrnGcd (number a, number b, const coeffs r)
 {
   if ((a == NULL) && (b == NULL)) return nrnInit(0,r);
@@ -170,5 +207,5 @@
  * a solution and r, s, s.t. k = s*a + t*b
  */
-number  nrnExtGcd (number a, number b, number *s, number *t)
+number  nrnExtGcd (number a, number b, number *s, number *t, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
@@ -179,6 +216,6 @@
   mpz_init(bt);
   mpz_gcdext(erg, bs, bt, (int_number) a, (int_number) b);
-  mpz_mod(bs, bs, currRing->nrnModul);
-  mpz_mod(bt, bt, currRing->nrnModul);
+  mpz_mod(bs, bs, r->nrnModul);
+  mpz_mod(bt, bt, r->nrnModul);
   *s = (number) bs;
   *t = (number) bt;
@@ -186,5 +223,5 @@
 }
 
-BOOLEAN nrnIsZero (number  a)
+BOOLEAN nrnIsZero (number a, const coeffs r)
 {
 #ifdef LDEBUG
@@ -194,5 +231,5 @@
 }
 
-BOOLEAN nrnIsOne (number a)
+BOOLEAN nrnIsOne (number a, const coeffs r)
 {
 #ifdef LDEBUG
@@ -202,5 +239,5 @@
 }
 
-BOOLEAN nrnIsMOne (number a)
+BOOLEAN nrnIsMOne (number a, const coeffs r)
 {
 #ifdef LDEBUG
@@ -210,22 +247,22 @@
 }
 
-BOOLEAN nrnEqual (number a,number b)
+BOOLEAN nrnEqual (number a, number b, const coeffs r)
 {
   return 0 == mpz_cmp((int_number) a, (int_number) b);
 }
 
-BOOLEAN nrnGreater (number a,number b)
+BOOLEAN nrnGreater (number a, number b, const coeffs r)
 {
   return 0 < mpz_cmp((int_number) a, (int_number) b);
 }
 
-BOOLEAN nrnGreaterZero (number k)
+BOOLEAN nrnGreaterZero (number k, const coeffs r)
 {
   return 0 < mpz_cmp_si((int_number) k, 0);
 }
 
-BOOLEAN nrnIsUnit (number a)
-{
-  number tmp = nrnGcd(a, (number) currRing->nrnModul, currRing);
+BOOLEAN nrnIsUnit (number a, const coeffs r)
+{
+  number tmp = nrnGcd(a, (number) r->nrnModul, r);
   bool res = nrnIsOne(tmp);
   nrnDelete(&tmp, NULL);
@@ -233,11 +270,11 @@
 }
 
-number  nrnGetUnit (number k)
-{
-  if (mpz_divisible_p(currRing->nrnModul, (int_number) k)) return nrnInit(1,currRing);
-
-  int_number unit = (int_number) nrnGcd(k, 0, currRing);
+number  nrnGetUnit (number k, const coeffs r)
+{
+  if (mpz_divisible_p(r->nrnModul, (int_number) k)) return nrnInit(1,r);
+
+  int_number unit = (int_number) nrnGcd(k, 0, r);
   mpz_tdiv_q(unit, (int_number) k, unit);
-  int_number gcd = (int_number) nrnGcd((number) unit, 0, currRing);
+  int_number gcd = (int_number) nrnGcd((number) unit, 0, r);
   if (!nrnIsOne((number) gcd))
   {
@@ -246,5 +283,5 @@
     int_number tmp = (int_number) nrnMult((number) unit,(number) unit);
     // gcd_new := gcd(tmp, 0)
-    int_number gcd_new = (int_number) nrnGcd((number) tmp, 0, currRing);
+    int_number gcd_new = (int_number) nrnGcd((number) tmp, 0, r);
     while (!nrnEqual((number) gcd_new,(number) gcd))
     {
@@ -255,12 +292,12 @@
       // tmp := tmp * unit
       mpz_mul(tmp, tmp, unit);
-      mpz_mod(tmp, tmp, currRing->nrnModul);
+      mpz_mod(tmp, tmp, r->nrnModul);
       // gcd_new := gcd(tmp, 0)
-      mpz_gcd(gcd_new, tmp, currRing->nrnModul);
+      mpz_gcd(gcd_new, tmp, r->nrnModul);
     }
     // unit := unit + nrnModul / gcd_new
-    mpz_tdiv_q(tmp, currRing->nrnModul, gcd_new);
+    mpz_tdiv_q(tmp, r->nrnModul, gcd_new);
     mpz_add(unit, unit, tmp);
-    mpz_mod(unit, unit, currRing->nrnModul);
+    mpz_mod(unit, unit, r->nrnModul);
     nrnDelete((number*) &gcd_new, NULL);
     nrnDelete((number*) &tmp, NULL);
@@ -270,13 +307,13 @@
 }
 
-BOOLEAN nrnDivBy (number a, number b)
+BOOLEAN nrnDivBy (number a, number b, const coeffs r)
 {
   if (a == NULL)
-    return mpz_divisible_p(currRing->nrnModul, (int_number)b);
+    return mpz_divisible_p(r->nrnModul, (int_number) b);
   else
   { /* b divides a iff b/gcd(a, b) is a unit in the given ring: */
-    number n = nrnGcd(a, b, currRing);
+    number n = nrnGcd(a, b, r);
     mpz_tdiv_q((int_number)n, (int_number)b, (int_number)n);
-    bool result = nrnIsUnit(n);
+    bool result = nrnIsUnit(n, r);
     nrnDelete(&n, NULL);
     return result;
@@ -284,5 +321,5 @@
 }
 
-int nrnDivComp(number a, number b)
+int nrnDivComp(number a, number b, const coeffs r)
 {
   if (nrnEqual(a, b)) return 2;
@@ -292,7 +329,7 @@
 }
 
-number nrnDiv (number a,number b)
-{
-  if (a == NULL) a = (number) currRing->nrnModul;
+number nrnDiv (number a, number b, const coeffs r)
+{
+  if (a == NULL) a = (number) r->nrnModul;
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
   mpz_init(erg);
@@ -304,5 +341,5 @@
   else
   {
-    int_number gcd = (int_number) nrnGcd(a, b, currRing);
+    int_number gcd = (int_number) nrnGcd(a, b, r);
     mpz_divexact(erg, (int_number) b, gcd);
     if (!nrnIsUnit((number) erg))
@@ -320,10 +357,10 @@
     nrnDelete((number*) &gcd, NULL);
     nrnDelete((number*) &tmp, NULL);
-    mpz_mod(erg, erg, currRing->nrnModul);
+    mpz_mod(erg, erg, r->nrnModul);
     return (number) erg;
   }
 }
 
-number nrnMod (number a, number b)
+number nrnMod (number a, number b, const coeffs r)
 {
   /*
@@ -350,5 +387,5 @@
   mpz_init(g);
   mpz_init_set_si(r,(long)0);
-  mpz_gcd(g, (int_number) currRing->nrnModul, (int_number)b); // g is now as above
+  mpz_gcd(g, (int_number) r->nrnModul, (int_number)b); // g is now as above
   if (mpz_cmp_si(g, (long)1) != 0) mpz_mod(r, (int_number)a, g); // the case g <> 1
   mpz_clear(g);
@@ -357,9 +394,9 @@
 }
 
-number nrnIntDiv (number a,number b)
-{
-  int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
-  mpz_init(erg);
-  if (a == NULL) a = (number) currRing->nrnModul;
+number nrnIntDiv (number a, number b, const coeffs r)
+{
+  int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
+  mpz_init(erg);
+  if (a == NULL) a = (number) r->nrnModul;
   mpz_tdiv_q(erg, (int_number) a, (int_number) b);
   return (number) erg;
@@ -372,41 +409,41 @@
 int_number nrnMapCoef = NULL;
 
-number nrnMapModN(number from)
+number nrnMapModN(number from, const coeffs r)
 {
   return nrnMult(from, (number) nrnMapCoef);
 }
 
-number nrnMap2toM(number from)
+number nrnMap2toM(number from, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
   mpz_init(erg);
   mpz_mul_ui(erg, nrnMapCoef, (NATNUMBER) from);
-  mpz_mod(erg, erg, currRing->nrnModul);
-  return (number) erg;
-}
-
-number nrnMapZp(number from)
+  mpz_mod(erg, erg, r->nrnModul);
+  return (number) erg;
+}
+
+number nrnMapZp(number from, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
   mpz_init(erg);
   mpz_mul_si(erg, nrnMapCoef, (NATNUMBER) from);
-  mpz_mod(erg, erg, currRing->nrnModul);
-  return (number) erg;
-}
-
-number nrnMapGMP(number from)
-{
-  int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
-  mpz_init(erg);
-  mpz_mod(erg, (int_number) from, currRing->nrnModul);
-  return (number) erg;
-}
-
-number nrnMapQ(number from)
+  mpz_mod(erg, erg, r->nrnModul);
+  return (number) erg;
+}
+
+number nrnMapGMP(number from, const coeffs r)
+{
+  int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
+  mpz_init(erg);
+  mpz_mod(erg, (int_number) from, r->nrnModul);
+  return (number) erg;
+}
+
+number nrnMapQ(number from, const coeffs r)
 {
   int_number erg = (int_number) omAllocBin(gmp_nrz_bin);
   mpz_init(erg);
   nlGMP(from, (number) erg);
-  mpz_mod(erg, erg, currRing->nrnModul);
+  mpz_mod(erg, erg, r->nrnModul);
   return (number) erg;
 }
@@ -414,5 +451,5 @@
 nMapFunc nrnSetMap(const ring src, const ring dst)
 {
-  /* dst = currRing */
+  /* dst = currRing->cf */
   if (rField_is_Ring_Z(src))
   {
@@ -450,5 +487,5 @@
         mpz_init(nrnMapCoef);
       }
-      if (mpz_divisible_p(nrnMapModul, currRing->nrnModul))
+      if (mpz_divisible_p(nrnMapModul, r->nrnModul))
       {
         mpz_set_si(nrnMapCoef, 1);
@@ -457,25 +494,25 @@
       if (nrnDivBy(NULL, (number) nrnMapModul))
       {
-        mpz_divexact(nrnMapCoef, currRing->nrnModul, nrnMapModul);
-        int_number tmp = currRing->nrnModul;
-        currRing->nrnModul = nrnMapModul;
+        mpz_divexact(nrnMapCoef, r->nrnModul, nrnMapModul);
+        int_number tmp = r->nrnModul;
+        r->nrnModul = nrnMapModul;
         if (!nrnIsUnit((number) nrnMapCoef))
         {
-          currRing->nrnModul = tmp;
-          nrnDelete((number*) &nrnMapModul, currRing);
+          r->nrnModul = tmp;
+          nrnDelete((number*) &nrnMapModul, r);
           return NULL;
         }
         int_number inv = (int_number) nrnInvers((number) nrnMapCoef);
-        currRing->nrnModul = tmp;
+        r->nrnModul = tmp;
         mpz_mul(nrnMapCoef, nrnMapCoef, inv);
-        mpz_mod(nrnMapCoef, nrnMapCoef, currRing->nrnModul);
-        nrnDelete((number*) &inv, currRing);
+        mpz_mod(nrnMapCoef, nrnMapCoef, r->nrnModul);
+        nrnDelete((number*) &inv, r);
       }
       else
       {
-        nrnDelete((number*) &nrnMapModul, currRing);
+        nrnDelete((number*) &nrnMapModul, r);
         return NULL;
       }
-      nrnDelete((number*) &nrnMapModul, currRing);
+      nrnDelete((number*) &nrnMapModul, r);
       if (rField_is_Ring_2toM(src))
         return nrnMap2toM;
@@ -493,5 +530,5 @@
  */
 
-void nrnSetExp(int m, ring r)
+void nrnSetExp(int m, const coeffs r)
 {
   if ((r->nrnModul != NULL) && (mpz_cmp(r->nrnModul, r->ringflaga) == 0) && (nrnExponent == r->ringflagb)) return;
@@ -510,5 +547,5 @@
 }
 
-void nrnInitExp(int m, ring r)
+void nrnInitExp(int m, const coeffs r)
 {
   nrnSetExp(m, r);
@@ -521,8 +558,8 @@
 
 #ifdef LDEBUG
-BOOLEAN nrnDBTest (number a, const char *f, const int l)
+BOOLEAN nrnDBTest (number a, const char *f, const int l, const coeffs r)
 {
   if (a==NULL) return TRUE;
-  if ( (mpz_cmp_si((int_number) a, 0) < 0) || (mpz_cmp((int_number) a, currRing->nrnModul) > 0) )
+  if ( (mpz_cmp_si((int_number) a, 0) < 0) || (mpz_cmp((int_number) a, r->nrnModul) > 0) )
   {
     return FALSE;
@@ -559,5 +596,5 @@
 }
 
-const char * nrnRead (const char *s, number *a)
+const char * nrnRead (const char *s, number *a, const coeffs r)
 {
   int_number z = (int_number) omAllocBin(gmp_nrz_bin);
@@ -565,5 +602,5 @@
     s = nlCPEatLongC((char *)s, z);
   }
-  mpz_mod(z, z, currRing->nrnModul);
+  mpz_mod(z, z, r->nrnModul);
   *a = (number) z;
   return s;
Index: coeffs/rmodulon.h
===================================================================
--- coeffs/rmodulon.h	(revision 8d0331d269cda0bfa108f83973723bfc04777cd1)
+++ coeffs/rmodulon.h	(revision 14b11bba0b33b67ddc0e94233db4a7517190715e)
@@ -15,40 +15,43 @@
 #endif
 
-number  cfrnCopy       (number a, const ring r);
-int     nrnSize        (number a, const ring r);
-void    nrnDelete      (number *a, const ring r);
-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, 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);
+/* next method is for initializing function pointers */
+void    nrnCoeffInit   (n_Procs_s *n, int c, const coeffs r);
+
+number  nrnCopy        (number a, const coeffs r);
+int     nrnSize        (number a, const coeffs r);
+void    nrnDelete      (number *a, const coeffs r);
+BOOLEAN nrnGreaterZero (number k, const coeffs r);
+number  nrnMult        (number a, number b, const coeffs r);
+number  nrnInit        (int i, const coeffs r);
+int     nrnInt         (number &n, const coeffs r);
+number  nrnAdd         (number a, number b, const coeffs r);
+number  nrnSub         (number a, number b, const coeffs r);
+void    nrnPower       (number a, int i, number * result, const coeffs r);
+BOOLEAN nrnIsZero      (number a, const coeffs r);
+BOOLEAN nrnIsOne       (number a, const coeffs r);
+BOOLEAN nrnIsMOne      (number a, const coeffs r);
+BOOLEAN nrnIsUnit      (number a, const coeffs r);
+number  nrnGetUnit     (number a, const coeffs r);
+number  nrnDiv         (number a, number b, const coeffs r);
+number  nrnMod         (number a,number b, const coeffs r);
+number  nrnIntDiv      (number a,number b, const coeffs r);
+number  nrnNeg         (number c, const coeffs r);
+number  nrnInvers      (number c, const coeffs r);
+BOOLEAN nrnGreater     (number a, number b, const coeffs r);
+BOOLEAN nrnDivBy       (number a, number b, const coeffs r);
+int     nrnDivComp     (number a, number b, const coeffs r);
+BOOLEAN nrnEqual       (number a, number b, const coeffs r);
+number  nrnLcm         (number a,number b, const coeffs r);
+number  nrnGcd         (number a,number b, const coeffs r);
+number  nrnExtGcd      (number a, number b, number *s, number *t, const coeffs r);
+nMapFunc nrnSetMap     (const coeffs src, const coeffs dst);
 #define  nrnWrite      nrzWrite
-const char *  nrnRead  (const char *s, number *a, const ring r);
-char *  nrnName        (number n, const ring r);
+const char *  nrnRead  (const char *s, number *a, const coeffs r);
+char *  nrnName        (number n, const coeffs r);
 #ifdef LDEBUG
-BOOLEAN nrnDBTest      (number a, const char *f, const int l, const ring r);
+BOOLEAN nrnDBTest      (number a, const char *f, const int l, const coeffs r);
 #endif
-void    nrnSetExp(int c, const ring r);
-void    nrnInitExp(int c, const ring r);
+void    nrnSetExp(int c, const coeffs r);
+void    nrnInitExp(int c, const coeffs r);
 
 #endif
