Index: kernel/tgb.cc
===================================================================
--- kernel/tgb.cc	(revision 410ea0fb1e22ebcb52e33b6789cf294a2d1f663b)
+++ kernel/tgb.cc	(revision db83bf13b62d944de021f52de5ae04b7ffd0390e)
@@ -40,9 +40,8 @@
 static omBin lm_bin = NULL;
 
-static void
-simplify_poly (poly p, ring r)
+static void simplify_poly (poly p, ring r)
 {
   assume (r == currRing);
-  if (!rField_is_Zp (r))
+  if(!rField_is_Zp (r))
   {
     p_Cleardenom (p, r);
@@ -55,12 +54,11 @@
 //static const BOOLEAN up_to_radical=TRUE;
 
-int
-slim_nsize (number n, ring r)
-{
-  if (rField_is_Zp (r))
+int slim_nsize (number n, ring r)
+{
+  if(rField_is_Zp (r))
   {
     return 1;
   }
-  if (rField_is_Q (r))
+  if(rField_is_Q (r))
   {
     return QlogSize (n);
@@ -72,13 +70,12 @@
 }
 
-static BOOLEAN
-monomial_root (poly m, ring r)
+static BOOLEAN monomial_root (poly m, ring r)
 {
   BOOLEAN changed = FALSE;
   int i;
-  for (i = 1; i <= rVar (r); i++)
+  for(i = 1; i <= rVar (r); i++)
   {
     int e = p_GetExp (m, i, r);
-    if (e > 1)
+    if(e > 1)
     {
       p_SetExp (m, i, 1, r);
@@ -86,5 +83,5 @@
     }
   }
-  if (changed)
+  if(changed)
   {
     p_Setm (m, r);
@@ -93,26 +90,25 @@
 }
 
-static BOOLEAN
-polynomial_root (poly h, ring r)
+static BOOLEAN polynomial_root (poly h, ring r)
 {
   poly got = gcd_of_terms (h, r);
   BOOLEAN changed = FALSE;
-  if ((got != NULL) && (TEST_V_UPTORADICAL))
+  if((got != NULL) && (TEST_V_UPTORADICAL))
   {
     poly copy = p_Copy (got, r);
     //p_wrp(got,c->r);
     changed = monomial_root (got, r);
-    if (changed)
+    if(changed)
     {
       poly div_by = pDivide (copy, got);
       poly iter = h;
-      while (iter)
-      {
-	pExpVectorSub (iter, div_by);
-	pIter (iter);
+      while(iter)
+      {
+        pExpVectorSub (iter, div_by);
+        pIter (iter);
       }
       p_Delete (&div_by, r);
-      if (TEST_OPT_PROT)
-	PrintS ("U");
+      if(TEST_OPT_PROT)
+        PrintS ("U");
     }
     p_Delete (&copy, r);
@@ -122,12 +118,10 @@
 }
 
-static inline poly
-p_Init_Special (const ring r)
+static inline poly p_Init_Special (const ring r)
 {
   return p_Init (r, lm_bin);
 }
 
-static inline poly
-pOne_Special (const ring r = currRing)
+static inline poly pOne_Special (const ring r = currRing)
 {
   poly rc = p_Init_Special (r);
@@ -147,12 +141,10 @@
 #ifdef LEN_VAR1
 // erste Variante: Laenge: Anzahl der Monome
-static inline int
-pSLength (poly p, int l)
+static inline int pSLength (poly p, int l)
 {
   return l;
 }
 
-static inline int
-kSBucketLength (kBucket * bucket, poly lm)
+static inline int kSBucketLength (kBucket * bucket, poly lm)
 {
   return bucket_guess (bucket);
@@ -162,9 +154,8 @@
 #ifdef LEN_VAR2
 // 2. Variante: Laenge: Platz fuer die Koeff.
-int
-pSLength (poly p, int l)
+int pSLength (poly p, int l)
 {
   int s = 0;
-  while (p != NULL)
+  while(p != NULL)
   {
     s += nSize (pGetCoeff (p));
@@ -174,10 +165,9 @@
 }
 
-int
-kSBucketLength (kBucket * b, poly lm)
+int kSBucketLength (kBucket * b, poly lm)
 {
   int s = 0;
   int i;
-  for (i = MAX_BUCKET; i >= 0; i--)
+  for(i = MAX_BUCKET; i >= 0; i--)
   {
     s += pSLength (b->buckets[i], 0);
@@ -187,11 +177,10 @@
 #endif
 
-int
-QlogSize (number n)
-{
-  if (SR_HDL (n) & SR_INT)
+int QlogSize (number n)
+{
+  if(SR_HDL (n) & SR_INT)
   {
     long i = SR_TO_INT (n);
-    if (i == 0)
+    if(i == 0)
       return 0;
 
@@ -200,5 +189,5 @@
     int r = 0;
 
-    while (v >>= 1)
+    while(v >>= 1)
     {
       r++;
@@ -211,10 +200,9 @@
 
 #ifdef LEN_VAR3
-static inline wlen_type
-pSLength (poly p, int l)
+static inline wlen_type pSLength (poly p, int l)
 {
   wlen_type c;
   number coef = pGetCoeff (p);
-  if (rField_is_Q (currRing))
+  if(rField_is_Q (currRing))
   {
     c = QlogSize (coef);
@@ -222,6 +210,8 @@
   else
     c = nSize (coef);
-  if (!(TEST_V_COEFSTRAT))
+  if(!(TEST_V_COEFSTRAT))
+  {
     return (wlen_type) c *(wlen_type) l /*pLength(p) */ ;
+  }
   else
   {
@@ -234,11 +224,10 @@
 
 //! TODO CoefBuckets bercksichtigen
-wlen_type
-kSBucketLength (kBucket * b, poly lm = NULL)
+wlen_type kSBucketLength (kBucket * b, poly lm = NULL)
 {
   int s = 0;
   wlen_type c;
   number coef;
-  if (lm == NULL)
+  if(lm == NULL)
     coef = pGetCoeff (kBucketGetLm (b));
   //c=nSize(pGetCoeff(kBucketGetLm(b)));
@@ -246,5 +235,5 @@
     coef = pGetCoeff (lm);
   //c=nSize(pGetCoeff(lm));
-  if (rField_is_Q (currRing))
+  if(rField_is_Q (currRing))
   {
     c = QlogSize (coef);
@@ -254,5 +243,5 @@
 
   int i;
-  for (i = b->buckets_used; i >= 0; i--)
+  for(i = b->buckets_used; i >= 0; i--)
   {
     assume ((b->buckets_length[i] == 0) || (b->buckets[i] != NULL));
@@ -261,7 +250,7 @@
 #ifdef HAVE_COEF_BUCKETS
   assume (b->buckets[0] == kBucketGetLm (b));
-  if (b->coef[0] != NULL)
-  {
-    if (rField_is_Q (currRing))
+  if(b->coef[0] != NULL)
+  {
+    if(rField_is_Q (currRing))
     {
       int modifier = QlogSize (pGetCoeff (b->coef[0]));
@@ -275,5 +264,5 @@
   }
 #endif
-  if (!(TEST_V_COEFSTRAT))
+  if(!(TEST_V_COEFSTRAT))
   {
     return s * c;
@@ -289,10 +278,9 @@
 #endif
 #ifdef LEN_VAR5
-static inline wlen_type
-pSLength (poly p, int l)
+static inline wlen_type pSLength (poly p, int l)
 {
   int c;
   number coef = pGetCoeff (p);
-  if (rField_is_Q (currRing))
+  if(rField_is_Q (currRing))
   {
     c = QlogSize (coef);
@@ -309,11 +297,10 @@
 
 //! TODO CoefBuckets bercksichtigen
-wlen_type
-kSBucketLength (kBucket * b, poly lm = NULL)
+wlen_type kSBucketLength (kBucket * b, poly lm = NULL)
 {
   wlen_type s = 0;
   int c;
   number coef;
-  if (lm == NULL)
+  if(lm == NULL)
     coef = pGetCoeff (kBucketGetLm (b));
   //c=nSize(pGetCoeff(kBucketGetLm(b)));
@@ -321,5 +308,5 @@
     coef = pGetCoeff (lm);
   //c=nSize(pGetCoeff(lm));
-  if (rField_is_Q (currRing))
+  if(rField_is_Q (currRing))
   {
     c = QlogSize (coef);
@@ -329,5 +316,5 @@
 
   int i;
-  for (i = b->buckets_used; i >= 0; i--)
+  for(i = b->buckets_used; i >= 0; i--)
   {
     assume ((b->buckets_length[i] == 0) || (b->buckets[i] != NULL));
@@ -336,7 +323,7 @@
 #ifdef HAVE_COEF_BUCKETS
   assume (b->buckets[0] == kBucketGetLm (b));
-  if (b->coef[0] != NULL)
-  {
-    if (rField_is_Q (currRing))
+  if(b->coef[0] != NULL)
+  {
+    if(rField_is_Q (currRing))
     {
       int modifier = QlogSize (pGetCoeff (b->coef[0]));
@@ -359,11 +346,10 @@
 #ifdef LEN_VAR4
 // 4.Variante: Laenge: Platz fuer Leitk * (1+Platz fuer andere Koeff.)
-int
-pSLength (poly p, int l)
+int pSLength (poly p, int l)
 {
   int s = 1;
   int c = nSize (pGetCoeff (p));
   pIter (p);
-  while (p != NULL)
+  while(p != NULL)
   {
     s += nSize (pGetCoeff (p));
@@ -373,13 +359,12 @@
 }
 
-int
-kSBucketLength (kBucket * b)
+int kSBucketLength (kBucket * b)
 {
   int s = 1;
   int c = nSize (pGetCoeff (kBucketGetLm (b)));
   int i;
-  for (i = MAX_BUCKET; i > 0; i--)
-  {
-    if (b->buckets[i] == NULL)
+  for(i = MAX_BUCKET; i > 0; i--)
+  {
+    if(b->buckets[i] == NULL)
       continue;
     s += pSLength (b->buckets[i], 0);
@@ -389,21 +374,20 @@
 #endif
 //BUG/TODO this stuff will fail on internal Schreyer orderings
-static BOOLEAN
-elength_is_normal_length (poly p, slimgb_alg * c)
+static BOOLEAN elength_is_normal_length (poly p, slimgb_alg * c)
 {
   ring r = c->r;
-  if (p_GetComp (p, r) != 0)
+  if(p_GetComp (p, r) != 0)
     return FALSE;
-  if (c->lastDpBlockStart <= pVariables)
+  if(c->lastDpBlockStart <= pVariables)
   {
     int i;
-    for (i = 1; i < c->lastDpBlockStart; i++)
-    {
-      if (p_GetExp (p, i, r) != 0)
-      {
-	break;
-      }
-    }
-    if (i >= c->lastDpBlockStart)
+    for(i = 1; i < c->lastDpBlockStart; i++)
+    {
+      if(p_GetExp (p, i, r) != 0)
+      {
+        break;
+      }
+    }
+    if(i >= c->lastDpBlockStart)
     {
       //wrp(p);
@@ -418,21 +402,20 @@
 }
 
-static BOOLEAN
-lies_in_last_dp_block (poly p, slimgb_alg * c)
+static BOOLEAN lies_in_last_dp_block (poly p, slimgb_alg * c)
 {
   ring r = c->r;
-  if (p_GetComp (p, r) != 0)
+  if(p_GetComp (p, r) != 0)
     return FALSE;
-  if (c->lastDpBlockStart <= pVariables)
+  if(c->lastDpBlockStart <= pVariables)
   {
     int i;
-    for (i = 1; i < c->lastDpBlockStart; i++)
-    {
-      if (p_GetExp (p, i, r) != 0)
-      {
-	break;
-      }
-    }
-    if (i >= c->lastDpBlockStart)
+    for(i = 1; i < c->lastDpBlockStart; i++)
+    {
+      if(p_GetExp (p, i, r) != 0)
+      {
+        break;
+      }
+    }
+    if(i >= c->lastDpBlockStart)
     {
       //wrp(p);
@@ -447,11 +430,10 @@
 }
 
-static int
-get_last_dp_block_start (ring r)
+static int get_last_dp_block_start (ring r)
 {
   //ring r=c->r;
   int last_block;
 
-  if (rRing_has_CompLastBlock (r))
+  if(rRing_has_CompLastBlock (r))
   {
     last_block = rBlocks (r) - 3;
@@ -462,17 +444,16 @@
   }
   assume (last_block >= 0);
-  if (r->order[last_block] == ringorder_dp)
+  if(r->order[last_block] == ringorder_dp)
     return r->block0[last_block];
   return pVariables + 1;
 }
 
-static wlen_type
-do_pELength (poly p, slimgb_alg * c, int dlm = -1)
-{
-  if (p == NULL)
+static wlen_type do_pELength (poly p, slimgb_alg * c, int dlm = -1)
+{
+  if(p == NULL)
     return 0;
   wlen_type s = 0;
   poly pi = p;
-  if (dlm < 0)
+  if(dlm < 0)
   {
     dlm = c->pTotaldegree (p);
@@ -481,8 +462,8 @@
   }
 
-  while (pi)
+  while(pi)
   {
     int d = c->pTotaldegree (pi);
-    if (d > dlm)
+    if(d > dlm)
       s += 1 + d - dlm;
     else
@@ -493,8 +474,7 @@
 }
 
-wlen_type
-pELength (poly p, slimgb_alg * c, ring r)
-{
-  if (p == NULL)
+wlen_type pELength (poly p, slimgb_alg * c, ring r)
+{
+  if(p == NULL)
     return 0;
   wlen_type s = 0;
@@ -505,8 +485,8 @@
   pi = p->next;
 
-  while (pi)
+  while(pi)
   {
     int d = c->pTotaldegree (pi);
-    if (d > dlm)
+    if(d > dlm)
       s += 1 + d - dlm;
     else
@@ -517,15 +497,14 @@
 }
 
-wlen_type
-kEBucketLength (kBucket * b, poly lm, int sugar, slimgb_alg * ca)
+wlen_type kEBucketLength (kBucket * b, poly lm, int sugar, slimgb_alg * ca)
 {
   wlen_type s = 0;
-  if (lm == NULL)
+  if(lm == NULL)
   {
     lm = kBucketGetLm (b);
   }
-  if (lm == NULL)
+  if(lm == NULL)
     return 0;
-  if (elength_is_normal_length (lm, ca))
+  if(elength_is_normal_length (lm, ca))
   {
     return bucket_guess (b);
@@ -540,11 +519,11 @@
   //int d=pTotaldegree(lm,ca->r);
   int i;
-  for (i = b->buckets_used; i >= 0; i--)
-  {
-    if (b->buckets[i] == NULL)
+  for(i = b->buckets_used; i >= 0; i--)
+  {
+    if(b->buckets[i] == NULL)
       continue;
 
-    if ((ca->pTotaldegree (b->buckets[i]) <= d)
-	&& (elength_is_normal_length (b->buckets[i], ca)))
+    if((ca->pTotaldegree (b->buckets[i]) <= d)
+       && (elength_is_normal_length (b->buckets[i], ca)))
     {
       s += b->buckets_length[i];
@@ -559,34 +538,32 @@
 }
 
-static inline int
-pELength (poly p, slimgb_alg * c, int l)
-{
-  if (p == NULL)
+static inline int pELength (poly p, slimgb_alg * c, int l)
+{
+  if(p == NULL)
     return 0;
-  if ((l > 0) && (elength_is_normal_length (p, c)))
+  if((l > 0) && (elength_is_normal_length (p, c)))
     return l;
   return do_pELength (p, c);
 }
 
-static inline wlen_type
-pQuality (poly p, slimgb_alg * c, int l = -1)
-{
-  if (l < 0)
+static inline wlen_type pQuality (poly p, slimgb_alg * c, int l = -1)
+{
+  if(l < 0)
     l = pLength (p);
-  if (c->isDifficultField)
-  {
-    if (c->eliminationProblem)
+  if(c->isDifficultField)
+  {
+    if(c->eliminationProblem)
     {
       wlen_type cs;
       number coef = pGetCoeff (p);
-      if (rField_is_Q (currRing))
-      {
-	cs = QlogSize (coef);
+      if(rField_is_Q (currRing))
+      {
+        cs = QlogSize (coef);
       }
       else
-	cs = nSize (coef);
+        cs = nSize (coef);
       wlen_type erg = cs;
-      if (TEST_V_COEFSTRAT)
-	erg *= cs;
+      if(TEST_V_COEFSTRAT)
+        erg *= cs;
       //erg*=cs;//for quadratic
       erg *= pELength (p, c, l);
@@ -600,14 +577,13 @@
     return r;
   }
-  if (c->eliminationProblem)
+  if(c->eliminationProblem)
     return pELength (p, c, l);
   return l;
 }
 
-static inline int
-pTotaldegree_full (poly p)
+static inline int pTotaldegree_full (poly p)
 {
   int r = 0;
-  while (p)
+  while(p)
   {
     int d = pTotaldegree (p);
@@ -618,14 +594,13 @@
 }
 
-wlen_type
-red_object::guess_quality (slimgb_alg * c)
+wlen_type red_object::guess_quality (slimgb_alg * c)
 {
   //works at the moment only for lenvar 1, because in different
   //case, you have to look on coefs
   wlen_type s = 0;
-  if (c->isDifficultField)
+  if(c->isDifficultField)
   {
     //s=kSBucketLength(bucket,this->p);
-    if (c->eliminationProblem)
+    if(c->eliminationProblem)
     {
       wlen_type cs;
@@ -636,23 +611,23 @@
 
       //c=nSize(pGetCoeff(lm));
-      if (rField_is_Q (currRing))
-      {
-	cs = QlogSize (coef);
+      if(rField_is_Q (currRing))
+      {
+        cs = QlogSize (coef);
       }
       else
-	cs = nSize (coef);
+        cs = nSize (coef);
 #ifdef HAVE_COEF_BUCKETS
-      if (bucket->coef[0] != NULL)
-      {
-	if (rField_is_Q (currRing))
-	{
-	  int modifier = QlogSize (pGetCoeff (bucket->coef[0]));
-	  cs += modifier;
-	}
-	else
-	{
-	  int modifier = nSize (pGetCoeff (bucket->coef[0]));
-	  cs *= modifier;
-	}
+      if(bucket->coef[0] != NULL)
+      {
+        if(rField_is_Q (currRing))
+        {
+          int modifier = QlogSize (pGetCoeff (bucket->coef[0]));
+          cs += modifier;
+        }
+        else
+        {
+          int modifier = nSize (pGetCoeff (bucket->coef[0]));
+          cs *= modifier;
+        }
       }
 #endif
@@ -661,6 +636,6 @@
       //erg*=cs;//for quadratic
       erg *= cs;
-      if (TEST_V_COEFSTRAT)
-	erg *= cs;
+      if(TEST_V_COEFSTRAT)
+        erg *= cs;
       //return cs*kEBucketLength(this->bucket,this->p,c);
       return erg;
@@ -670,5 +645,5 @@
   else
   {
-    if (c->eliminationProblem)
+    if(c->eliminationProblem)
       //if (false)
       s = kEBucketLength (this->bucket, this->p, this->sugar, c);
@@ -679,14 +654,12 @@
 }
 
-#if 0				//currently unused
-static void
-finalize_reduction_step (reduction_step * r)
+#if 0                           //currently unused
+static void finalize_reduction_step (reduction_step * r)
 {
   delete r;
 }
 #endif
-#if 0				//currently unused
-static int
-LObject_better_gen (const void *ap, const void *bp)
+#if 0                           //currently unused
+static int LObject_better_gen (const void *ap, const void *bp)
 {
   LObject *a = *(LObject **) ap;
@@ -695,13 +668,11 @@
 }
 #endif
-static int
-red_object_better_gen (const void *ap, const void *bp)
+static int red_object_better_gen (const void *ap, const void *bp)
 {
   return (pLmCmp (((red_object *) ap)->p, ((red_object *) bp)->p));
 }
 
-#if 0				//currently unused
-static int
-pLmCmp_func_inverted (const void *ap1, const void *ap2)
+#if 0                           //currently unused
+static int pLmCmp_func_inverted (const void *ap1, const void *ap2)
 {
   poly p1, p2;
@@ -712,19 +683,17 @@
 #endif
 
-int
-tgb_pair_better_gen2 (const void *ap, const void *bp)
+int tgb_pair_better_gen2 (const void *ap, const void *bp)
 {
   return (-tgb_pair_better_gen (ap, bp));
 }
 
-int
-kFindDivisibleByInS_easy (kStrategy strat, const red_object & obj)
+int kFindDivisibleByInS_easy (kStrategy strat, const red_object & obj)
 {
   int i;
   long not_sev = ~obj.sev;
   poly p = obj.p;
-  for (i = 0; i <= strat->sl; i++)
-  {
-    if (pLmShortDivisibleBy (strat->S[i], strat->sevS[i], p, not_sev))
+  for(i = 0; i <= strat->sl; i++)
+  {
+    if(pLmShortDivisibleBy (strat->S[i], strat->sevS[i], p, not_sev))
       return i;
   }
@@ -732,12 +701,11 @@
 }
 
-int
-kFindDivisibleByInS_easy (kStrategy strat, poly p, long sev)
+int kFindDivisibleByInS_easy (kStrategy strat, poly p, long sev)
 {
   int i;
   long not_sev = ~sev;
-  for (i = 0; i <= strat->sl; i++)
-  {
-    if (pLmShortDivisibleBy (strat->S[i], strat->sevS[i], p, not_sev))
+  for(i = 0; i <= strat->sl; i++)
+  {
+    if(pLmShortDivisibleBy (strat->S[i], strat->sevS[i], p, not_sev))
       return i;
   }
@@ -747,7 +715,7 @@
 static int
 posInPairs (sorted_pair_node ** p, int pn, sorted_pair_node * qe,
-	    slimgb_alg * c, int an = 0)
-{
-  if (pn == 0)
+            slimgb_alg * c, int an = 0)
+{
+  if(pn == 0)
     return 0;
 
@@ -757,18 +725,18 @@
   int en = length;
 
-  if (pair_better (qe, p[en], c))
+  if(pair_better (qe, p[en], c))
     return length + 1;
 
-  while (1)
+  while(1)
   {
     //if (an >= en-1)
-    if (en - 1 <= an)
-    {
-      if (pair_better (p[an], qe, c))
-	return an;
+    if(en - 1 <= an)
+    {
+      if(pair_better (p[an], qe, c))
+        return an;
       return en;
     }
     i = (an + en) / 2;
-    if (pair_better (p[i], qe, c))
+    if(pair_better (p[i], qe, c))
       en = i;
     else
@@ -777,17 +745,15 @@
 }
 
-static BOOLEAN
-ascending (int *i, int top)
-{
-  if (top < 1)
+static BOOLEAN ascending (int *i, int top)
+{
+  if(top < 1)
     return TRUE;
-  if (i[top] < i[top - 1])
+  if(i[top] < i[top - 1])
     return FALSE;
   return ascending (i, top - 1);
 }
 
-sorted_pair_node **
-spn_merge (sorted_pair_node ** p, int pn, sorted_pair_node ** q, int qn,
-	   slimgb_alg * c)
+sorted_pair_node **spn_merge (sorted_pair_node ** p, int pn,
+                              sorted_pair_node ** q, int qn, slimgb_alg * c)
 {
   int i;
@@ -807,5 +773,5 @@
 // }
   int lastpos = 0;
-  for (i = 0; i < qn; i++)
+  for(i = 0; i < qn; i++)
   {
     lastpos = posInPairs (p, pn, q[i], c, si_max (lastpos - 1, 0));
@@ -813,20 +779,20 @@
     a[i] = lastpos;
   }
-  if ((pn + qn) > c->max_pairs)
+  if((pn + qn) > c->max_pairs)
   {
     p =
       (sorted_pair_node **) omrealloc (p,
-				       2 * (pn +
-					    qn) *
-				       sizeof (sorted_pair_node *));
+                                       2 * (pn +
+                                            qn) *
+                                       sizeof (sorted_pair_node *));
     c->max_pairs = 2 * (pn + qn);
   }
-  for (i = qn - 1; i >= 0; i--)
+  for(i = qn - 1; i >= 0; i--)
   {
     size_t size;
-    if (qn - 1 > i)
+    if(qn - 1 > i)
       size = (a[i + 1] - a[i]) * sizeof (sorted_pair_node *);
     else
-      size = (pn - a[i]) * sizeof (sorted_pair_node *);	//as indices begin with 0
+      size = (pn - a[i]) * sizeof (sorted_pair_node *); //as indices begin with 0
     memmove (p + a[i] + (1 + i), p + a[i], size);
     p[a[i] + i] = q[i];
@@ -842,5 +808,5 @@
   poly p2 = c->S->m[pos2];
 
-  if (pGetComp (p1) > 0 || pGetComp (p2) > 0)
+  if(pGetComp (p1) > 0 || pGetComp (p2) > 0)
     return FALSE;
   int i = 1;
@@ -849,20 +815,20 @@
   poly gcd2 = c->gcd_of_terms[pos2];
 
-  if ((gcd1 != NULL) && (gcd2 != NULL))
-  {
-    gcd1->next = gcd2;		//may ordered incorrect
+  if((gcd1 != NULL) && (gcd2 != NULL))
+  {
+    gcd1->next = gcd2;          //may ordered incorrect
     m = gcd_of_terms (gcd1, c->r);
     gcd1->next = NULL;
   }
-  if (m == NULL)
+  if(m == NULL)
   {
     loop
     {
-      if (pGetExp (p1, i) + pGetExp (p2, i) > pGetExp (bound, i))
-	return FALSE;
-      if (i == pVariables)
-      {
-	//PrintS("trivial");
-	return TRUE;
+      if(pGetExp (p1, i) + pGetExp (p2, i) > pGetExp (bound, i))
+        return FALSE;
+      if(i == pVariables)
+      {
+        //PrintS("trivial");
+        return TRUE;
       }
       i++;
@@ -873,15 +839,15 @@
     loop
     {
-      if (pGetExp (p1, i) - pGetExp (m, i) + pGetExp (p2, i) >
-	  pGetExp (bound, i))
-      {
-	pDelete (&m);
-	return FALSE;
-      }
-      if (i == pVariables)
-      {
-	pDelete (&m);
-	//PrintS("trivial");
-	return TRUE;
+      if(pGetExp (p1, i) - pGetExp (m, i) + pGetExp (p2, i) >
+         pGetExp (bound, i))
+      {
+        pDelete (&m);
+        return FALSE;
+      }
+      if(i == pVariables)
+      {
+        pDelete (&m);
+        //PrintS("trivial");
+        return TRUE;
       }
       i++;
@@ -891,14 +857,13 @@
 
 //! returns position sets w as weight
-int
-find_best (red_object * r, int l, int u, wlen_type & w, slimgb_alg * c)
+int find_best (red_object * r, int l, int u, wlen_type & w, slimgb_alg * c)
 {
   int best = l;
   int i;
   w = r[l].guess_quality (c);
-  for (i = l + 1; i <= u; i++)
+  for(i = l + 1; i <= u; i++)
   {
     wlen_type w2 = r[i].guess_quality (c);
-    if (w2 < w)
+    if(w2 < w)
     {
       w = w2;
@@ -909,16 +874,14 @@
 }
 
-void
-red_object::canonicalize ()
+void red_object::canonicalize ()
 {
   kBucketCanonicalize (bucket);
 }
 
-BOOLEAN
-good_has_t_rep (int i, int j, slimgb_alg * c)
+BOOLEAN good_has_t_rep (int i, int j, slimgb_alg * c)
 {
   assume (i >= 0);
   assume (j >= 0);
-  if (has_t_rep (i, j, c))
+  if(has_t_rep (i, j, c))
     return TRUE;
   //poly lm=pOne();
@@ -933,7 +896,7 @@
   //p_Delete(&lm,c->r);
 
-  for (int n = 0; ((n < c->n) && (i_con[n] >= 0)); n++)
-  {
-    if (i_con[n] == j)
+  for(int n = 0; ((n < c->n) && (i_con[n] >= 0)); n++)
+  {
+    if(i_con[n] == j)
     {
       now_t_rep (i, j, c);
@@ -947,11 +910,10 @@
 }
 
-BOOLEAN
-lenS_correct (kStrategy strat)
+BOOLEAN lenS_correct (kStrategy strat)
 {
   int i;
-  for (i = 0; i <= strat->sl; i++)
-  {
-    if (strat->lenS[i] != pLength (strat->S[i]))
+  for(i = 0; i <= strat->sl; i++)
+  {
+    if(strat->lenS[i] != pLength (strat->S[i]))
       return FALSE;
   }
@@ -960,10 +922,9 @@
 
 
-static void
-cleanS (kStrategy strat, slimgb_alg * c)
+static void cleanS (kStrategy strat, slimgb_alg * c)
 {
   int i = 0;
   LObject P;
-  while (i <= strat->sl)
+  while(i <= strat->sl)
   {
     P.p = strat->S[i];
@@ -971,5 +932,5 @@
     //int dummy=strat->sl;
     //if(kFindDivisibleByInS(strat,&dummy,&P)!=i)
-    if (kFindDivisibleByInS_easy (strat, P.p, P.sev) != i)
+    if(kFindDivisibleByInS_easy (strat, P.p, P.sev) != i)
     {
       deleteInS (i, strat);
@@ -977,14 +938,14 @@
       BOOLEAN found = FALSE;
       int j;
-      for (j = 0; j < c->n; j++)
-      {
-	if (c->S->m[j] == P.p)
-	{
-	  found = TRUE;
-	  break;
-	}
-      }
-      if (!found)
-	pDelete (&P.p);
+      for(j = 0; j < c->n; j++)
+      {
+        if(c->S->m[j] == P.p)
+        {
+          found = TRUE;
+          break;
+        }
+      }
+      if(!found)
+        pDelete (&P.p);
       //remember additional reductors
     }
@@ -994,12 +955,11 @@
 }
 
-static int
-bucket_guess (kBucket * bucket)
+static int bucket_guess (kBucket * bucket)
 {
   int sum = 0;
   int i;
-  for (i = bucket->buckets_used; i >= 0; i--)
-  {
-    if (bucket->buckets[i])
+  for(i = bucket->buckets_used; i >= 0; i--)
+  {
+    if(bucket->buckets[i])
       sum += bucket->buckets_length[i];
   }
@@ -1009,5 +969,5 @@
 static int
 add_to_reductors (slimgb_alg * c, poly h, int len, int ecart,
-		  BOOLEAN simplified)
+                  BOOLEAN simplified)
 {
   //inDebug(h);
@@ -1023,10 +983,10 @@
   memset (&P, 0, sizeof (P));
   P.tailRing = c->r;
-  P.p = h;			/*p_Copy(h,c->r); */
+  P.p = h;                      /*p_Copy(h,c->r); */
   P.ecart = ecart;
   P.FDeg = pFDeg (P.p, c->r);
-  if (!(simplified))
-  {
-    if (!rField_is_Zp (c->r))
+  if(!(simplified))
+  {
+    if(!rField_is_Zp (c->r))
     {
       p_Cleardenom (P.p, c->r);
@@ -1044,5 +1004,5 @@
   c->strat->lenS[i] = len;
   assume (pLength (c->strat->S[i]) == c->strat->lenS[i]);
-  if (c->strat->lenSw != NULL)
+  if(c->strat->lenSw != NULL)
     c->strat->lenSw[i] = pq;
 
@@ -1050,29 +1010,27 @@
 }
 
-static void
-length_one_crit (slimgb_alg * c, int pos, int len)
-{
-  if (c->nc)
+static void length_one_crit (slimgb_alg * c, int pos, int len)
+{
+  if(c->nc)
     return;
-  if (len == 1)
+  if(len == 1)
   {
     int i;
-    for (i = 0; i < pos; i++)
-    {
-      if (c->lengths[i] == 1)
-	c->states[pos][i] = HASTREP;
-    }
-    for (i = pos + 1; i < c->n; i++)
-    {
-      if (c->lengths[i] == 1)
-	c->states[i][pos] = HASTREP;
-    }
-    if (!c->nc)
+    for(i = 0; i < pos; i++)
+    {
+      if(c->lengths[i] == 1)
+        c->states[pos][i] = HASTREP;
+    }
+    for(i = pos + 1; i < c->n; i++)
+    {
+      if(c->lengths[i] == 1)
+        c->states[i][pos] = HASTREP;
+    }
+    if(!c->nc)
       shorten_tails (c, c->S->m[pos]);
   }
 }
 
-static void
-move_forward_in_S (int old_pos, int new_pos, kStrategy strat)
+static void move_forward_in_S (int old_pos, int new_pos, kStrategy strat)
 {
   assume (old_pos >= new_pos);
@@ -1084,8 +1042,8 @@
   assume (length == pLength (strat->S[old_pos]));
   wlen_type length_w;
-  if (strat->lenSw != NULL)
+  if(strat->lenSw != NULL)
     length_w = strat->lenSw[old_pos];
   int i;
-  for (i = old_pos; i > new_pos; i--)
+  for(i = old_pos; i > new_pos; i--)
   {
     strat->S[i] = strat->S[i - 1];
@@ -1094,9 +1052,9 @@
     strat->S_2_R[i] = strat->S_2_R[i - 1];
   }
-  if (strat->lenS != NULL)
-    for (i = old_pos; i > new_pos; i--)
+  if(strat->lenS != NULL)
+    for(i = old_pos; i > new_pos; i--)
       strat->lenS[i] = strat->lenS[i - 1];
-  if (strat->lenSw != NULL)
-    for (i = old_pos; i > new_pos; i--)
+  if(strat->lenSw != NULL)
+    for(i = old_pos; i > new_pos; i--)
       strat->lenSw[i] = strat->lenSw[i - 1];
 
@@ -1106,11 +1064,10 @@
   strat->S_2_R[new_pos] = s_2_r;
   strat->lenS[new_pos] = length;
-  if (strat->lenSw != NULL)
+  if(strat->lenSw != NULL)
     strat->lenSw[new_pos] = length_w;
   //assume(lenS_correct(strat));
 }
 
-static void
-move_backward_in_S (int old_pos, int new_pos, kStrategy strat)
+static void move_backward_in_S (int old_pos, int new_pos, kStrategy strat)
 {
   assume (old_pos <= new_pos);
@@ -1122,8 +1079,8 @@
   assume (length == pLength (strat->S[old_pos]));
   wlen_type length_w;
-  if (strat->lenSw != NULL)
+  if(strat->lenSw != NULL)
     length_w = strat->lenSw[old_pos];
   int i;
-  for (i = old_pos; i < new_pos; i++)
+  for(i = old_pos; i < new_pos; i++)
   {
     strat->S[i] = strat->S[i + 1];
@@ -1132,9 +1089,9 @@
     strat->S_2_R[i] = strat->S_2_R[i + 1];
   }
-  if (strat->lenS != NULL)
-    for (i = old_pos; i < new_pos; i++)
+  if(strat->lenS != NULL)
+    for(i = old_pos; i < new_pos; i++)
       strat->lenS[i] = strat->lenS[i + 1];
-  if (strat->lenSw != NULL)
-    for (i = old_pos; i < new_pos; i++)
+  if(strat->lenSw != NULL)
+    for(i = old_pos; i < new_pos; i++)
       strat->lenSw[i] = strat->lenSw[i + 1];
 
@@ -1144,11 +1101,10 @@
   strat->S_2_R[new_pos] = s_2_r;
   strat->lenS[new_pos] = length;
-  if (strat->lenSw != NULL)
+  if(strat->lenSw != NULL)
     strat->lenSw[new_pos] = length_w;
   //assume(lenS_correct(strat));
 }
 
-static int *
-make_connections (int from, int to, poly bound, slimgb_alg * c)
+static int *make_connections (int from, int to, poly bound, slimgb_alg * c)
 {
   ideal I = c->S;
@@ -1166,33 +1122,33 @@
   int pos;
 
-  while (TRUE)
-  {
-    if ((con_checked < connected_length) && (not_yet_found > 0))
+  while(TRUE)
+  {
+    if((con_checked < connected_length) && (not_yet_found > 0))
     {
       pos = connected[con_checked];
-      for (int i = 0; i < cans_length; i++)
-      {
-	if (cans[i] < 0)
-	  continue;
-	//FIXME: triv. syz. does not hold on noncommutative, check it for modules
-	if ((has_t_rep (pos, cans[i], c))
-	    || ((!rIsPluralRing (c->r))
-		&& (trivial_syzygie (pos, cans[i], bound, c))))
-	{
-	  connected[connected_length] = cans[i];
-	  connected_length++;
-	  cans[i] = -1;
-	  --not_yet_found;
-
-	  if (connected[connected_length - 1] == to)
-	  {
-	    if (connected_length < c->n)
-	    {
-	      connected[connected_length] = -1;
-	    }
-	    omfree (cans);
-	    return connected;
-	  }
-	}
+      for(int i = 0; i < cans_length; i++)
+      {
+        if(cans[i] < 0)
+          continue;
+        //FIXME: triv. syz. does not hold on noncommutative, check it for modules
+        if((has_t_rep (pos, cans[i], c))
+           || ((!rIsPluralRing (c->r))
+               && (trivial_syzygie (pos, cans[i], bound, c))))
+        {
+          connected[connected_length] = cans[i];
+          connected_length++;
+          cans[i] = -1;
+          --not_yet_found;
+
+          if(connected[connected_length - 1] == to)
+          {
+            if(connected_length < c->n)
+            {
+              connected[connected_length] = -1;
+            }
+            omfree (cans);
+            return connected;
+          }
+        }
       }
       con_checked++;
@@ -1200,50 +1156,50 @@
     else
     {
-      for (last_cans_pos++; last_cans_pos <= c->n; last_cans_pos++)
-      {
-	if (last_cans_pos == c->n)
-	{
-	  if (connected_length < c->n)
-	  {
-	    connected[connected_length] = -1;
-	  }
-	  omfree (cans);
-	  return connected;
-	}
-	if ((last_cans_pos == from) || (last_cans_pos == to))
-	  continue;
-	if (p_LmShortDivisibleBy
-	    (I->m[last_cans_pos], c->short_Exps[last_cans_pos], bound,
-	     neg_bounds_short, c->r))
-	{
-	  cans[cans_length] = last_cans_pos;
-	  cans_length++;
-	  break;
-	}
+      for(last_cans_pos++; last_cans_pos <= c->n; last_cans_pos++)
+      {
+        if(last_cans_pos == c->n)
+        {
+          if(connected_length < c->n)
+          {
+            connected[connected_length] = -1;
+          }
+          omfree (cans);
+          return connected;
+        }
+        if((last_cans_pos == from) || (last_cans_pos == to))
+          continue;
+        if(p_LmShortDivisibleBy
+           (I->m[last_cans_pos], c->short_Exps[last_cans_pos], bound,
+            neg_bounds_short, c->r))
+        {
+          cans[cans_length] = last_cans_pos;
+          cans_length++;
+          break;
+        }
       }
       not_yet_found++;
-      for (int i = 0; i < con_checked; i++)
-      {
-	if (has_t_rep (connected[i], last_cans_pos, c))
-	{
-	  connected[connected_length] = last_cans_pos;
-	  connected_length++;
-	  cans[cans_length - 1] = -1;
-	  --not_yet_found;
-	  if (connected[connected_length - 1] == to)
-	  {
-	    if (connected_length < c->n)
-	    {
-	      connected[connected_length] = -1;
-	    }
-	    omfree (cans);
-	    return connected;
-	  }
-	  break;
-	}
-      }
-    }
-  }
-  if (connected_length < c->n)
+      for(int i = 0; i < con_checked; i++)
+      {
+        if(has_t_rep (connected[i], last_cans_pos, c))
+        {
+          connected[connected_length] = last_cans_pos;
+          connected_length++;
+          cans[cans_length - 1] = -1;
+          --not_yet_found;
+          if(connected[connected_length - 1] == to)
+          {
+            if(connected_length < c->n)
+            {
+              connected[connected_length] = -1;
+            }
+            omfree (cans);
+            return connected;
+          }
+          break;
+        }
+      }
+    }
+  }
+  if(connected_length < c->n)
   {
     connected[connected_length] = -1;
@@ -1254,6 +1210,5 @@
 
 #ifdef HEAD_BIN
-static inline poly
-p_MoveHead (poly p, omBin b)
+static inline poly p_MoveHead (poly p, omBin b)
 {
   poly np;
@@ -1265,8 +1220,7 @@
 #endif
 
-static void
-replace_pair (int &i, int &j, slimgb_alg * c)
-{
-  if (i < 0)
+static void replace_pair (int &i, int &j, slimgb_alg * c)
+{
+  if(i < 0)
     return;
   c->soon_free = NULL;
@@ -1279,7 +1233,7 @@
   int *i_con = make_connections (i, j, lm, c);
 
-  for (int n = 0; ((n < c->n) && (i_con[n] >= 0)); n++)
-  {
-    if (i_con[n] == j)
+  for(int n = 0; ((n < c->n) && (i_con[n] >= 0)); n++)
+  {
+    if(i_con[n] == j)
     {
       now_t_rep (i, j, c);
@@ -1306,5 +1260,5 @@
 
   p_Delete (&lm, c->r);
-  if (c->T_deg_full)		//Sugar
+  if(c->T_deg_full)             //Sugar
   {
     int t_i = c->T_deg_full[i] - c->T_deg[i];
@@ -1314,24 +1268,24 @@
   }
 
-  for (int m = 0; ((m < c->n) && (i_con[m] >= 0)); m++)
-  {
-    if (c->T_deg_full != NULL)
+  for(int m = 0; ((m < c->n) && (i_con[m] >= 0)); m++)
+  {
+    if(c->T_deg_full != NULL)
     {
       int s1 = c->T_deg_full[i_con[m]] + syz_deg - c->T_deg[i_con[m]];
-      if (s1 > sugar)
-	continue;
-    }
-    if (c->weighted_lengths[i_con[m]] < c->weighted_lengths[i])
+      if(s1 > sugar)
+        continue;
+    }
+    if(c->weighted_lengths[i_con[m]] < c->weighted_lengths[i])
       i = i_con[m];
   }
-  for (int m = 0; ((m < c->n) && (j_con[m] >= 0)); m++)
-  {
-    if (c->T_deg_full != NULL)
+  for(int m = 0; ((m < c->n) && (j_con[m] >= 0)); m++)
+  {
+    if(c->T_deg_full != NULL)
     {
       int s1 = c->T_deg_full[j_con[m]] + syz_deg - c->T_deg[j_con[m]];
-      if (s1 > sugar)
-	continue;
-    }
-    if (c->weighted_lengths[j_con[m]] < c->weighted_lengths[j])
+      if(s1 > sugar)
+        continue;
+    }
+    if(c->weighted_lengths[j_con[m]] < c->weighted_lengths[j])
       j = j_con[m];
   }
@@ -1343,29 +1297,27 @@
 }
 
-static void
-add_later (poly p, const char *prot, slimgb_alg * c)
+static void add_later (poly p, const char *prot, slimgb_alg * c)
 {
   int i = 0;
   //check, if it is already in the queue
 
-  while (c->add_later->m[i] != NULL)
-  {
-    if (p_LmEqual (c->add_later->m[i], p, c->r))
+  while(c->add_later->m[i] != NULL)
+  {
+    if(p_LmEqual (c->add_later->m[i], p, c->r))
       return;
     i++;
   }
-  if (TEST_OPT_PROT)
+  if(TEST_OPT_PROT)
     PrintS (prot);
   c->add_later->m[i] = p;
 }
 
-static int
-simple_posInS (kStrategy strat, poly p, int len, wlen_type wlen)
-{
-  if (strat->sl == -1)
+static int simple_posInS (kStrategy strat, poly p, int len, wlen_type wlen)
+{
+  if(strat->sl == -1)
     return 0;
-  if (strat->lenSw)
+  if(strat->lenSw)
     return pos_helper (strat, p, (wlen_type) wlen, (wlen_set) strat->lenSw,
-		       strat->S);
+                       strat->S);
   return pos_helper (strat, p, len, strat->lenS, strat->S);
 }
@@ -1379,9 +1331,9 @@
 {
   assume (p_sev == pGetShortExpVector (p));
-  if (!pLmShortDivisibleBy (p, p_sev, strat->S[*at], ~strat->sevS[*at]))
+  if(!pLmShortDivisibleBy (p, p_sev, strat->S[*at], ~strat->sevS[*at]))
     return;
-  if (l >= strat->lenS[*at])
+  if(l >= strat->lenS[*at])
     return;
-  if (TEST_OPT_PROT)
+  if(TEST_OPT_PROT)
     PrintS ("!");
   mflush ();
@@ -1393,6 +1345,5 @@
 }
 
-static int
-iq_crit (const void *ap, const void *bp)
+static int iq_crit (const void *ap, const void *bp)
 {
   sorted_pair_node *a = *((sorted_pair_node **) ap);
@@ -1401,26 +1352,25 @@
   assume (b->i > b->j);
 
-  if (a->deg < b->deg)
+  if(a->deg < b->deg)
     return -1;
-  if (a->deg > b->deg)
+  if(a->deg > b->deg)
     return 1;
   int comp = pLmCmp (a->lcm_of_lm, b->lcm_of_lm);
-  if (comp != 0)
+  if(comp != 0)
     return comp;
-  if (a->expected_length < b->expected_length)
+  if(a->expected_length < b->expected_length)
     return -1;
-  if (a->expected_length > b->expected_length)
+  if(a->expected_length > b->expected_length)
     return 1;
-  if (a->j > b->j)
+  if(a->j > b->j)
     return 1;
-  if (a->j < b->j)
+  if(a->j < b->j)
     return -1;
   return 0;
 }
 
-static wlen_type
-coeff_mult_size_estimate (int s1, int s2, ring r)
-{
-  if (rField_is_Q (r))
+static wlen_type coeff_mult_size_estimate (int s1, int s2, ring r)
+{
+  if(rField_is_Q (r))
     return s1 + s2;
   else
@@ -1428,8 +1378,7 @@
 }
 
-static wlen_type
-pair_weighted_length (int i, int j, slimgb_alg * c)
-{
-  if ((c->isDifficultField) && (c->eliminationProblem))
+static wlen_type pair_weighted_length (int i, int j, slimgb_alg * c)
+{
+  if((c->isDifficultField) && (c->eliminationProblem))
   {
     int c1 = slim_nsize (p_GetCoeff (c->S->m[i], c->r), c->r);
@@ -1448,15 +1397,15 @@
 
   }
-  if (c->isDifficultField)
+  if(c->isDifficultField)
   {
     //int cs=slim_nsize(p_GetCoeff(c->S->m[i],c->r),c->r)+
     //    slim_nsize(p_GetCoeff(c->S->m[j],c->r),c->r);
-    if (!(TEST_V_COEFSTRAT))
+    if(!(TEST_V_COEFSTRAT))
     {
       wlen_type cs =
-	coeff_mult_size_estimate (slim_nsize
-				  (p_GetCoeff (c->S->m[i], c->r), c->r),
-				  slim_nsize (p_GetCoeff (c->S->m[j], c->r),
-					      c->r), c->r);
+        coeff_mult_size_estimate (slim_nsize
+                                  (p_GetCoeff (c->S->m[i], c->r), c->r),
+                                  slim_nsize (p_GetCoeff (c->S->m[j], c->r),
+                                              c->r), c->r);
       return (wlen_type) (c->lengths[i] + c->lengths[j] - 2) * (wlen_type) cs;
     }
@@ -1465,13 +1414,13 @@
 
       wlen_type cs =
-	coeff_mult_size_estimate (slim_nsize
-				  (p_GetCoeff (c->S->m[i], c->r), c->r),
-				  slim_nsize (p_GetCoeff (c->S->m[j], c->r),
-					      c->r), c->r);
+        coeff_mult_size_estimate (slim_nsize
+                                  (p_GetCoeff (c->S->m[i], c->r), c->r),
+                                  slim_nsize (p_GetCoeff (c->S->m[j], c->r),
+                                              c->r), c->r);
       cs *= cs;
       return (wlen_type) (c->lengths[i] + c->lengths[j] - 2) * (wlen_type) cs;
     }
   }
-  if (c->eliminationProblem)
+  if(c->eliminationProblem)
   {
 
@@ -1482,23 +1431,23 @@
 }
 
-sorted_pair_node **
-add_to_basis_ideal_quotient (poly h, slimgb_alg * c, int *ip)
+sorted_pair_node **add_to_basis_ideal_quotient (poly h, slimgb_alg * c,
+                                                int *ip)
 {
   p_Test (h, c->r);
   assume (h != NULL);
   poly got = gcd_of_terms (h, c->r);
-  if ((got != NULL) && (TEST_V_UPTORADICAL))
+  if((got != NULL) && (TEST_V_UPTORADICAL))
   {
     poly copy = p_Copy (got, c->r);
     //p_wrp(got,c->r);
     BOOLEAN changed = monomial_root (got, c->r);
-    if (changed)
+    if(changed)
     {
       poly div_by = pDivide (copy, got);
       poly iter = h;
-      while (iter)
-      {
-	pExpVectorSub (iter, div_by);
-	pIter (iter);
+      while(iter)
+      {
+        pExpVectorSub (iter, div_by);
+        pIter (iter);
       }
       p_Delete (&div_by, c->r);
@@ -1519,5 +1468,5 @@
     (sorted_pair_node **) omalloc (sizeof (sorted_pair_node *) * i);
   int spc = 0;
-  if (c->n > c->array_lengths)
+  if(c->n > c->array_lengths)
   {
     c->array_lengths = c->array_lengths * 2;
@@ -1542,8 +1491,8 @@
   }
   pEnlargeSet (&c->S->m, c->n - 1, 1);
-  if (c->T_deg_full)
+  if(c->T_deg_full)
     ENLARGE (c->T_deg_full, int);
   sugar = c->T_deg[i] = c->pTotaldegree (h);
-  if (c->T_deg_full)
+  if(c->T_deg_full)
   {
     sugar = c->T_deg_full[i] = c->pTotaldegree_full (h);
@@ -1559,5 +1508,5 @@
   //necessary for correct weighted length
 
-  if (!rField_is_Zp (c->r))
+  if(!rField_is_Zp (c->r))
   {
     p_Cleardenom (h, c->r);
@@ -1579,5 +1528,5 @@
 
 #else
-  if (i > 0)
+  if(i > 0)
     c->states[i] = (char *) omalloc (i * sizeof (char));
   else
@@ -1590,7 +1539,7 @@
 
 #undef ENLARGE
-  if (p_GetComp (h, currRing) <= c->syz_comp)
-  {
-    for (j = 0; j < i; j++)
+  if(p_GetComp (h, currRing) <= c->syz_comp)
+  {
+    for(j = 0; j < i; j++)
     {
 
@@ -1600,42 +1549,42 @@
 #endif
       assume (p_LmDivisibleBy (c->S->m[i], c->S->m[j], c->r) ==
-	      p_LmShortDivisibleBy (c->S->m[i], c->short_Exps[i], c->S->m[j],
-				    ~(c->short_Exps[j]), c->r));
-
-      if (_p_GetComp (c->S->m[i], c->r) != _p_GetComp (c->S->m[j], c->r))
-      {
-	//c->states[i][j]=UNCALCULATED;
-	//WARNUNG: be careful
-	continue;
-      }
-      else if ((!c->nc) && (c->lengths[i] == 1) && (c->lengths[j] == 1))
-      {
-	c->states[i][j] = HASTREP;
-      }
-      else if (((!c->nc) || (c->is_homog && rIsSCA (c->r)))
-	       && (pHasNotCF (c->S->m[i], c->S->m[j])))
+              p_LmShortDivisibleBy (c->S->m[i], c->short_Exps[i], c->S->m[j],
+                                    ~(c->short_Exps[j]), c->r));
+
+      if(_p_GetComp (c->S->m[i], c->r) != _p_GetComp (c->S->m[j], c->r))
+      {
+        //c->states[i][j]=UNCALCULATED;
+        //WARNUNG: be careful
+        continue;
+      }
+      else if((!c->nc) && (c->lengths[i] == 1) && (c->lengths[j] == 1))
+      {
+        c->states[i][j] = HASTREP;
+      }
+      else if(((!c->nc) || (c->is_homog && rIsSCA (c->r)))
+              && (pHasNotCF (c->S->m[i], c->S->m[j])))
 //     else if ((!(c->nc)) &&  (pHasNotCF(c->S->m[i],c->S->m[j])))
       {
-	c->easy_product_crit++;
-	c->states[i][j] = HASTREP;
-	continue;
+        c->easy_product_crit++;
+        c->states[i][j] = HASTREP;
+        continue;
       }
       else
-	if (extended_product_criterion
-	    (c->S->m[i], c->gcd_of_terms[i], c->S->m[j], c->gcd_of_terms[j],
-	     c))
-      {
-	c->states[i][j] = HASTREP;
-	c->extended_product_crit++;
-	//PrintS("E");
+        if(extended_product_criterion
+           (c->S->m[i], c->gcd_of_terms[i], c->S->m[j], c->gcd_of_terms[j],
+            c))
+      {
+        c->states[i][j] = HASTREP;
+        c->extended_product_crit++;
+        //PrintS("E");
       }
       //  if (c->states[i][j]==UNCALCULATED)
       //  {
 
-      if ((TEST_V_FINDMONOM) && (!c->nc))
-      {
-	//PrintS("COMMU");
-	//  if (c->lengths[i]==c->lengths[j])
-	//  {
+      if((TEST_V_FINDMONOM) && (!c->nc))
+      {
+        //PrintS("COMMU");
+        //  if (c->lengths[i]==c->lengths[j])
+        //  {
 //             poly short_s=ksCreateShortSpoly(c->S->m[i],c->S->m[j],c->r);
 //             if (short_s==NULL)
@@ -1648,64 +1597,64 @@
 //             }
 //         }
-	if (c->lengths[i] + c->lengths[j] == 3)
-	{
-
-
-	  poly short_s = ksCreateShortSpoly (c->S->m[i], c->S->m[j], c->r);
-	  if (short_s == NULL)
-	  {
-	    c->states[i][j] = HASTREP;
-	  }
-	  else
-	  {
-	    assume (pLength (short_s) == 1);
-	    if (TEST_V_UPTORADICAL)
-	      monomial_root (short_s, c->r);
-	    int iS =
-	      kFindDivisibleByInS_easy (c->strat, short_s,
-					p_GetShortExpVector (short_s, c->r));
-	    if (iS < 0)
-	    {
-	      //PrintS("N");
-	      if (TRUE)
-	      {
-		c->states[i][j] = HASTREP;
-		add_later (short_s, "N", c);
-	      }
-	      else
-		p_Delete (&short_s, currRing);
-	    }
-	    else
-	    {
-	      if (c->strat->lenS[iS] > 1)
-	      {
-		//PrintS("O");
-		if (TRUE)
-		{
-		  c->states[i][j] = HASTREP;
-		  add_later (short_s, "O", c);
-		}
-		else
-		  p_Delete (&short_s, currRing);
-	      }
-	      else
-		p_Delete (&short_s, currRing);
-	      c->states[i][j] = HASTREP;
-	    }
-
-
-	  }
-	}
+        if(c->lengths[i] + c->lengths[j] == 3)
+        {
+
+
+          poly short_s = ksCreateShortSpoly (c->S->m[i], c->S->m[j], c->r);
+          if(short_s == NULL)
+          {
+            c->states[i][j] = HASTREP;
+          }
+          else
+          {
+            assume (pLength (short_s) == 1);
+            if(TEST_V_UPTORADICAL)
+              monomial_root (short_s, c->r);
+            int iS = kFindDivisibleByInS_easy (c->strat, short_s,
+                                               p_GetShortExpVector (short_s,
+                                                                    c->r));
+            if(iS < 0)
+            {
+              //PrintS("N");
+              if(TRUE)
+              {
+                c->states[i][j] = HASTREP;
+                add_later (short_s, "N", c);
+              }
+              else
+                p_Delete (&short_s, currRing);
+            }
+            else
+            {
+              if(c->strat->lenS[iS] > 1)
+              {
+                //PrintS("O");
+                if(TRUE)
+                {
+                  c->states[i][j] = HASTREP;
+                  add_later (short_s, "O", c);
+                }
+                else
+                  p_Delete (&short_s, currRing);
+              }
+              else
+                p_Delete (&short_s, currRing);
+              c->states[i][j] = HASTREP;
+            }
+
+
+          }
+        }
       }
       //    if (short_s)
       //    {
       assume (spc <= j);
-      sorted_pair_node *s = c->tmp_spn[spc];	//(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
+      sorted_pair_node *s = c->tmp_spn[spc];    //(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
       s->i = si_max (i, j);
       s->j = si_min (i, j);
       assume (s->j == j);
-      s->expected_length = pair_weighted_length (i, j, c);	//c->lengths[i]+c->lengths[j]-2;
-
-      poly lm = c->tmp_pair_lm[spc];	//=pOne_Special();
+      s->expected_length = pair_weighted_length (i, j, c);      //c->lengths[i]+c->lengths[j]-2;
+
+      poly lm = c->tmp_pair_lm[spc];    //=pOne_Special();
 
       pLcm (c->S->m[i], c->S->m[j], lm);
@@ -1714,10 +1663,10 @@
       s->deg = c->pTotaldegree (lm);
 
-      if (c->T_deg_full)	//Sugar
-      {
-	int t_i = c->T_deg_full[s->i] - c->T_deg[s->i];
-	int t_j = c->T_deg_full[s->j] - c->T_deg[s->j];
-	s->deg += si_max (t_i, t_j);
-	//Print("\n max: %d\n",max(t_i,t_j));
+      if(c->T_deg_full)         //Sugar
+      {
+        int t_i = c->T_deg_full[s->i] - c->T_deg[s->i];
+        int t_j = c->T_deg_full[s->j] - c->T_deg[s->j];
+        s->deg += si_max (t_i, t_j);
+        //Print("\n max: %d\n",max(t_i,t_j));
       }
       p_Test (lm, c->r);
@@ -1734,5 +1683,5 @@
       //}
     }
-  }				//if syz_comp end
+  }                             //if syz_comp end
 
   assume (spc <= i);
@@ -1744,38 +1693,38 @@
   int spc_final = 0;
   j = 0;
-  while (j < spc)
+  while(j < spc)
   {
     int lower = j;
     int upper;
     BOOLEAN has = FALSE;
-    for (upper = lower + 1; upper < spc; upper++)
-    {
-      if (!pLmEqual (nodes[lower]->lcm_of_lm, nodes[upper]->lcm_of_lm))
-      {
-	break;
-      }
-      if (has_t_rep (nodes[upper]->i, nodes[upper]->j, c))
-	has = TRUE;
+    for(upper = lower + 1; upper < spc; upper++)
+    {
+      if(!pLmEqual (nodes[lower]->lcm_of_lm, nodes[upper]->lcm_of_lm))
+      {
+        break;
+      }
+      if(has_t_rep (nodes[upper]->i, nodes[upper]->j, c))
+        has = TRUE;
     }
     upper = upper - 1;
     int z;
     assume (spc_final <= j);
-    for (z = 0; z < spc_final; z++)
-    {
-      if (p_LmDivisibleBy
-	  (nodes_final[z]->lcm_of_lm, nodes[lower]->lcm_of_lm, c->r))
-      {
-	has = TRUE;
-	break;
-      }
-    }
-
-    if (has)
-    {
-      for (; lower <= upper; lower++)
-      {
-	//free_sorted_pair_node(nodes[lower],c->r);
-	//omfree(nodes[lower]);
-	nodes[lower] = NULL;
+    for(z = 0; z < spc_final; z++)
+    {
+      if(p_LmDivisibleBy
+         (nodes_final[z]->lcm_of_lm, nodes[lower]->lcm_of_lm, c->r))
+      {
+        has = TRUE;
+        break;
+      }
+    }
+
+    if(has)
+    {
+      for(; lower <= upper; lower++)
+      {
+        //free_sorted_pair_node(nodes[lower],c->r);
+        //omfree(nodes[lower]);
+        nodes[lower] = NULL;
       }
       j = upper + 1;
@@ -1787,16 +1736,16 @@
       nodes[lower]->lcm_of_lm = pCopy (nodes[lower]->lcm_of_lm);
       assume (_p_GetComp (c->S->m[nodes[lower]->i], c->r) ==
-	      _p_GetComp (c->S->m[nodes[lower]->j], c->r));
+              _p_GetComp (c->S->m[nodes[lower]->j], c->r));
       nodes_final[spc_final] =
-	(sorted_pair_node *) omalloc (sizeof (sorted_pair_node));
+        (sorted_pair_node *) omalloc (sizeof (sorted_pair_node));
 
       *(nodes_final[spc_final++]) = *(nodes[lower]);
       //c->tmp_spn[nodes[lower]->j]=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
       nodes[lower] = NULL;
-      for (lower = lower + 1; lower <= upper; lower++)
-      {
-	//  free_sorted_pair_node(nodes[lower],c->r);
-	//omfree(nodes[lower]);
-	nodes[lower] = NULL;
+      for(lower = lower + 1; lower <= upper; lower++)
+      {
+        //  free_sorted_pair_node(nodes[lower],c->r);
+        //omfree(nodes[lower]);
+        nodes[lower] = NULL;
       }
       j = upper + 1;
@@ -1813,7 +1762,7 @@
   add_to_reductors (c, h, c->lengths[c->n - 1], ecart, TRUE);
   //i=posInS(c->strat,c->strat->sl,h,0 ecart);
-  if (!(c->nc))
-  {
-    if (c->lengths[c->n - 1] == 1)
+  if(!(c->nc))
+  {
+    if(c->lengths[c->n - 1] == 1)
       shorten_tails (c, c->S->m[c->n - 1]);
   }
@@ -1822,5 +1771,5 @@
   //for(i=c->strat->sl; i>0;i--)
   //  if(c->strat->lenS[i]<c->strat->lenS[i-1]) printf("fehler bei %d\n",i);
-  if (c->Rcounter > 50)
+  if(c->Rcounter > 50)
   {
     c->Rcounter = 0;
@@ -1831,9 +1780,9 @@
   // for SCA:
   // here write at the end of nodes_final[spc_final,...,spc_final+lmdeg-1]
-  if (rIsSCA (c->r))
+  if(rIsSCA (c->r))
   {
     const poly pNext = pNext (h);
 
-    if (pNext != NULL)
+    if(pNext != NULL)
     {
       // for additional polynomials
@@ -1841,27 +1790,27 @@
       const unsigned int m_iLastAltVar = scaLastAltVar (c->r);
 
-      int N =			// c->r->N;
-	m_iLastAltVar - m_iFirstAltVar + 1;	// should be enough
+      int N =                   // c->r->N;
+        m_iLastAltVar - m_iFirstAltVar + 1;     // should be enough
       // TODO: but we may also use got = gcd({m}_{m\in f}))!
 
-      poly *array_arg = (poly *) omalloc (N * sizeof (poly));	// !
+      poly *array_arg = (poly *) omalloc (N * sizeof (poly));   // !
       int j = 0;
 
 
-      for (unsigned short v = m_iFirstAltVar; v <= m_iLastAltVar; v++)
-	// for all x_v | Ann(lm(h))
-	if (p_GetExp (h, v, c->r))	// TODO: use 'got' here!
-	{
-	  assume (p_GetExp (h, v, c->r) == 1);
-
-	  poly p = sca_pp_Mult_xi_pp (v, pNext, c->r);	// x_v * h;
-
-	  if (p != NULL)	// if (x_v * h != 0)
-	    array_arg[j++] = p;
-	}			// for all x_v | Ann(lm(h))
+      for(unsigned short v = m_iFirstAltVar; v <= m_iLastAltVar; v++)
+        // for all x_v | Ann(lm(h))
+        if(p_GetExp (h, v, c->r))       // TODO: use 'got' here!
+        {
+          assume (p_GetExp (h, v, c->r) == 1);
+
+          poly p = sca_pp_Mult_xi_pp (v, pNext, c->r);  // x_v * h;
+
+          if(p != NULL)         // if (x_v * h != 0)
+            array_arg[j++] = p;
+        }                       // for all x_v | Ann(lm(h))
 
       c->introduceDelayedPairs (array_arg, j);
 
-      omfree (array_arg);	// !!!
+      omfree (array_arg);       // !!!
     }
 //     PrintS("Saturation - done!!!\n");
@@ -1870,8 +1819,8 @@
 
 
-  if (!ip)
+  if(!ip)
   {
     qsort (nodes_final, spc_final, sizeof (sorted_pair_node *),
-	   tgb_pair_better_gen2);
+           tgb_pair_better_gen2);
 
 
@@ -1889,14 +1838,13 @@
 }
 
-static poly
-redNF2 (poly h, slimgb_alg * c, int &len, number & m, int n)
+static poly redNF2 (poly h, slimgb_alg * c, int &len, number & m, int n)
 {
   m = nInit (1);
-  if (h == NULL)
+  if(h == NULL)
     return NULL;
 
   assume (len == pLength (h));
   kStrategy strat = c->strat;
-  if (0 > strat->sl)
+  if(0 > strat->sl)
   {
     return h;
@@ -1920,22 +1868,22 @@
     j = kFindDivisibleByInS_easy (strat, P.p, P.sev);
     //j=kFindDivisibleByInS(strat,&dummy,&P);
-    if ((j >= 0) && ((!n) ||
-		     ((strat->lenS[j] <= n) &&
-		      ((strat->lenSw == NULL) || (strat->lenSw[j] <= n)))))
+    if((j >= 0) && ((!n) ||
+                    ((strat->lenS[j] <= n) &&
+                     ((strat->lenSw == NULL) || (strat->lenSw[j] <= n)))))
     {
       nNormalize (pGetCoeff (P.p));
 #ifdef KDEBUG
-      if (TEST_OPT_DEBUG)
-      {
-	PrintS ("red:");
-	wrp (h);
-	PrintS (" with ");
-	wrp (strat->S[j]);
+      if(TEST_OPT_DEBUG)
+      {
+        PrintS ("red:");
+        wrp (h);
+        PrintS (" with ");
+        wrp (strat->S[j]);
       }
 #endif
 
       number coef = kBucketPolyRed (P.bucket, strat->S[j],
-				    strat->lenS[j] /*pLength(strat->S[j]) */ ,
-				    strat->kNoether);
+                                    strat->lenS[j] /*pLength(strat->S[j]) */ ,
+                                    strat->kNoether);
       number m2 = nMult (m, coef);
       nDelete (&m);
@@ -1944,9 +1892,9 @@
       h = kBucketGetLm (P.bucket);
 
-      if (h == NULL)
-      {
-	len = 0;
-	kBucketDestroy (&P.bucket);
-	return NULL;
+      if(h == NULL)
+      {
+        len = 0;
+        kBucketDestroy (&P.bucket);
+        return NULL;
       }
       P.p = h;
@@ -1954,9 +1902,9 @@
       P.SetShortExpVector ();
 #ifdef KDEBUG
-      if (TEST_OPT_DEBUG)
-      {
-	PrintS ("\nto:");
-	wrp (h);
-	PrintLn ();
+      if(TEST_OPT_DEBUG)
+      {
+        PrintS ("\nto:");
+        wrp (h);
+        PrintLn ();
       }
 #endif
@@ -1973,10 +1921,9 @@
 }
 
-static poly
-redTailShort (poly h, kStrategy strat)
-{
-  if (h == NULL)
-    return NULL;		//n_Init(1,currRing);
-  if (TEST_V_MODPSOLVSB)
+static poly redTailShort (poly h, kStrategy strat)
+{
+  if(h == NULL)
+    return NULL;                //n_Init(1,currRing);
+  if(TEST_V_MODPSOLVSB)
   {
     bit_reduce (pNext (h), strat->tailRing);
@@ -1984,8 +1931,8 @@
   int i;
   int len = pLength (h);
-  for (i = 0; i <= strat->sl; i++)
-  {
-    if ((strat->lenS[i] > 2)
-	|| ((strat->lenSw != NULL) && (strat->lenSw[i] > 2)))
+  for(i = 0; i <= strat->sl; i++)
+  {
+    if((strat->lenS[i] > 2)
+       || ((strat->lenSw != NULL) && (strat->lenSw[i] > 2)))
       break;
   }
@@ -1993,42 +1940,40 @@
 }
 
-static void
-line_of_extended_prod (int fixpos, slimgb_alg * c)
-{
-  if (c->gcd_of_terms[fixpos] == NULL)
+static void line_of_extended_prod (int fixpos, slimgb_alg * c)
+{
+  if(c->gcd_of_terms[fixpos] == NULL)
   {
     c->gcd_of_terms[fixpos] = gcd_of_terms (c->S->m[fixpos], c->r);
-    if (c->gcd_of_terms[fixpos])
+    if(c->gcd_of_terms[fixpos])
     {
       int i;
-      for (i = 0; i < fixpos; i++)
-	if ((c->states[fixpos][i] != HASTREP)
-	    &&
-	    (extended_product_criterion
-	     (c->S->m[fixpos], c->gcd_of_terms[fixpos], c->S->m[i],
-	      c->gcd_of_terms[i], c)))
-	{
-	  c->states[fixpos][i] = HASTREP;
-	  c->extended_product_crit++;
-	}
-      for (i = fixpos + 1; i < c->n; i++)
-	if ((c->states[i][fixpos] != HASTREP)
-	    &&
-	    (extended_product_criterion
-	     (c->S->m[fixpos], c->gcd_of_terms[fixpos], c->S->m[i],
-	      c->gcd_of_terms[i], c)))
-	{
-	  c->states[i][fixpos] = HASTREP;
-	  c->extended_product_crit++;
-	}
-    }
-  }
-}
-
-static void
-c_S_element_changed_hook (int pos, slimgb_alg * c)
+      for(i = 0; i < fixpos; i++)
+        if((c->states[fixpos][i] != HASTREP)
+           &&
+           (extended_product_criterion
+            (c->S->m[fixpos], c->gcd_of_terms[fixpos], c->S->m[i],
+             c->gcd_of_terms[i], c)))
+        {
+          c->states[fixpos][i] = HASTREP;
+          c->extended_product_crit++;
+        }
+      for(i = fixpos + 1; i < c->n; i++)
+        if((c->states[i][fixpos] != HASTREP)
+           &&
+           (extended_product_criterion
+            (c->S->m[fixpos], c->gcd_of_terms[fixpos], c->S->m[i],
+             c->gcd_of_terms[i], c)))
+        {
+          c->states[i][fixpos] = HASTREP;
+          c->extended_product_crit++;
+        }
+    }
+  }
+}
+
+static void c_S_element_changed_hook (int pos, slimgb_alg * c)
 {
   length_one_crit (c, pos, c->lengths[pos]);
-  if (!c->nc)
+  if(!c->nc)
     line_of_extended_prod (pos, c);
 }
@@ -2041,5 +1986,5 @@
   poly_tree_node *r;
   int n;
-    poly_tree_node (int sn):l (NULL), r (NULL), n (sn)
+  poly_tree_node (int sn):l (NULL), r (NULL), n (sn)
   {
   }
@@ -2051,18 +1996,17 @@
   int n;
   int get_n (poly p);
-    exp_number_builder ():top_level (0), n (0)
+  exp_number_builder ():top_level (0), n (0)
   {
   }
 };
-int
-exp_number_builder::get_n (poly p)
+int exp_number_builder::get_n (poly p)
 {
   poly_tree_node **node = &top_level;
-  while (*node != NULL)
+  while(*node != NULL)
   {
     int c = pLmCmp (p, (*node)->p);
-    if (c == 0)
+    if(c == 0)
       return (*node)->n;
-    if (c == -1)
+    if(c == -1)
       node = &((*node)->r);
     else
@@ -2087,8 +2031,7 @@
 
 //! obsolete
-void
-t2ippa_rec (poly * ip, int *ia, poly_tree_node * k, int &offset)
-{
-  if (!k)
+void t2ippa_rec (poly * ip, int *ia, poly_tree_node * k, int &offset)
+{
+  if(!k)
     return;
   t2ippa_rec (ip, ia, k->l, offset);
@@ -2102,6 +2045,5 @@
 
 //! obsolete
-void
-t2ippa (poly * ip, int *ia, exp_number_builder & e)
+void t2ippa (poly * ip, int *ia, exp_number_builder & e)
 {
 
@@ -2110,37 +2052,33 @@
 }
 
-int
-anti_poly_order (const void *a, const void *b)
+int anti_poly_order (const void *a, const void *b)
 {
   return -pLmCmp (((int_poly_pair *) a)->p, ((int_poly_pair *) b)->p);
 }
 
-BOOLEAN
-is_valid_ro (red_object & ro)
+BOOLEAN is_valid_ro (red_object & ro)
 {
   red_object r2 = ro;
   ro.validate ();
-  if ((r2.p != ro.p) || (r2.sev != ro.sev))
+  if((r2.p != ro.p) || (r2.sev != ro.sev))
     return FALSE;
   return TRUE;
 }
 
-int
-terms_sort_crit (const void *a, const void *b)
+int terms_sort_crit (const void *a, const void *b)
 {
   return -pLmCmp (*((poly *) a), *((poly *) b));
 }
 
-#if 0				// currently unused
-static void
-unify_terms (poly * terms, int &sum)
-{
-  if (sum == 0)
+#if 0                           // currently unused
+static void unify_terms (poly * terms, int &sum)
+{
+  if(sum == 0)
     return;
   int last = 0;
   int curr = 1;
-  while (curr < sum)
-  {
-    if (!(pLmEqual (terms[curr], terms[last])))
+  while(curr < sum)
+  {
+    if(!(pLmEqual (terms[curr], terms[last])))
     {
       terms[++last] = terms[curr];
@@ -2151,8 +2089,8 @@
 }
 #endif
-#if 0				// currently unused
+#if 0                           // currently unused
 static void
 export_mat (number * number_array, int pn, int tn, const char *format_str,
-	    int mat_nr)
+            int mat_nr)
 {
   char matname[20];
@@ -2161,16 +2099,16 @@
   int i, j;
   fprintf (out, "mat=[\n");
-  for (i = 0; i < pn; i++)
+  for(i = 0; i < pn; i++)
   {
     fprintf (out, "[\n");
-    for (j = 0; j < tn; j++)
-    {
-      if (j > 0)
-      {
-	fprintf (out, ", ");
+    for(j = 0; j < tn; j++)
+    {
+      if(j > 0)
+      {
+        fprintf (out, ", ");
       }
       fprintf (out, "%i", npInt (number_array[i * tn + j], currRing));
     }
-    if (i < pn - 1)
+    if(i < pn - 1)
       fprintf (out, "],\n");
     else
@@ -2188,5 +2126,5 @@
 static void
 linalg_step_modp (poly * p, poly * p_out, int &pn, poly * terms, int tn,
-		  slimgb_alg * c)
+                  slimgb_alg * c)
 {
   static int export_n = 0;
@@ -2194,14 +2132,14 @@
   assume (rField_is_Zp (c->r));
   //I don't do deletes, copies of number_types ...
-  const number_type zero = 0;	//npInit(0);
+  const number_type zero = 0;   //npInit(0);
   int array_size = pn * tn;
   number_type *number_array =
     (number_type *) omalloc (pn * tn * sizeof (number_type));
   int i;
-  for (i = 0; i < array_size; i++)
+  for(i = 0; i < array_size; i++)
   {
     number_array[i] = zero;
   }
-  for (i = 0; i < pn; i++)
+  for(i = 0; i < pn; i++)
   {
     poly h = p[i];
@@ -2218,5 +2156,5 @@
   int act_row = 0;
   int p_pos = 0;
-  for (i = 0; i < pn; i++)
+  for(i = 0; i < pn; i++)
   {
     poly h = NULL;
@@ -2226,5 +2164,5 @@
     h = row_to_poly (row, terms, tn, c->r);
 
-    if (h != NULL)
+    if(h != NULL)
     {
       p_out[p_pos++] = h;
@@ -2233,5 +2171,5 @@
   pn = p_pos;
   //assert(p_pos==rank)
-  while (p_pos < pn)
+  while(p_pos < pn)
   {
     p_out[p_pos++] = NULL;
@@ -2243,6 +2181,5 @@
 #endif
 #endif
-static void
-mass_add (poly * p, int pn, slimgb_alg * c)
+static void mass_add (poly * p, int pn, slimgb_alg * c)
 {
   int j;
@@ -2250,5 +2187,5 @@
   sorted_pair_node ***sbuf =
     (sorted_pair_node ***) omalloc (pn * sizeof (sorted_pair_node **));
-  for (j = 0; j < pn; j++)
+  for(j = 0; j < pn; j++)
   {
     p_Test (p[j], c->r);
@@ -2256,5 +2193,5 @@
   }
   int sum = 0;
-  for (j = 0; j < pn; j++)
+  for(j = 0; j < pn; j++)
   {
     sum += ibuf[j];
@@ -2263,8 +2200,8 @@
     (sorted_pair_node **) omalloc (sum * sizeof (sorted_pair_node *));
   int partsum = 0;
-  for (j = 0; j < pn; j++)
+  for(j = 0; j < pn; j++)
   {
     memmove (big_sbuf + partsum, sbuf[j],
-	     ibuf[j] * sizeof (sorted_pair_node *));
+             ibuf[j] * sizeof (sorted_pair_node *));
     omfree (sbuf[j]);
     partsum += ibuf[j];
@@ -2281,5 +2218,5 @@
 #ifdef TGB_DEBUG
   int z;
-  for (z = 1; z <= c->pair_top; z++)
+  for(z = 1; z <= c->pair_top; z++)
   {
     assume (pair_better (c->apairs[z], c->apairs[z - 1], c));
@@ -2291,11 +2228,10 @@
 #ifdef NORO_CACHE
 #ifndef NORO_NON_POLY
-void
-NoroCache::evaluateRows ()
+void NoroCache::evaluateRows ()
 {
   //after that can evaluate placeholders
   int i;
   buffer = (number *) omalloc (nIrreducibleMonomials * sizeof (number));
-  for (i = 0; i < root.branches_len; i++)
+  for(i = 0; i < root.branches_len; i++)
   {
     evaluateRows (1, root.branches[i]);
@@ -2305,14 +2241,13 @@
 }
 
-void
-NoroCache::evaluateRows (int level, NoroCacheNode * node)
+void NoroCache::evaluateRows (int level, NoroCacheNode * node)
 {
   assume (level >= 0);
-  if (node == NULL)
+  if(node == NULL)
     return;
-  if (level < pVariables)
+  if(level < pVariables)
   {
     int i, sum;
-    for (i = 0; i < node->branches_len; i++)
+    for(i = 0; i < node->branches_len; i++)
     {
       evaluateRows (level + 1, node->branches[i]);
@@ -2322,5 +2257,5 @@
   {
     DataNoroCacheNode *dn = (DataNoroCacheNode *) node;
-    if (dn->value_len != backLinkCode)
+    if(dn->value_len != backLinkCode)
     {
       poly p = dn->value_poly;
@@ -2330,25 +2265,25 @@
       memset (buffer, 0, sizeof (number) * nIrreducibleMonomials);
 
-      if (p == NULL)
-      {
-	row->array = NULL;
-	row->begin = 0;
-	row->end = 0;
-	return;
+      if(p == NULL)
+      {
+        row->array = NULL;
+        row->begin = 0;
+        row->end = 0;
+        return;
       }
       int i = 0;
       int idx;
       number *a = buffer;
-      while (p)
-      {
-	DataNoroCacheNode *ref = getCacheReference (p);
-
-	idx = ref->term_index;
-	assume (idx >= 0);
-	a[idx] = p_GetCoeff (p, currRing);
-	if (i == 0)
-	  row->begin = idx;
-	i++;
-	pIter (p);
+      while(p)
+      {
+        DataNoroCacheNode *ref = getCacheReference (p);
+
+        idx = ref->term_index;
+        assume (idx >= 0);
+        a[idx] = p_GetCoeff (p, currRing);
+        if(i == 0)
+          row->begin = idx;
+        i++;
+        pIter (p);
       }
       row->end = idx + 1;
@@ -2362,18 +2297,18 @@
       SparseRow *row = dn->row;
       int i = 0;
-      while (p)
-      {
-	DataNoroCacheNode *ref = getCacheReference (p);
-
-	int idx = ref->term_index;
-	assume (idx >= 0);
-	row->idx_array[i] = idx;
-	row->coef_array[i] = p_GetCoeff (p, currRing);
-	i++;
-	pIter (p);
-      }
-      if (i != dn->value_len)
-      {
-	PrintS ("F4 calc wrong, as poly len was wrong\n");
+      while(p)
+      {
+        DataNoroCacheNode *ref = getCacheReference (p);
+
+        int idx = ref->term_index;
+        assume (idx >= 0);
+        row->idx_array[i] = idx;
+        row->coef_array[i] = p_GetCoeff (p, currRing);
+        i++;
+        pIter (p);
+      }
+      if(i != dn->value_len)
+      {
+        PrintS ("F4 calc wrong, as poly len was wrong\n");
       }
       assume (i == dn->value_len);
@@ -2384,15 +2319,15 @@
 
 void
-NoroCache::evaluatePlaceHolder (number * row,
-				std::vector < NoroPlaceHolder >
-				&place_holders)
+  NoroCache::evaluatePlaceHolder (number * row,
+                                  std::vector < NoroPlaceHolder >
+                                  &place_holders)
 {
   int i;
   int s = place_holders.size ();
-  for (i = 0; i < s; i++)
+  for(i = 0; i < s; i++)
   {
     DataNoroCacheNode *ref = place_holders[i].ref;
     number coef = place_holders[i].coef;
-    if (ref->value_len == backLinkCode)
+    if(ref->value_len == backLinkCode)
     {
       row[ref->term_index] = npAddM (row[ref->term_index], coef);
@@ -2402,44 +2337,44 @@
 #ifndef NORO_SPARSE_ROWS_PRE
       DenseRow *ref_row = ref->row;
-      if (ref_row == NULL)
-	continue;
+      if(ref_row == NULL)
+        continue;
       number *ref_begin = ref_row->array;
       number *ref_end = ref_row->array + (ref_row->end - ref_row->begin);
       number *my_pos = row + ref_row->begin;
       //TODO npisOne distinction
-      if (!(npIsOne (coef)))
-      {
-	while (ref_begin != ref_end)
-	{
-
-	  *my_pos = npAddM (*my_pos, npMult (coef, *ref_begin));
-	  ++ref_begin;
-	  ++my_pos;
-	}
+      if(!(npIsOne (coef)))
+      {
+        while(ref_begin != ref_end)
+        {
+
+          *my_pos = npAddM (*my_pos, npMult (coef, *ref_begin));
+          ++ref_begin;
+          ++my_pos;
+        }
       }
       else
       {
-	while (ref_begin != ref_end)
-	{
-
-	  *my_pos = npAddM (*my_pos, *ref_begin);
-	  ++ref_begin;
-	  ++my_pos;
-	}
+        while(ref_begin != ref_end)
+        {
+
+          *my_pos = npAddM (*my_pos, *ref_begin);
+          ++ref_begin;
+          ++my_pos;
+        }
       }
 
 #else
       SparseRow *ref_row = ref->row;
-      if (ref_row == NULL)
-	continue;
+      if(ref_row == NULL)
+        continue;
       int n = ref_row->len;
       int j;
       int *idx_array = ref_row->idx_array;
       number *coef_array = ref_row->coef_array;
-      for (j = 0; j < n; j++)
-      {
-	int idx = idx_array[j];
-	number ref_coef = coef_array[j];
-	row[idx] = npAddM (row[idx], npMult (coef, ref_coef));
+      for(j = 0; j < n; j++)
+      {
+        int idx = idx_array[j];
+        number ref_coef = coef_array[j];
+        row[idx] = npAddM (row[idx], npMult (coef, ref_coef));
       }
 #endif
@@ -2459,13 +2394,13 @@
   //wrp(t);
   res_holder.changed = TRUE;
-  if (force_unique)
+  if(force_unique)
   {
     DataNoroCacheNode *ref = cache->getCacheReference (t);
-    if (ref != NULL)
+    if(ref != NULL)
     {
       res_holder.len = ref->value_len;
-      if (res_holder.len == NoroCache::backLinkCode)
-      {
-	res_holder.len = 1;
+      if(res_holder.len == NoroCache::backLinkCode)
+      {
+        res_holder.len = 1;
       }
       res_holder.coef = p_GetCoeff (t, c->r);
@@ -2481,18 +2416,18 @@
   {
     BOOLEAN succ;
-    poly cache_lookup = cache->lookup (t, succ, res_holder.len);	//don't own this yet
-    if (succ)
-    {
-      if (cache_lookup == t)
-      {
-	//know they are equal
-	//res_holder.len=1;
-
-	res_holder.changed = FALSE;
-	res_holder.p = t;
-	res_holder.coef = npInit (1);
-
-	res_holder.onlyBorrowed = FALSE;
-	return res_holder;
+    poly cache_lookup = cache->lookup (t, succ, res_holder.len);        //don't own this yet
+    if(succ)
+    {
+      if(cache_lookup == t)
+      {
+        //know they are equal
+        //res_holder.len=1;
+
+        res_holder.changed = FALSE;
+        res_holder.p = t;
+        res_holder.coef = npInit (1);
+
+        res_holder.onlyBorrowed = FALSE;
+        return res_holder;
       }
 
@@ -2510,5 +2445,5 @@
   unsigned long sev = p_GetShortExpVector (t, currRing);
   int i = kFindDivisibleByInS_easy (c->strat, t, sev);
-  if (i >= 0)
+  if(i >= 0)
   {
     number coef_bak = p_GetCoeff (t, c->r);
@@ -2549,5 +2484,5 @@
     p_SetCoeff (t, one, c->r);
     res_holder.len = 1;
-    if (!(force_unique))
+    if(!(force_unique))
     {
       res_holder.ref = cache->insert (t, t, res_holder.len);
@@ -2579,10 +2514,9 @@
 #ifndef NORO_NON_POLY
 //len input and out: Idea: reverse addition
-poly
-noro_red_non_unique (poly p, int &len, NoroCache * cache, slimgb_alg * c)
+poly noro_red_non_unique (poly p, int &len, NoroCache * cache, slimgb_alg * c)
 {
   assume (len == pLength (p));
   poly orig_p = p;
-  if (p == NULL)
+  if(p == NULL)
   {
     len = 0;
@@ -2595,5 +2529,5 @@
   int unchanged_size = 0;
 
-  while (p)
+  while(p)
   {
     poly t = p;
@@ -2604,18 +2538,18 @@
 #endif
     MonRedRes red = noro_red_mon (t, FALSE, cache, c);
-    if ((!(red.changed)) && (!(red.onlyBorrowed)))
+    if((!(red.changed)) && (!(red.onlyBorrowed)))
     {
       unchanged_size++;
       assume (npIsOne (red.coef));
       assume (p_GetCoeff (red.p, currRing) == coef_debug);
-      if (unchanged_head)
-      {
-	pNext (unchanged_tail) = red.p;
-	pIter (unchanged_tail);
+      if(unchanged_head)
+      {
+        pNext (unchanged_tail) = red.p;
+        pIter (unchanged_tail);
       }
       else
       {
-	unchanged_tail = red.p;
-	unchanged_head = red.p;
+        unchanged_tail = red.p;
+        unchanged_head = red.p;
       }
     }
@@ -2623,19 +2557,19 @@
     {
       assume (red.len == pLength (red.p));
-      if (red.onlyBorrowed)
-      {
-	if (npIsOne (red.coef))
-	{
-	  t = p_Copy (red.p, currRing);
-	}
-	else
-	  t = pp_Mult_nn (red.p, red.coef, currRing);
+      if(red.onlyBorrowed)
+      {
+        if(npIsOne (red.coef))
+        {
+          t = p_Copy (red.p, currRing);
+        }
+        else
+          t = pp_Mult_nn (red.p, red.coef, currRing);
       }
       else
       {
-	if (npIsOne (red.coef))
-	  t = red.p;
-	else
-	  t = p_Mult_nn (red.p, red.coef, currRing);
+        if(npIsOne (red.coef))
+          t = red.p;
+        else
+          t = p_Mult_nn (red.p, red.coef, currRing);
       }
       kBucket_Add_q (bucket, t, &red.len);
@@ -2675,8 +2609,8 @@
 #ifndef NORO_NON_POLY
 std::vector < NoroPlaceHolder > noro_red (poly p, int &len, NoroCache * cache,
-					  slimgb_alg * c)
+                                          slimgb_alg * c)
 {
   std::vector < NoroPlaceHolder > res;
-  while (p)
+  while(p)
   {
     poly t = p;
@@ -2692,5 +2626,5 @@
     h.coef = red.coef;
     assume (!((h.ref->value_poly == NULL) && (h.ref->value_len != 0)));
-    if (h.ref->value_poly)
+    if(h.ref->value_poly)
       res.push_back (h);
   }
@@ -2702,6 +2636,5 @@
 #ifdef USE_NORO
 #ifndef NORO_CACHE
-void
-noro_step (poly * p, int &pn, slimgb_alg * c)
+void noro_step (poly * p, int &pn, slimgb_alg * c)
 {
   poly *reduced = (poly *) omalloc (pn * sizeof (poly));
@@ -2714,5 +2647,5 @@
   NoroCache cache;
 #endif
-  for (j = 0; j < pn; j++)
+  for(j = 0; j < pn; j++)
   {
 
@@ -2727,5 +2660,5 @@
     assume (pLength (h) == h_len);
 #endif
-    if (h != NULL)
+    if(h != NULL)
     {
 #ifndef NORO_CACHE
@@ -2737,10 +2670,10 @@
       reduced_len[reduced_c] = h_len;
       reduced_c++;
-      if (TEST_OPT_PROT)
-	Print ("%d ", h_len);
+      if(TEST_OPT_PROT)
+        Print ("%d ", h_len);
     }
   }
   int reduced_sum = 0;
-  for (j = 0; j < reduced_c; j++)
+  for(j = 0; j < reduced_c; j++)
   {
     reduced_sum += reduced_len[j];
@@ -2748,9 +2681,9 @@
   poly *terms = (poly *) omalloc (reduced_sum * sizeof (poly));
   int tc = 0;
-  for (j = 0; j < reduced_c; j++)
+  for(j = 0; j < reduced_c; j++)
   {
     poly h = reduced[j];
 
-    while (h != NULL)
+    while(h != NULL)
     {
       terms[tc++] = h;
@@ -2774,5 +2707,5 @@
   omfree (reduced);
 
-  if (TEST_OPT_PROT)
+  if(TEST_OPT_PROT)
     PrintS ("\n");
 }
@@ -2781,6 +2714,5 @@
 #endif
 #endif
-static void
-go_on (slimgb_alg * c)
+static void go_on (slimgb_alg * c)
 {
   //set limit of 1000 for multireductions, at the moment for
@@ -2794,5 +2726,5 @@
   int i = 0;
   c->average_length = 0;
-  for (i = 0; i < c->n; i++)
+  for(i = 0; i < c->n; i++)
   {
     c->average_length += c->lengths[i];
@@ -2803,21 +2735,21 @@
 
 #ifdef USE_NORO
-  if ((use_noro) || (c->use_noro_last_block))
+  if((use_noro) || (c->use_noro_last_block))
     max_pairs = bundle_size_noro;
 #endif
-  poly *p = (poly *) omalloc ((max_pairs + 1) * sizeof (poly));	//nullterminated
+  poly *p = (poly *) omalloc ((max_pairs + 1) * sizeof (poly)); //nullterminated
 
   int curr_deg = -1;
-  while (i < max_pairs)
-  {
-    sorted_pair_node *s = top_pair (c);	//here is actually chain criterium done
-
-    if (!s)
+  while(i < max_pairs)
+  {
+    sorted_pair_node *s = top_pair (c); //here is actually chain criterium done
+
+    if(!s)
       break;
 
-    if (curr_deg >= 0)
-    {
-      if (s->deg > curr_deg)
-	break;
+    if(curr_deg >= 0)
+    {
+      if(s->deg > curr_deg)
+        break;
     }
 
@@ -2825,5 +2757,5 @@
       curr_deg = s->deg;
     quick_pop_pair (c);
-    if (s->i >= 0)
+    if(s->i >= 0)
     {
       //be careful replace_pair use createShortSpoly which is not noncommutative
@@ -2831,25 +2763,25 @@
       replace_pair (s->i, s->j, c);
 
-      if (s->i == s->j)
-      {
-	free_sorted_pair_node (s, c->r);
-	continue;
+      if(s->i == s->j)
+      {
+        free_sorted_pair_node (s, c->r);
+        continue;
       }
       now_t_rep (s->i, s->j, c);
     }
     poly h;
-    if (s->i >= 0)
+    if(s->i >= 0)
     {
 #ifdef HAVE_PLURAL
-      if (c->nc)
-      {
-	h = nc_CreateSpoly (c->S->m[s->i], c->S->m[s->j] /*, NULL */ , c->r);
-
-	if (h != NULL)
-	  p_Cleardenom (h, c->r);
+      if(c->nc)
+      {
+        h = nc_CreateSpoly (c->S->m[s->i], c->S->m[s->j] /*, NULL */ , c->r);
+
+        if(h != NULL)
+          p_Cleardenom (h, c->r);
       }
       else
 #endif
-	h = ksOldCreateSpoly (c->S->m[s->i], c->S->m[s->j], NULL, c->r);
+        h = ksOldCreateSpoly (c->S->m[s->i], c->S->m[s->j], NULL, c->r);
       p_Test (h, c->r);
     }
@@ -2864,5 +2796,5 @@
     int mlen = pLength (h);
     p_Test (h, c->r);
-    if ((!c->nc) & (!(use_noro)))
+    if((!c->nc) & (!(use_noro)))
     {
       h = redNF2 (h, c, mlen, coef, 2);
@@ -2872,5 +2804,5 @@
     p_Test (h, c->r);
     free_sorted_pair_node (s, c->r);
-    if (!h)
+    if(!h)
       continue;
     p[i] = h;
@@ -2879,5 +2811,5 @@
   p[i] = NULL;
 //  pre_comp(p,i,c);
-  if (i == 0)
+  if(i == 0)
   {
     omfree (p);
@@ -2894,8 +2826,8 @@
   //if ((!(c->nc))&&(rField_is_Zp(c->r)))
   //{
-  if (use_noro)
+  if(use_noro)
   {
     int pn = i;
-    if (pn == 0)
+    if(pn == 0)
     {
       omfree (p);
@@ -2903,18 +2835,18 @@
     }
     {
-      if (npPrimeM < 255)
-      {
-	noro_step < tgb_uint8 > (p, pn, c);
+      if(npPrimeM < 255)
+      {
+        noro_step < tgb_uint8 > (p, pn, c);
       }
       else
       {
-	if (npPrimeM < 65000)
-	{
-	  noro_step < tgb_uint16 > (p, pn, c);
-	}
-	else
-	{
-	  noro_step < tgb_uint32 > (p, pn, c);
-	}
+        if(npPrimeM < 65000)
+        {
+          noro_step < tgb_uint16 > (p, pn, c);
+        }
+        else
+        {
+          noro_step < tgb_uint32 > (p, pn, c);
+        }
       }
     }
@@ -2935,5 +2867,5 @@
 #endif
   red_object *buf = (red_object *) omalloc (i * sizeof (red_object));
-  for (j = 0; j < i; j++)
+  for(j = 0; j < i; j++)
   {
     p_Test (p[j], c->r);
@@ -2942,5 +2874,5 @@
     buf[j].bucket = kBucketCreate (currRing);
     p_Test (p[j], c->r);
-    if (c->eliminationProblem)
+    if(c->eliminationProblem)
     {
       buf[j].sugar = c->pTotaldegree_full (p[j]);
@@ -2954,5 +2886,5 @@
   qsort (buf, i, sizeof (red_object), red_object_better_gen);
 //    Print("\ncurr_deg:%i\n",curr_deg);
-  if (TEST_OPT_PROT)
+  if(TEST_OPT_PROT)
   {
     Print ("%dM[%d,", curr_deg, i);
@@ -2961,22 +2893,22 @@
   multi_reduction (buf, i, c);
 #ifdef TGB_RESORT_PAIRS
-  if (c->used_b)
-  {
-    if (TEST_OPT_PROT)
+  if(c->used_b)
+  {
+    if(TEST_OPT_PROT)
       PrintS ("B");
     int e;
-    for (e = 0; e <= c->pair_top; e++)
-    {
-      if (c->apairs[e]->i < 0)
-	continue;
+    for(e = 0; e <= c->pair_top; e++)
+    {
+      if(c->apairs[e]->i < 0)
+        continue;
       assume (c->apairs[e]->j >= 0);
-      if ((c->replaced[c->apairs[e]->i]) || (c->replaced[c->apairs[e]->j]))
-      {
-	sorted_pair_node *s = c->apairs[e];
-	s->expected_length = pair_weighted_length (s->i, s->j, c);
+      if((c->replaced[c->apairs[e]->i]) || (c->replaced[c->apairs[e]->j]))
+      {
+        sorted_pair_node *s = c->apairs[e];
+        s->expected_length = pair_weighted_length (s->i, s->j, c);
       }
     }
     qsort (c->apairs, c->pair_top + 1, sizeof (sorted_pair_node *),
-	   tgb_pair_better_gen2);
+           tgb_pair_better_gen2);
   }
 #endif
@@ -2984,15 +2916,15 @@
   {
     int k;
-    for (k = 0; k < i; k++)
+    for(k = 0; k < i; k++)
     {
       assume (kFindDivisibleByInS_easy (c->strat, buf[k]) < 0);
       int k2;
-      for (k2 = 0; k2 < i; k2++)
-      {
-	if (k == k2)
-	  continue;
-	assume ((!(p_LmDivisibleBy (buf[k].p, buf[k2].p, c->r)))
-		|| (wrp (buf[k].p), Print (" k %d k2 %d ", k, k2),
-		    wrp (buf[k2].p), FALSE));
+      for(k2 = 0; k2 < i; k2++)
+      {
+        if(k == k2)
+          continue;
+        assume ((!(p_LmDivisibleBy (buf[k].p, buf[k2].p, c->r)))
+                || (wrp (buf[k].p), Print (" k %d k2 %d ", k, k2),
+                    wrp (buf[k2].p), FALSE));
       }
     }
@@ -3001,9 +2933,9 @@
   //resort S
 
-  if (TEST_OPT_PROT)
+  if(TEST_OPT_PROT)
     Print ("%i]", i);
 
   poly *add_those = (poly *) omalloc (i * sizeof (poly));
-  for (j = 0; j < i; j++)
+  for(j = 0; j < i; j++)
   {
     int len;
@@ -3014,5 +2946,5 @@
     p_Test (p, c->r);
     //if (!c->nc) {
-    if ((c->tailReductions) || (lies_in_last_dp_block (p, c)))
+    if((c->tailReductions) || (lies_in_last_dp_block (p, c)))
     {
       p = redNFTail (p, c->strat->sl, c->strat, 0);
@@ -3032,5 +2964,5 @@
   omfree (buf);
 
-  if (TEST_OPT_PROT)
+  if(TEST_OPT_PROT)
     Print ("(%d)", c->pair_top + 1);
   //TODO: implement that while(!(idIs0(c->add_later)))
@@ -3045,14 +2977,13 @@
 #ifdef REDTAIL_S
 
-static poly
-redNFTail (poly h, const int sl, kStrategy strat, int len)
+static poly redNFTail (poly h, const int sl, kStrategy strat, int len)
 {
   BOOLEAN nc = rIsPluralRing (currRing);
-  if (h == NULL)
+  if(h == NULL)
     return NULL;
   pTest (h);
-  if (0 > sl)
+  if(0 > sl)
     return h;
-  if (pNext (h) == NULL)
+  if(pNext (h) == NULL)
     return h;
 
@@ -3065,5 +2996,5 @@
   len--;
   h = P.p;
-  if (len <= 0)
+  if(len <= 0)
     len = pLength (h);
   kBucketInit (P.bucket, h /*P.p */ , len /*pLength(P.p) */ );
@@ -3077,55 +3008,55 @@
     {
       //int dummy=strat->sl;
-      j = kFindDivisibleByInS_easy (strat, P.p, P.sev);	//kFindDivisibleByInS(strat,&dummy,&P);
-      if (j >= 0)
+      j = kFindDivisibleByInS_easy (strat, P.p, P.sev); //kFindDivisibleByInS(strat,&dummy,&P);
+      if(j >= 0)
       {
 #ifdef REDTAIL_PROT
-	PrintS ("r");
-#endif
-	nNormalize (pGetCoeff (P.p));
+        PrintS ("r");
+#endif
+        nNormalize (pGetCoeff (P.p));
 #ifdef KDEBUG
-	if (TEST_OPT_DEBUG)
-	{
-	  PrintS ("red tail:");
-	  wrp (h);
-	  PrintS (" with ");
-	  wrp (strat->S[j]);
-	}
-#endif
-	number coef;
-	pTest (strat->S[j]);
+        if(TEST_OPT_DEBUG)
+        {
+          PrintS ("red tail:");
+          wrp (h);
+          PrintS (" with ");
+          wrp (strat->S[j]);
+        }
+#endif
+        number coef;
+        pTest (strat->S[j]);
 #ifdef HAVE_PLURAL
-	if (nc)
-	{
-	  nc_BucketPolyRed_Z (P.bucket, strat->S[j], &coef);
-	}
-	else
-#endif
-	  coef = kBucketPolyRed (P.bucket, strat->S[j],
-				 strat->lenS[j] /*pLength(strat->S[j]) */ ,
-				 strat->kNoether);
-	pMult_nn (res, coef);
-	nDelete (&coef);
-	h = kBucketGetLm (P.bucket);
-	pTest (h);
-	if (h == NULL)
-	{
+        if(nc)
+        {
+          nc_BucketPolyRed_Z (P.bucket, strat->S[j], &coef);
+        }
+        else
+#endif
+          coef = kBucketPolyRed (P.bucket, strat->S[j],
+                                 strat->lenS[j] /*pLength(strat->S[j]) */ ,
+                                 strat->kNoether);
+        pMult_nn (res, coef);
+        nDelete (&coef);
+        h = kBucketGetLm (P.bucket);
+        pTest (h);
+        if(h == NULL)
+        {
 #ifdef REDTAIL_PROT
-	  PrintS (" ");
-#endif
-	  kBucketDestroy (&P.bucket);
-	  return res;
-	}
-	pTest (h);
-	P.p = h;
-	P.t_p = NULL;
-	P.SetShortExpVector ();
+          PrintS (" ");
+#endif
+          kBucketDestroy (&P.bucket);
+          return res;
+        }
+        pTest (h);
+        P.p = h;
+        P.t_p = NULL;
+        P.SetShortExpVector ();
 #ifdef KDEBUG
-	if (TEST_OPT_DEBUG)
-	{
-	  PrintS ("\nto tail:");
-	  wrp (h);
-	  PrintLn ();
-	}
+        if(TEST_OPT_DEBUG)
+        {
+          PrintS ("\nto tail:");
+          wrp (h);
+          PrintLn ();
+        }
 #endif
       }
@@ -3133,9 +3064,9 @@
       {
 #ifdef REDTAIL_PROT
-	PrintS ("n");
-#endif
-	break;
-      }
-    }				/* end loop current mon */
+        PrintS ("n");
+#endif
+        break;
+      }
+    }                           /* end loop current mon */
     //   poly tmp=pHead(h /*kBucketGetLm(P.bucket)*/);
     //act->next=tmp;pIter(act);
@@ -3143,5 +3074,5 @@
     pIter (act);
     h = kBucketGetLm (P.bucket);
-    if (h == NULL)
+    if(h == NULL)
     {
 #ifdef REDTAIL_PROT
@@ -3160,6 +3091,5 @@
 
 //transfers ownership of m to mat
-void
-init_with_mac_poly (tgb_sparse_matrix * mat, int row, mac_poly m)
+void init_with_mac_poly (tgb_sparse_matrix * mat, int row, mac_poly m)
 {
   assume (mat->mp[row] == NULL);
@@ -3167,5 +3097,5 @@
 #ifdef TGB_DEBUG
   mac_poly r = m;
-  while (r)
+  while(r)
   {
     assume (r->exp < mat->columns);
@@ -3177,5 +3107,5 @@
 poly
 free_row_to_poly (tgb_sparse_matrix * mat, int row, poly * monoms,
-		  int monom_index)
+                  int monom_index)
 {
   poly p = NULL;
@@ -3183,5 +3113,5 @@
   mac_poly r = mat->mp[row];
   mat->mp[row] = NULL;
-  while (r)
+  while(r)
   {
     (*set_this) = pLmInit (monoms[monom_index - 1 - r->exp]);
@@ -3196,6 +3126,5 @@
 }
 
-static int
-poly_crit (const void *ap1, const void *ap2)
+static int poly_crit (const void *ap1, const void *ap2)
 {
   poly p1, p2;
@@ -3204,24 +3133,23 @@
 
   int c = pLmCmp (p1, p2);
-  if (c != 0)
+  if(c != 0)
     return c;
   int l1 = pLength (p1);
   int l2 = pLength (p2);
-  if (l1 < l2)
+  if(l1 < l2)
     return -1;
-  if (l1 > l2)
+  if(l1 > l2)
     return 1;
   return 0;
 }
 
-void
-slimgb_alg::introduceDelayedPairs (poly * pa, int s)
-{
-  if (s == 0)
+void slimgb_alg::introduceDelayedPairs (poly * pa, int s)
+{
+  if(s == 0)
     return;
   sorted_pair_node **si_array =
     (sorted_pair_node **) omalloc (s * sizeof (sorted_pair_node *));
 
-  for (int i = 0; i < s; i++)
+  for(int i = 0; i < s; i++)
   {
     sorted_pair_node *si =
@@ -3265,20 +3193,20 @@
   {
     int hzz;
-    for (hzz = 0; hzz < IDELEMS (I); hzz++)
+    for(hzz = 0; hzz < IDELEMS (I); hzz++)
     {
       assume (I->m[hzz] != NULL);
       int d = this->pTotaldegree (I->m[hzz]);
       poly t = I->m[hzz]->next;
-      while (t)
-      {
-	if (d != this->pTotaldegree (t))
-	{
-	  is_homog = FALSE;
-	  break;
-	}
-	t = t->next;
-      }
-      if (!(is_homog))
-	break;
+      while(t)
+      {
+        if(d != this->pTotaldegree (t))
+        {
+          is_homog = FALSE;
+          break;
+        }
+        t = t->next;
+      }
+      if(!(is_homog))
+        break;
     }
   }
@@ -3291,5 +3219,5 @@
   easy_product_crit = 0;
   extended_product_crit = 0;
-  if (rField_is_Zp (r))
+  if(rField_is_Zp (r))
     isDifficultField = FALSE;
   else
@@ -3327,5 +3255,5 @@
   this->n = 0;
   T_deg = (int *) omalloc (n * sizeof (int));
-  if (eliminationProblem)
+  if(eliminationProblem)
     T_deg_full = (int *) omalloc (n * sizeof (int));
   else
@@ -3352,10 +3280,10 @@
 
   short_Exps = (long *) omalloc (n * sizeof (long));
-  if (F4_mode)
+  if(F4_mode)
     S = idInit (n, I->rank);
   else
     S = idInit (1, I->rank);
   strat = new skStrategy;
-  if (eliminationProblem)
+  if(eliminationProblem)
     strat->honey = TRUE;
   strat->syzComp = 0;
@@ -3367,17 +3295,17 @@
   strat->sl = -1;
   i = n;
-  i = 1;			//some strange bug else
+  i = 1;                        //some strange bug else
   /* initS(c->S,NULL,c->strat); */
   /* intS start: */
   // i=((i+IDELEMS(c->S)+15)/16)*16;
-  strat->ecartS = (intset) omAlloc (i * sizeof (int));	/*initec(i); */
+  strat->ecartS = (intset) omAlloc (i * sizeof (int));  /*initec(i); */
   strat->sevS = (unsigned long *) omAlloc0 (i * sizeof (unsigned long));
   /*initsevS(i); */
-  strat->S_2_R = (int *) omAlloc0 (i * sizeof (int));	/*initS_2_R(i); */
+  strat->S_2_R = (int *) omAlloc0 (i * sizeof (int));   /*initS_2_R(i); */
   strat->fromQ = NULL;
   strat->Shdl = idInit (1, 1);
   strat->S = strat->Shdl->m;
   strat->lenS = (int *) omAlloc0 (i * sizeof (int));
-  if ((isDifficultField) || (eliminationProblem))
+  if((isDifficultField) || (eliminationProblem))
     strat->lenSw = (wlen_type *) omAlloc0 (i * sizeof (wlen_type));
   else
@@ -3387,5 +3315,5 @@
 
   assume (strat->sl == IDELEMS (strat->Shdl) - 1);
-  if (!(F4_mode))
+  if(!(F4_mode))
   {
     poly *array_arg = I->m;
@@ -3414,8 +3342,8 @@
   else
   {
-    for (i = 1; i < n; i++)	//the 1 is wanted, because first element is added to basis
+    for(i = 1; i < n; i++)      //the 1 is wanted, because first element is added to basis
       add_to_basis_ideal_quotient (I->m[i], this, NULL);
   }
-  for (i = 0; i < IDELEMS (I); i++)
+  for(i = 0; i < IDELEMS (I); i++)
   {
     I->m[i] = NULL;
@@ -3425,10 +3353,10 @@
 #ifdef USE_NORO
   use_noro = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
-	      && (!(eliminationProblem)) && (npPrimeM <= 32003));
+              && (!(eliminationProblem)) && (npPrimeM <= 32003));
   use_noro_last_block = false;
-  if ((!(use_noro)) && (lastDpBlockStart <= pVariables))
+  if((!(use_noro)) && (lastDpBlockStart <= pVariables))
   {
     use_noro_last_block = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
-			   && (npPrimeM <= 32003));
+                           && (npPrimeM <= 32003));
   }
 #else
@@ -3443,20 +3371,20 @@
 {
 
-  if (!(completed))
+  if(!(completed))
   {
     poly *add = (poly *) omalloc ((pair_top + 2) * sizeof (poly));
     int piter;
     int pos = 0;
-    for (piter = 0; piter <= pair_top; piter++)
+    for(piter = 0; piter <= pair_top; piter++)
     {
       sorted_pair_node *s = apairs[piter];
-      if (s->i < 0)
-      {
-	//delayed element
-	if (s->lcm_of_lm != NULL)
-	{
-	  add[pos] = s->lcm_of_lm;
-	  pos++;
-	}
+      if(s->i < 0)
+      {
+        //delayed element
+        if(s->lcm_of_lm != NULL)
+        {
+          add[pos] = s->lcm_of_lm;
+          pos++;
+        }
       }
       free_sorted_pair_node (s, r);
@@ -3466,10 +3394,10 @@
     add[pos] = NULL;
     pos = 0;
-    while (add[pos] != NULL)
+    while(add[pos] != NULL)
     {
       add_to_basis_ideal_quotient (add[pos], this, NULL);
       pos++;
     }
-    for (piter = 0; piter <= pair_top; piter++)
+    for(piter = 0; piter <= pair_top; piter++)
     {
       sorted_pair_node *s = apairs[piter];
@@ -3483,5 +3411,5 @@
   int i, j;
   slimgb_alg *c = this;
-  while (c->to_destroy)
+  while(c->to_destroy)
   {
     pDelete (&(c->to_destroy->p));
@@ -3490,7 +3418,7 @@
     omfree (old);
   }
-  while (c->F)
-  {
-    for (i = 0; i < c->F->size; i++)
+  while(c->F)
+  {
+    for(i = 0; i < c->F->size; i++)
     {
       pDelete (&(c->F->mp[i].m));
@@ -3502,7 +3430,7 @@
     omfree (old);
   }
-  while (c->F_minus)
-  {
-    for (i = 0; i < c->F_minus->size; i++)
+  while(c->F_minus)
+  {
+    for(i = 0; i < c->F_minus->size; i++)
     {
       pDelete (&(c->F_minus->p[i]));
@@ -3516,5 +3444,5 @@
 #ifndef HAVE_BOOST
 #ifndef USE_STDVECBOOL
-  for (int z = 1 /* zero length at 0 */ ; z < c->n; z++)
+  for(int z = 1 /* zero length at 0 */ ; z < c->n; z++)
   {
     omfree (c->states[z]);
@@ -3526,5 +3454,5 @@
   omfree (c->lengths);
   omfree (c->weighted_lengths);
-  for (int z = 0; z < c->n; z++)
+  for(int z = 0; z < c->n; z++)
   {
     pDelete (&c->tmp_pair_lm[z]);
@@ -3535,5 +3463,5 @@
 
   omfree (c->T_deg);
-  if (c->T_deg_full)
+  if(c->T_deg_full)
     omfree (c->T_deg_full);
 
@@ -3546,10 +3474,10 @@
   omFree (c->strat->lenS);
 
-  if (c->strat->lenSw)
+  if(c->strat->lenSw)
     omFree (c->strat->lenSw);
 
-  for (i = 0; i < c->n; i++)
-  {
-    if (c->gcd_of_terms[i])
+  for(i = 0; i < c->n; i++)
+  {
+    if(c->gcd_of_terms[i])
       pDelete (&(c->gcd_of_terms[i]));
   }
@@ -3557,25 +3485,25 @@
 
   omfree (c->apairs);
-  if (TEST_OPT_PROT)
+  if(TEST_OPT_PROT)
   {
     //Print("calculated %d NFs\n",c->normal_forms);
     Print ("\nNF:%i product criterion:%i, ext_product criterion:%i \n",
-	   c->normal_forms, c->easy_product_crit, c->extended_product_crit);
-  }
-
-  for (i = 0; i <= c->strat->sl; i++)
-  {
-    if (!c->strat->S[i])
+           c->normal_forms, c->easy_product_crit, c->extended_product_crit);
+  }
+
+  for(i = 0; i <= c->strat->sl; i++)
+  {
+    if(!c->strat->S[i])
       continue;
     BOOLEAN found = FALSE;
-    for (j = 0; j < c->n; j++)
-    {
-      if (c->S->m[j] == c->strat->S[i])
-      {
-	found = TRUE;
-	break;
-      }
-    }
-    if (!found)
+    for(j = 0; j < c->n; j++)
+    {
+      if(c->S->m[j] == c->strat->S[i])
+      {
+        found = TRUE;
+        break;
+      }
+    }
+    if(!found)
       pDelete (&c->strat->S[i]);
   }
@@ -3597,26 +3525,26 @@
 //   }
 
-  if (completed)
-  {
-    for (i = 0; i < c->n; i++)
+  if(completed)
+  {
+    for(i = 0; i < c->n; i++)
     {
       assume (c->S->m[i] != NULL);
-      if (p_GetComp (c->S->m[i], currRing) > this->syz_comp)
-	continue;
-      for (j = 0; j < c->n; j++)
-      {
-	if ((c->S->m[j] == NULL) || (i == j))
-	  continue;
-	assume (p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
-				      c->S->m[i], ~c->short_Exps[i],
-				      c->r) == p_LmDivisibleBy (c->S->m[j],
-								c->S->m[i],
-								c->r));
-	if (p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
-				  c->S->m[i], ~c->short_Exps[i], c->r))
-	{
-	  pDelete (&c->S->m[i]);
-	  break;
-	}
+      if(p_GetComp (c->S->m[i], currRing) > this->syz_comp)
+        continue;
+      for(j = 0; j < c->n; j++)
+      {
+        if((c->S->m[j] == NULL) || (i == j))
+          continue;
+        assume (p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
+                                      c->S->m[i], ~c->short_Exps[i],
+                                      c->r) == p_LmDivisibleBy (c->S->m[j],
+                                                                c->S->m[i],
+                                                                c->r));
+        if(p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
+                                 c->S->m[i], ~c->short_Exps[i], c->r))
+        {
+          pDelete (&c->S->m[i]);
+          break;
+        }
       }
     }
@@ -3627,5 +3555,5 @@
   IDELEMS (I) = c->n;
   idSkipZeroes (I);
-  for (i = 0; i <= c->strat->sl; i++)
+  for(i = 0; i <= c->strat->sl; i++)
     c->strat->S[i] = NULL;
   id_Delete (&c->strat->Shdl, c->r);
@@ -3635,6 +3563,5 @@
 }
 
-ideal
-t_rep_gb (ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
+ideal t_rep_gb (ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
 {
   assume (r == currRing);
@@ -3643,5 +3570,5 @@
   ring new_ring = rAssure_TDeg (orig_ring, 1, rVar (orig_ring), pos);
   ideal s_h;
-  if (orig_ring != new_ring)
+  if(orig_ring != new_ring)
   {
     rChangeCurrRing (new_ring);
@@ -3666,5 +3593,5 @@
   ideal s_result = do_t_rep_gb (new_ring, s_h, syz_comp, F4_mode, pos);
   ideal result;
-  if (orig_ring != new_ring)
+  if(orig_ring != new_ring)
   {
     idTest (s_result);
@@ -3688,6 +3615,6 @@
   //  Print("QlogSize(0) %d, QlogSize(1) %d,QlogSize(-2) %d, QlogSize(5) %d\n", QlogSize(nlInit(0)),QlogSize(nlInit(1)),QlogSize(nlInit(-2)),QlogSize(nlInit(5)));
 
-  if (TEST_OPT_PROT)
-    if (F4_mode)
+  if(TEST_OPT_PROT)
+    if(F4_mode)
       PrintS ("F4 Modus \n");
 
@@ -3697,8 +3624,8 @@
   ideal I = arg_I;
   idCompactify (I);
-  if (idIs0 (I))
+  if(idIs0 (I))
     return I;
   int i;
-  for (i = 0; i < IDELEMS (I); i++)
+  for(i = 0; i < IDELEMS (I); i++)
   {
     assume (I->m[i] != NULL);
@@ -3712,10 +3639,10 @@
   slimgb_alg *c = new slimgb_alg (I, syz_comp, F4_mode, deg_pos);
 
-  while ((c->pair_top >= 0)
-	 && ((!(TEST_OPT_DEGBOUND))
-	     || (c->apairs[c->pair_top]->deg <= Kstd1_deg)))
+  while((c->pair_top >= 0)
+        && ((!(TEST_OPT_DEGBOUND))
+            || (c->apairs[c->pair_top]->deg <= Kstd1_deg)))
   {
 #ifdef HAVE_F4
-    if (F4_mode)
+    if(F4_mode)
       go_on_F4 (c);
     else
@@ -3723,9 +3650,9 @@
       go_on (c);
   }
-  if (c->pair_top < 0)
+  if(c->pair_top < 0)
     c->completed = TRUE;
   I = c->S;
   delete c;
-  if (TEST_OPT_REDSB)
+  if(TEST_OPT_REDSB)
   {
     ideal erg = kInterRed (I, NULL);
@@ -3739,13 +3666,12 @@
 }
 
-void
-now_t_rep (const int &arg_i, const int &arg_j, slimgb_alg * c)
+void now_t_rep (const int &arg_i, const int &arg_j, slimgb_alg * c)
 {
   int i, j;
-  if (arg_i == arg_j)
+  if(arg_i == arg_j)
   {
     return;
   }
-  if (arg_i > arg_j)
+  if(arg_i > arg_j)
   {
     i = arg_j;
@@ -3767,9 +3693,9 @@
   assume (arg_i < state->n);
   assume (arg_j < state->n);
-  if (arg_i == arg_j)
+  if(arg_i == arg_j)
   {
     return (TRUE);
   }
-  if (arg_i > arg_j)
+  if(arg_i > arg_j)
   {
     return (state->states[arg_i][arg_j] == HASTREP);
@@ -3781,11 +3707,10 @@
 }
 
-#if 0				// unused
-static int
-pLcmDeg (poly a, poly b)
+#if 0                           // unused
+static int pLcmDeg (poly a, poly b)
 {
   int i;
   int n = 0;
-  for (i = pVariables; i; i--)
+  for(i = pVariables; i; i--)
   {
     n += si_max (pGetExp (a, i), pGetExp (b, i));
@@ -3795,34 +3720,33 @@
 #endif
 
-static void
-shorten_tails (slimgb_alg * c, poly monom)
+static void shorten_tails (slimgb_alg * c, poly monom)
 {
   return;
 // BOOLEAN corr=lenS_correct(c->strat);
-  for (int i = 0; i < c->n; i++)
+  for(int i = 0; i < c->n; i++)
   {
     //enter tail
 
-    if (c->S->m[i] == NULL)
+    if(c->S->m[i] == NULL)
       continue;
     poly tail = c->S->m[i]->next;
     poly prev = c->S->m[i];
     BOOLEAN did_something = FALSE;
-    while ((tail != NULL) && (pLmCmp (tail, monom) >= 0))
-    {
-      if (p_LmDivisibleBy (monom, tail, c->r))
-      {
-	did_something = TRUE;
-	prev->next = tail->next;
-	tail->next = NULL;
-	p_Delete (&tail, c->r);
-	tail = prev;
-	//PrintS("Shortened");
-	c->lengths[i]--;
+    while((tail != NULL) && (pLmCmp (tail, monom) >= 0))
+    {
+      if(p_LmDivisibleBy (monom, tail, c->r))
+      {
+        did_something = TRUE;
+        prev->next = tail->next;
+        tail->next = NULL;
+        p_Delete (&tail, c->r);
+        tail = prev;
+        //PrintS("Shortened");
+        c->lengths[i]--;
       }
       prev = tail;
       tail = tail->next;
     }
-    if (did_something)
+    if(did_something)
     {
       int new_pos;
@@ -3833,29 +3757,29 @@
       int old_pos = -1;
       //assume new_pos<old_pos
-      for (int z = 0; z <= c->strat->sl; z++)
-      {
-	if (c->strat->S[z] == c->S->m[i])
-	{
-	  old_pos = z;
-	  break;
-	}
-      }
-      if (old_pos == -1)
-	for (int z = new_pos - 1; z >= 0; z--)
-	{
-	  if (c->strat->S[z] == c->S->m[i])
-	  {
-	    old_pos = z;
-	    break;
-	  }
-	}
+      for(int z = 0; z <= c->strat->sl; z++)
+      {
+        if(c->strat->S[z] == c->S->m[i])
+        {
+          old_pos = z;
+          break;
+        }
+      }
+      if(old_pos == -1)
+        for(int z = new_pos - 1; z >= 0; z--)
+        {
+          if(c->strat->S[z] == c->S->m[i])
+          {
+            old_pos = z;
+            break;
+          }
+        }
       assume (old_pos >= 0);
       assume (new_pos <= old_pos);
       assume (pLength (c->strat->S[old_pos]) == c->lengths[i]);
       c->strat->lenS[old_pos] = c->lengths[i];
-      if (c->strat->lenSw)
-	c->strat->lenSw[old_pos] = q;
-      if (new_pos < old_pos)
-	move_forward_in_S (old_pos, new_pos, c->strat);
+      if(c->strat->lenSw)
+        c->strat->lenSw[old_pos] = q;
+      if(new_pos < old_pos)
+        move_forward_in_S (old_pos, new_pos, c->strat);
       length_one_crit (c, i, c->lengths[i]);
     }
@@ -3863,11 +3787,10 @@
 }
 
-#if 0				// currently unused
-static sorted_pair_node *
-pop_pair (slimgb_alg * c)
+#if 0                           // currently unused
+static sorted_pair_node *pop_pair (slimgb_alg * c)
 {
   clean_top_of_pair_list (c);
 
-  if (c->pair_top < 0)
+  if(c->pair_top < 0)
     return NULL;
   else
@@ -3876,68 +3799,67 @@
 #endif
 
-void
-slimgb_alg::cleanDegs (int lower, int upper)
+void slimgb_alg::cleanDegs (int lower, int upper)
 {
   assume (is_homog);
   int deg;
-  if (TEST_OPT_PROT)
+  if(TEST_OPT_PROT)
   {
     PrintS ("C");
   }
-  for (deg = lower; deg <= upper; deg++)
+  for(deg = lower; deg <= upper; deg++)
   {
     int i;
-    for (i = 0; i < n; i++)
-    {
-      if (T_deg[i] == deg)
-      {
-	poly h;
-	h = S->m[i];
-	h = redNFTail (h, strat->sl, strat, lengths[i]);
-	if (!rField_is_Zp (r))
-	{
-	  p_Cleardenom (h, r);
-	  //p_Content(h,r);
-	}
-	else
-	  pNorm (h);
-	//TODO:GCD of TERMS
-	poly got =::gcd_of_terms (h, r);
-	p_Delete (&gcd_of_terms[i], r);
-	gcd_of_terms[i] = got;
-	int len = pLength (h);
-	wlen_type wlen = pQuality (h, this, len);
-	if (weighted_lengths)
-	  weighted_lengths[i] = wlen;
-	lengths[i] = len;
-	assume (h == S->m[i]);
-	int j;
-	for (j = 0; j <= strat->sl; j++)
-	{
-	  if (h == strat->S[j])
-	  {
-	    int new_pos = simple_posInS (strat, h, len, wlen);
-	    if (strat->lenS)
-	    {
-	      strat->lenS[j] = len;
-	    }
-	    if (strat->lenSw)
-	    {
-	      strat->lenSw[j] = wlen;
-	    }
-	    if (new_pos < j)
-	    {
-	      move_forward_in_S (j, new_pos, strat);
-	    }
-	    else
-	    {
-	      if (new_pos > j)
-		new_pos = new_pos - 1;	//is identical with one element
-	      if (new_pos > j)
-		move_backward_in_S (j, new_pos, strat);
-	    }
-	    break;
-	  }
-	}
+    for(i = 0; i < n; i++)
+    {
+      if(T_deg[i] == deg)
+      {
+        poly h;
+        h = S->m[i];
+        h = redNFTail (h, strat->sl, strat, lengths[i]);
+        if(!rField_is_Zp (r))
+        {
+          p_Cleardenom (h, r);
+          //p_Content(h,r);
+        }
+        else
+          pNorm (h);
+        //TODO:GCD of TERMS
+        poly got =::gcd_of_terms (h, r);
+        p_Delete (&gcd_of_terms[i], r);
+        gcd_of_terms[i] = got;
+        int len = pLength (h);
+        wlen_type wlen = pQuality (h, this, len);
+        if(weighted_lengths)
+          weighted_lengths[i] = wlen;
+        lengths[i] = len;
+        assume (h == S->m[i]);
+        int j;
+        for(j = 0; j <= strat->sl; j++)
+        {
+          if(h == strat->S[j])
+          {
+            int new_pos = simple_posInS (strat, h, len, wlen);
+            if(strat->lenS)
+            {
+              strat->lenS[j] = len;
+            }
+            if(strat->lenSw)
+            {
+              strat->lenSw[j] = wlen;
+            }
+            if(new_pos < j)
+            {
+              move_forward_in_S (j, new_pos, strat);
+            }
+            else
+            {
+              if(new_pos > j)
+                new_pos = new_pos - 1;  //is identical with one element
+              if(new_pos > j)
+                move_backward_in_S (j, new_pos, strat);
+            }
+            break;
+          }
+        }
       }
     }
@@ -3945,12 +3867,12 @@
   {
     int i, j;
-    for (i = 0; i < this->n; i++)
-    {
-      for (j = 0; j < i; j++)
-      {
-	if (T_deg[i] + T_deg[j] <= upper)
-	{
-	  now_t_rep (i, j, this);
-	}
+    for(i = 0; i < this->n; i++)
+    {
+      for(j = 0; j < i; j++)
+      {
+        if(T_deg[i] + T_deg[j] <= upper)
+        {
+          now_t_rep (i, j, this);
+        }
       }
     }
@@ -3960,12 +3882,11 @@
 }
 
-sorted_pair_node *
-top_pair (slimgb_alg * c)
-{
-  while (c->pair_top >= 0)
-  {
-    super_clean_top_of_pair_list (c);	//yeah, I know, it's odd that I use a different proc here
-    if ((c->is_homog) && (c->pair_top >= 0)
-	&& (c->apairs[c->pair_top]->deg >= c->lastCleanedDeg + 2))
+sorted_pair_node *top_pair (slimgb_alg * c)
+{
+  while(c->pair_top >= 0)
+  {
+    super_clean_top_of_pair_list (c);   //yeah, I know, it's odd that I use a different proc here
+    if((c->is_homog) && (c->pair_top >= 0)
+       && (c->apairs[c->pair_top]->deg >= c->lastCleanedDeg + 2))
     {
       int upper = c->apairs[c->pair_top]->deg - 1;
@@ -3979,5 +3900,5 @@
   }
 
-  if (c->pair_top < 0)
+  if(c->pair_top < 0)
     return NULL;
   else
@@ -3985,8 +3906,7 @@
 }
 
-sorted_pair_node *
-quick_pop_pair (slimgb_alg * c)
-{
-  if (c->pair_top < 0)
+sorted_pair_node *quick_pop_pair (slimgb_alg * c)
+{
+  if(c->pair_top < 0)
     return NULL;
   else
@@ -3994,12 +3914,11 @@
 }
 
-static void
-super_clean_top_of_pair_list (slimgb_alg * c)
-{
-  while ((c->pair_top >= 0)
-	 && (c->apairs[c->pair_top]->i >= 0)
-	 &&
-	 (good_has_t_rep
-	  (c->apairs[c->pair_top]->j, c->apairs[c->pair_top]->i, c)))
+static void super_clean_top_of_pair_list (slimgb_alg * c)
+{
+  while((c->pair_top >= 0)
+        && (c->apairs[c->pair_top]->i >= 0)
+        &&
+        (good_has_t_rep
+         (c->apairs[c->pair_top]->j, c->apairs[c->pair_top]->i, c)))
   {
     free_sorted_pair_node (c->apairs[c->pair_top], c->r);
@@ -4008,12 +3927,11 @@
 }
 
-void
-clean_top_of_pair_list (slimgb_alg * c)
-{
-  while ((c->pair_top >= 0) && (c->apairs[c->pair_top]->i >= 0)
-	 &&
-	 (!state_is
-	  (UNCALCULATED, c->apairs[c->pair_top]->j, c->apairs[c->pair_top]->i,
-	   c)))
+void clean_top_of_pair_list (slimgb_alg * c)
+{
+  while((c->pair_top >= 0) && (c->apairs[c->pair_top]->i >= 0)
+        &&
+        (!state_is
+         (UNCALCULATED, c->apairs[c->pair_top]->j, c->apairs[c->pair_top]->i,
+          c)))
   {
     free_sorted_pair_node (c->apairs[c->pair_top], c->r);
@@ -4024,5 +3942,5 @@
 static BOOLEAN
 state_is (calc_state state, const int &arg_i, const int &arg_j,
-	  slimgb_alg * c)
+          slimgb_alg * c)
 {
   assume (0 <= arg_i);
@@ -4030,9 +3948,9 @@
   assume (arg_i < c->n);
   assume (arg_j < c->n);
-  if (arg_i == arg_j)
+  if(arg_i == arg_j)
   {
     return (TRUE);
   }
-  if (arg_i > arg_j)
+  if(arg_i > arg_j)
   {
     return (c->states[arg_i][arg_j] == state);
@@ -4042,8 +3960,7 @@
 }
 
-void
-free_sorted_pair_node (sorted_pair_node * s, ring r)
-{
-  if (s->i >= 0)
+void free_sorted_pair_node (sorted_pair_node * s, ring r)
+{
+  if(s->i >= 0)
     p_Delete (&s->lcm_of_lm, r);
   omfree (s);
@@ -4053,31 +3970,30 @@
 pair_better (sorted_pair_node * a, sorted_pair_node * b, slimgb_alg * c)
 {
-  if (a->deg < b->deg)
+  if(a->deg < b->deg)
     return TRUE;
-  if (a->deg > b->deg)
+  if(a->deg > b->deg)
     return FALSE;
 
   int comp = pLmCmp (a->lcm_of_lm, b->lcm_of_lm);
-  if (comp == 1)
+  if(comp == 1)
     return FALSE;
-  if (-1 == comp)
+  if(-1 == comp)
     return TRUE;
-  if (a->expected_length < b->expected_length)
+  if(a->expected_length < b->expected_length)
     return TRUE;
-  if (a->expected_length > b->expected_length)
+  if(a->expected_length > b->expected_length)
     return FALSE;
-  if (a->i + a->j < b->i + b->j)
+  if(a->i + a->j < b->i + b->j)
     return TRUE;
-  if (a->i + a->j > b->i + b->j)
+  if(a->i + a->j > b->i + b->j)
     return FALSE;
-  if (a->i < b->i)
+  if(a->i < b->i)
     return TRUE;
-  if (a->i > b->i)
+  if(a->i > b->i)
     return FALSE;
   return TRUE;
 }
 
-static int
-tgb_pair_better_gen (const void *ap, const void *bp)
+static int tgb_pair_better_gen (const void *ap, const void *bp)
 {
   sorted_pair_node *a = *((sorted_pair_node **) ap);
@@ -4085,32 +4001,31 @@
   assume ((a->i > a->j) || (a->i < 0));
   assume ((b->i > b->j) || (b->i < 0));
-  if (a->deg < b->deg)
+  if(a->deg < b->deg)
     return -1;
-  if (a->deg > b->deg)
+  if(a->deg > b->deg)
     return 1;
 
   int comp = pLmCmp (a->lcm_of_lm, b->lcm_of_lm);
 
-  if (comp == 1)
+  if(comp == 1)
     return 1;
-  if (-1 == comp)
+  if(-1 == comp)
     return -1;
-  if (a->expected_length < b->expected_length)
+  if(a->expected_length < b->expected_length)
     return -1;
-  if (a->expected_length > b->expected_length)
+  if(a->expected_length > b->expected_length)
     return 1;
-  if (a->i + a->j < b->i + b->j)
+  if(a->i + a->j < b->i + b->j)
     return -1;
-  if (a->i + a->j > b->i + b->j)
+  if(a->i + a->j > b->i + b->j)
     return 1;
-  if (a->i < b->i)
+  if(a->i < b->i)
     return -1;
-  if (a->i > b->i)
+  if(a->i > b->i)
     return 1;
   return 0;
 }
 
-static poly
-gcd_of_terms (poly p, ring r)
+static poly gcd_of_terms (poly p, ring r)
 {
   int max_g_0 = 0;
@@ -4119,26 +4034,26 @@
   poly m = pOne ();
   poly t;
-  for (i = pVariables; i; i--)
+  for(i = pVariables; i; i--)
   {
     pSetExp (m, i, pGetExp (p, i));
-    if (max_g_0 == 0)
-      if (pGetExp (m, i) > 0)
-	max_g_0 = i;
+    if(max_g_0 == 0)
+      if(pGetExp (m, i) > 0)
+        max_g_0 = i;
   }
 
   t = p->next;
-  while (t != NULL)
-  {
-    if (max_g_0 == 0)
+  while(t != NULL)
+  {
+    if(max_g_0 == 0)
       break;
-    for (i = max_g_0; i; i--)
+    for(i = max_g_0; i; i--)
     {
       pSetExp (m, i, si_min (pGetExp (t, i), pGetExp (m, i)));
-      if (max_g_0 == i)
-	if (pGetExp (m, i) == 0)
-	  max_g_0 = 0;
-      if ((max_g_0 == 0) && (pGetExp (m, i) > 0))
-      {
-	max_g_0 = i;
+      if(max_g_0 == i)
+        if(pGetExp (m, i) == 0)
+          max_g_0 = 0;
+      if((max_g_0 == 0) && (pGetExp (m, i) > 0))
+      {
+        max_g_0 = i;
       }
     }
@@ -4146,5 +4061,5 @@
   }
   p_Setm (m, r);
-  if (max_g_0 > 0)
+  if(max_g_0 > 0)
     return m;
   pDelete (&m);
@@ -4152,17 +4067,16 @@
 }
 
-static inline BOOLEAN
-pHasNotCFExtended (poly p1, poly p2, poly m)
-{
-
-  if (pGetComp (p1) > 0 || pGetComp (p2) > 0)
+static inline BOOLEAN pHasNotCFExtended (poly p1, poly p2, poly m)
+{
+
+  if(pGetComp (p1) > 0 || pGetComp (p2) > 0)
     return FALSE;
   int i = 1;
   loop
   {
-    if ((pGetExp (p1, i) - pGetExp (m, i) > 0)
-	&& (pGetExp (p2, i) - pGetExp (m, i) > 0))
+    if((pGetExp (p1, i) - pGetExp (m, i) > 0)
+       && (pGetExp (p2, i) - pGetExp (m, i) > 0))
       return FALSE;
-    if (i == pVariables)
+    if(i == pVariables)
       return TRUE;
     i++;
@@ -4173,16 +4087,16 @@
 static inline BOOLEAN
 extended_product_criterion (poly p1, poly gcd1, poly p2, poly gcd2,
-			    slimgb_alg * c)
-{
-  if (c->nc)
+                            slimgb_alg * c)
+{
+  if(c->nc)
     return FALSE;
-  if (gcd1 == NULL)
+  if(gcd1 == NULL)
     return FALSE;
-  if (gcd2 == NULL)
+  if(gcd2 == NULL)
     return FALSE;
-  gcd1->next = gcd2;		//may ordered incorrect
+  gcd1->next = gcd2;            //may ordered incorrect
   poly m = gcd_of_terms (gcd1, c->r);
   gcd1->next = NULL;
-  if (m == NULL)
+  if(m == NULL)
     return FALSE;
 
@@ -4192,7 +4106,6 @@
 }
 
-#if 0				//currently unused
-static poly
-kBucketGcd (kBucket * b, ring r)
+#if 0                           //currently unused
+static poly kBucketGcd (kBucket * b, ring r)
 {
   int s = 0;
@@ -4200,31 +4113,31 @@
   poly m, n;
   BOOLEAN initialized = FALSE;
-  for (i = MAX_BUCKET - 1; i >= 0; i--)
-  {
-    if (b->buckets[i] != NULL)
-    {
-      if (!initialized)
-      {
-	m = gcd_of_terms (b->buckets[i], r);
-	initialized = TRUE;
-	if (m == NULL)
-	  return NULL;
+  for(i = MAX_BUCKET - 1; i >= 0; i--)
+  {
+    if(b->buckets[i] != NULL)
+    {
+      if(!initialized)
+      {
+        m = gcd_of_terms (b->buckets[i], r);
+        initialized = TRUE;
+        if(m == NULL)
+          return NULL;
       }
       else
       {
-	n = gcd_of_terms (b->buckets[i], r);
-	if (n == NULL)
-	{
-	  pDelete (&m);
-	  return NULL;
-	}
-	n->next = m;
-	poly t = gcd_of_terms (n, r);
-	n->next = NULL;
-	pDelete (&m);
-	pDelete (&n);
-	m = t;
-	if (m == NULL)
-	  return NULL;
+        n = gcd_of_terms (b->buckets[i], r);
+        if(n == NULL)
+        {
+          pDelete (&m);
+          return NULL;
+        }
+        n->next = m;
+        poly t = gcd_of_terms (n, r);
+        n->next = NULL;
+        pDelete (&m);
+        pDelete (&n);
+        m = t;
+        if(m == NULL)
+          return NULL;
 
       }
@@ -4235,8 +4148,7 @@
 #endif
 
-static inline wlen_type
-quality_of_pos_in_strat_S (int pos, slimgb_alg * c)
-{
-  if (c->strat->lenSw != NULL)
+static inline wlen_type quality_of_pos_in_strat_S (int pos, slimgb_alg * c)
+{
+  if(c->strat->lenSw != NULL)
     return c->strat->lenSw[pos];
   return c->strat->lenS[pos];
@@ -4260,11 +4172,11 @@
 static void
 multi_reduction_lls_trick (red_object * los, int losl, slimgb_alg * c,
-			   find_erg & erg)
+                           find_erg & erg)
 {
   erg.expand = NULL;
-  BOOLEAN swap_roles;		//from reduce_by, to_reduce_u if fromS
-  if (erg.fromS)
-  {
-    if (pLmEqual (c->strat->S[erg.reduce_by], los[erg.to_reduce_u].p))
+  BOOLEAN swap_roles;           //from reduce_by, to_reduce_u if fromS
+  if(erg.fromS)
+  {
+    if(pLmEqual (c->strat->S[erg.reduce_by], los[erg.to_reduce_u].p))
     {
       wlen_type quality_a = quality_of_pos_in_strat_S (erg.reduce_by, c);
@@ -4284,102 +4196,102 @@
       wlen_type qc;
       best = find_best (los, erg.to_reduce_l, erg.to_reduce_u, qc, c);
-      if (qc < quality_a)
-      {
-	los[best].flatten ();
-	int b_pos = kBucketCanonicalize (los[best].bucket);
-	los[best].p = los[best].bucket->buckets[b_pos];
-	qc = pQuality (los[best].bucket->buckets[b_pos], c);
-	if (qc < quality_a)
-	{
-	  red_object h = los[erg.to_reduce_u];
-	  los[erg.to_reduce_u] = los[best];
-	  los[best] = h;
-	  swap_roles = TRUE;
-	}
-	else
-	  swap_roles = FALSE;
+      if(qc < quality_a)
+      {
+        los[best].flatten ();
+        int b_pos = kBucketCanonicalize (los[best].bucket);
+        los[best].p = los[best].bucket->buckets[b_pos];
+        qc = pQuality (los[best].bucket->buckets[b_pos], c);
+        if(qc < quality_a)
+        {
+          red_object h = los[erg.to_reduce_u];
+          los[erg.to_reduce_u] = los[best];
+          los[best] = h;
+          swap_roles = TRUE;
+        }
+        else
+          swap_roles = FALSE;
       }
       else
       {
-	swap_roles = FALSE;
+        swap_roles = FALSE;
       }
     }
     else
     {
-      if (erg.to_reduce_u > erg.to_reduce_l)
-      {
-	wlen_type quality_a = quality_of_pos_in_strat_S (erg.reduce_by, c);
+      if(erg.to_reduce_u > erg.to_reduce_l)
+      {
+        wlen_type quality_a = quality_of_pos_in_strat_S (erg.reduce_by, c);
 #ifdef HAVE_PLURAL
-	if ((c->nc) && (!(rIsSCA (c->r))))
-	  quality_a =
-	    quality_of_pos_in_strat_S_mult_high (erg.reduce_by,
-						 los[erg.to_reduce_u].p, c);
-#endif
-	int best = erg.to_reduce_u + 1;
-	wlen_type qc;
-	best = find_best (los, erg.to_reduce_l, erg.to_reduce_u, qc, c);
-	assume (qc == los[best].guess_quality (c));
-	if (qc < quality_a)
-	{
-	  los[best].flatten ();
-	  int b_pos = kBucketCanonicalize (los[best].bucket);
-	  los[best].p = los[best].bucket->buckets[b_pos];
-	  qc = pQuality (los[best].bucket->buckets[b_pos], c);
-	  //(best!=erg.to_reduce_u+1)
-	  if (qc < quality_a)
-	  {
-	    red_object h = los[erg.to_reduce_u];
-	    los[erg.to_reduce_u] = los[best];
-	    los[best] = h;
-	    erg.reduce_by = erg.to_reduce_u;
-	    erg.fromS = FALSE;
-	    erg.to_reduce_u--;
-	  }
-	}
+        if((c->nc) && (!(rIsSCA (c->r))))
+          quality_a =
+            quality_of_pos_in_strat_S_mult_high (erg.reduce_by,
+                                                 los[erg.to_reduce_u].p, c);
+#endif
+        int best = erg.to_reduce_u + 1;
+        wlen_type qc;
+        best = find_best (los, erg.to_reduce_l, erg.to_reduce_u, qc, c);
+        assume (qc == los[best].guess_quality (c));
+        if(qc < quality_a)
+        {
+          los[best].flatten ();
+          int b_pos = kBucketCanonicalize (los[best].bucket);
+          los[best].p = los[best].bucket->buckets[b_pos];
+          qc = pQuality (los[best].bucket->buckets[b_pos], c);
+          //(best!=erg.to_reduce_u+1)
+          if(qc < quality_a)
+          {
+            red_object h = los[erg.to_reduce_u];
+            los[erg.to_reduce_u] = los[best];
+            los[best] = h;
+            erg.reduce_by = erg.to_reduce_u;
+            erg.fromS = FALSE;
+            erg.to_reduce_u--;
+          }
+        }
       }
       else
       {
-	assume (erg.to_reduce_u == erg.to_reduce_l);
-	wlen_type quality_a = quality_of_pos_in_strat_S (erg.reduce_by, c);
-	wlen_type qc = los[erg.to_reduce_u].guess_quality (c);
-	if (qc < 0)
-	  PrintS ("Wrong wlen_type");
-	if (qc < quality_a)
-	{
-	  int best = erg.to_reduce_u;
-	  los[best].flatten ();
-	  int b_pos = kBucketCanonicalize (los[best].bucket);
-	  los[best].p = los[best].bucket->buckets[b_pos];
-	  qc = pQuality (los[best].bucket->buckets[b_pos], c);
-	  assume (qc >= 0);
-	  if (qc < quality_a)
-	  {
-	    BOOLEAN exp = FALSE;
-	    if (qc <= 2)
-	    {
-	      //Print("\n qc is %lld \n",qc);
-	      exp = TRUE;
-	    }
-	    else
-	    {
-	      if (qc < quality_a / 2)
-		exp = TRUE;
-	      else if (erg.reduce_by < c->n / 4)
-		exp = TRUE;
-	    }
-	    if (exp)
-	    {
-	      poly clear_into;
-	      los[erg.to_reduce_u].flatten ();
-	      kBucketClear (los[erg.to_reduce_u].bucket, &clear_into,
-			    &erg.expand_length);
-	      erg.expand = pCopy (clear_into);
-	      kBucketInit (los[erg.to_reduce_u].bucket, clear_into,
-			   erg.expand_length);
-	      if (TEST_OPT_PROT)
-		PrintS ("e");
-	    }
-	  }
-	}
+        assume (erg.to_reduce_u == erg.to_reduce_l);
+        wlen_type quality_a = quality_of_pos_in_strat_S (erg.reduce_by, c);
+        wlen_type qc = los[erg.to_reduce_u].guess_quality (c);
+        if(qc < 0)
+          PrintS ("Wrong wlen_type");
+        if(qc < quality_a)
+        {
+          int best = erg.to_reduce_u;
+          los[best].flatten ();
+          int b_pos = kBucketCanonicalize (los[best].bucket);
+          los[best].p = los[best].bucket->buckets[b_pos];
+          qc = pQuality (los[best].bucket->buckets[b_pos], c);
+          assume (qc >= 0);
+          if(qc < quality_a)
+          {
+            BOOLEAN exp = FALSE;
+            if(qc <= 2)
+            {
+              //Print("\n qc is %lld \n",qc);
+              exp = TRUE;
+            }
+            else
+            {
+              if(qc < quality_a / 2)
+                exp = TRUE;
+              else if(erg.reduce_by < c->n / 4)
+                exp = TRUE;
+            }
+            if(exp)
+            {
+              poly clear_into;
+              los[erg.to_reduce_u].flatten ();
+              kBucketClear (los[erg.to_reduce_u].bucket, &clear_into,
+                            &erg.expand_length);
+              erg.expand = pCopy (clear_into);
+              kBucketInit (los[erg.to_reduce_u].bucket, clear_into,
+                           erg.expand_length);
+              if(TEST_OPT_PROT)
+                PrintS ("e");
+            }
+          }
+        }
       }
 
@@ -4390,5 +4302,5 @@
   else
   {
-    if (erg.reduce_by > erg.to_reduce_u)
+    if(erg.reduce_by > erg.to_reduce_u)
     {
       //then lm(rb)>= lm(tru) so =
@@ -4399,9 +4311,9 @@
       best = find_best (los, erg.to_reduce_l, erg.to_reduce_u, qc, c);
 
-      if (qc < quality_a)
-      {
-	red_object h = los[erg.reduce_by];
-	los[erg.reduce_by] = los[best];
-	los[best] = h;
+      if(qc < quality_a)
+      {
+        red_object h = los[erg.reduce_by];
+        los[erg.reduce_by] = los[best];
+        los[best] = h;
       }
       swap_roles = FALSE;
@@ -4417,24 +4329,24 @@
       wlen_type quality_a = los[erg.reduce_by].guess_quality (c);
       wlen_type qc;
-      while ((il > 0) && pLmEqual (los[il - 1].p, los[il].p))
-      {
-	il--;
-	qc = los[il].guess_quality (c);
-	if (qc < quality_a)
-	{
-	  quality_a = qc;
-	  erg.reduce_by = il;
-	}
+      while((il > 0) && pLmEqual (los[il - 1].p, los[il].p))
+      {
+        il--;
+        qc = los[il].guess_quality (c);
+        if(qc < quality_a)
+        {
+          quality_a = qc;
+          erg.reduce_by = il;
+        }
       }
       swap_roles = FALSE;
     }
   }
-  if (swap_roles)
-  {
-    if (TEST_OPT_PROT)
+  if(swap_roles)
+  {
+    if(TEST_OPT_PROT)
       PrintS ("b");
     poly clear_into;
     int new_length;
-    int bp = erg.to_reduce_u;	//bucket_positon
+    int bp = erg.to_reduce_u;   //bucket_positon
     //kBucketClear(los[bp].bucket,&clear_into,&new_length);
     new_length = los[bp].clear_to_poly ();
@@ -4442,7 +4354,7 @@
     poly p = c->strat->S[erg.reduce_by];
     int j = erg.reduce_by;
-    int old_length = c->strat->lenS[j];	// in view of S
+    int old_length = c->strat->lenS[j]; // in view of S
     los[bp].p = p;
-    if (c->eliminationProblem)
+    if(c->eliminationProblem)
     {
       los[bp].sugar = c->pTotaldegree_full (p);
@@ -4455,10 +4367,10 @@
     new_pos = simple_posInS (c->strat, clear_into, new_length, qal);
     assume (new_pos <= j);
-    for (z = c->n; z; z--)
-    {
-      if (p == c->S->m[z - 1])
-      {
-	pos_in_c = z - 1;
-	break;
+    for(z = c->n; z; z--)
+    {
+      if(p == c->S->m[z - 1])
+      {
+        pos_in_c = z - 1;
+        break;
       }
     }
@@ -4466,5 +4378,5 @@
     int tdeg_full = -1;
     int tdeg = -1;
-    if (pos_in_c >= 0)
+    if(pos_in_c >= 0)
     {
 #ifdef TGB_RESORT_PAIRS
@@ -4476,19 +4388,19 @@
       c->lengths[pos_in_c] = new_length;
       c->weighted_lengths[pos_in_c] = qal;
-      if (c->gcd_of_terms[pos_in_c] == NULL)
-	c->gcd_of_terms[pos_in_c] = gcd_of_terms (clear_into, c->r);
-      if (c->T_deg_full)
-	tdeg_full = c->T_deg_full[pos_in_c] =
-	  c->pTotaldegree_full (clear_into);
+      if(c->gcd_of_terms[pos_in_c] == NULL)
+        c->gcd_of_terms[pos_in_c] = gcd_of_terms (clear_into, c->r);
+      if(c->T_deg_full)
+        tdeg_full = c->T_deg_full[pos_in_c] =
+          c->pTotaldegree_full (clear_into);
       else
-	tdeg_full = tdeg;
+        tdeg_full = tdeg;
       c_S_element_changed_hook (pos_in_c, c);
     }
     else
     {
-      if (c->eliminationProblem)
-      {
-	tdeg_full = c->pTotaldegree_full (clear_into);
-	tdeg = c->pTotaldegree (clear_into);
+      if(c->eliminationProblem)
+      {
+        tdeg_full = c->pTotaldegree_full (clear_into);
+        tdeg = c->pTotaldegree (clear_into);
       }
     }
@@ -4497,9 +4409,9 @@
 
     assume (pLength (clear_into) == new_length);
-    if (c->strat->lenSw != NULL)
+    if(c->strat->lenSw != NULL)
       c->strat->lenSw[j] = qal;
-    if (!rField_is_Zp (c->r))
-    {
-      p_Cleardenom (clear_into, c->r);	//should be unnecessary
+    if(!rField_is_Zp (c->r))
+    {
+      p_Cleardenom (clear_into, c->r);  //should be unnecessary
       //p_Content(clear_into, c->r);
     }
@@ -4512,8 +4424,8 @@
     //input polys
 #else
-    if (new_pos < j)
-    {
-      if (c->strat->honey)
-	c->strat->ecartS[j] = tdeg_full - tdeg;
+    if(new_pos < j)
+    {
+      if(c->strat->honey)
+        c->strat->ecartS[j] = tdeg_full - tdeg;
       move_forward_in_S (j, new_pos, c->strat);
       erg.reduce_by = new_pos;
@@ -4523,6 +4435,5 @@
 }
 
-static int
-fwbw (red_object * los, int i)
+static int fwbw (red_object * los, int i)
 {
   int i2 = i;
@@ -4532,22 +4443,22 @@
   BOOLEAN incr = TRUE;
 
-  while (1)
-  {
-    if (!bw)
+  while(1)
+  {
+    if(!bw)
     {
       step = si_min (i2, step);
-      if (step == 0)
-	break;
+      if(step == 0)
+        break;
       i2 -= step;
 
-      if (!pLmEqual (los[i].p, los[i2].p))
-      {
-	bw = TRUE;
-	incr = FALSE;
+      if(!pLmEqual (los[i].p, los[i2].p))
+      {
+        bw = TRUE;
+        incr = FALSE;
       }
       else
       {
-	if ((!incr) && (step == 1))
-	  break;
+        if((!incr) && (step == 1))
+          break;
       }
     }
@@ -4555,25 +4466,25 @@
     {
       step = si_min (i - i2, step);
-      if (step == 0)
-	break;
+      if(step == 0)
+        break;
       i2 += step;
-      if (pLmEqual (los[i].p, los[i2].p))
-      {
-	if (step == 1)
-	  break;
-	else
-	{
-	  bw = FALSE;
-	}
-      }
-    }
-    if (incr)
+      if(pLmEqual (los[i].p, los[i2].p))
+      {
+        if(step == 1)
+          break;
+        else
+        {
+          bw = FALSE;
+        }
+      }
+    }
+    if(incr)
       step *= 2;
     else
     {
-      if (step % 2 == 1)
-	step = (step + 1) / 2;
+      if(step % 2 == 1)
+        step = (step + 1) / 2;
       else
-	step /= 2;
+        step /= 2;
     }
   }
@@ -4586,5 +4497,5 @@
   assume (l <= u + 1);
   int i;
-  for (i = l; i <= u; i++)
+  for(i = l; i <= u; i++)
   {
     kBucketCanonicalize (los[i].bucket);
@@ -4594,5 +4505,5 @@
 static void
 multi_reduction_find (red_object * los, int losl, slimgb_alg * c, int startf,
-		      find_erg & erg)
+                      find_erg & erg)
 {
   kStrategy strat = c->strat;
@@ -4600,16 +4511,16 @@
   assume (startf <= losl);
   assume ((startf == losl - 1)
-	  || (pLmCmp (los[startf].p, los[startf + 1].p) == -1));
+          || (pLmCmp (los[startf].p, los[startf + 1].p) == -1));
   int i = startf;
 
   int j;
-  while (i >= 0)
+  while(i >= 0)
   {
     assume ((i == losl - 1) || (pLmCmp (los[i].p, los[i + 1].p) <= 0));
     assume (is_valid_ro (los[i]));
     assume ((!(c->eliminationProblem))
-	    || (los[i].sugar >= c->pTotaldegree (los[i].p)));
+            || (los[i].sugar >= c->pTotaldegree (los[i].p)));
     j = kFindDivisibleByInS_easy (strat, los[i]);
-    if (j >= 0)
+    if(j >= 0)
     {
       erg.to_reduce_u = i;
@@ -4626,5 +4537,5 @@
       return;
     }
-    if (j < 0)
+    if(j < 0)
     {
       //not reduceable, try to use this for reducing higher terms
@@ -4633,18 +4544,18 @@
       assume ((i2 == 0) || (!pLmEqual (los[i2].p, los[i2 - 1].p)));
       assume (i >= i2);
-      if (i2 != i)
-      {
-	erg.to_reduce_u = i - 1;
-	erg.to_reduce_l = i2;
-	erg.reduce_by = i;
-	erg.fromS = FALSE;
-	assume ((i == losl - 1) || (pLmCmp (los[i].p, los[i + 1].p) == -1));
-	canonicalize_region (los, erg.to_reduce_u + 1, startf, c);
-	return;
+      if(i2 != i)
+      {
+        erg.to_reduce_u = i - 1;
+        erg.to_reduce_l = i2;
+        erg.reduce_by = i;
+        erg.fromS = FALSE;
+        assume ((i == losl - 1) || (pLmCmp (los[i].p, los[i + 1].p) == -1));
+        canonicalize_region (los, erg.to_reduce_u + 1, startf, c);
+        return;
       }
       i--;
     }
   }
-  erg.reduce_by = -1;		//error code
+  erg.reduce_by = -1;           //error code
   return;
 }
@@ -4661,15 +4572,15 @@
   int i = l;
   int last = -1;
-  while (i <= u)
-  {
-    if (los[i].p == NULL)
+  while(i <= u)
+  {
+    if(los[i].p == NULL)
     {
       kBucketDestroy (&los[i].bucket);
 //      delete los[i];//here we assume los are constructed with new
       //destroy resources, must be added here
-      if (last >= 0)
-      {
-	memmove (los + (int) (last + 1 - deleted), los + (last + 1),
-		 sizeof (red_object) * (i - 1 - last));
+      if(last >= 0)
+      {
+        memmove (los + (int) (last + 1 - deleted), los + (last + 1),
+                 sizeof (red_object) * (i - 1 - last));
       }
       last = i;
@@ -4678,30 +4589,29 @@
     i++;
   }
-  if ((last >= 0) && (last != losl - 1))
+  if((last >= 0) && (last != losl - 1))
     memmove (los + (int) (last + 1 - deleted), los + last + 1,
-	     sizeof (red_object) * (losl - 1 - last));
+             sizeof (red_object) * (losl - 1 - last));
   return deleted;
 }
 
-int
-search_red_object_pos (red_object * a, int top, red_object * key)
+int search_red_object_pos (red_object * a, int top, red_object * key)
 {
   int an = 0;
   int en = top;
-  if (top == -1)
+  if(top == -1)
     return 0;
-  if (pLmCmp (key->p, a[top].p) == 1)
+  if(pLmCmp (key->p, a[top].p) == 1)
     return top + 1;
   int i;
   loop
   {
-    if (an >= en - 1)
-    {
-      if (pLmCmp (key->p, a[an].p) == -1)
-	return an;
+    if(an >= en - 1)
+    {
+      if(pLmCmp (key->p, a[an].p) == -1)
+        return an;
       return en;
     }
     i = (an + en) / 2;
-    if (pLmCmp (key->p, a[i].p) == -1)
+    if(pLmCmp (key->p, a[i].p) == -1)
       en = i;
     else
@@ -4710,6 +4620,5 @@
 }
 
-static void
-sort_region_down (red_object * los, int l, int u, slimgb_alg * c)
+static void sort_region_down (red_object * los, int l, int u, slimgb_alg * c)
 {
   int r_size = u - l + 1;
@@ -4719,12 +4628,12 @@
   int bound = 0;
   BOOLEAN at_end = FALSE;
-  for (i = l; i <= u; i++)
-  {
-    if (!(at_end))
+  for(i = l; i <= u; i++)
+  {
+    if(!(at_end))
     {
       bound = new_indices[i - l] =
-	bound + search_red_object_pos (los + bound, l - bound - 1, los + i);
-      if (bound == l)
-	at_end = TRUE;
+        bound + search_red_object_pos (los + bound, l - bound - 1, los + i);
+      if(bound == l)
+        at_end = TRUE;
     }
     else
@@ -4735,5 +4644,5 @@
   red_object *los_region =
     (red_object *) omalloc (sizeof (red_object) * (u - l + 1));
-  for (int i = 0; i < r_size; i++)
+  for(int i = 0; i < r_size; i++)
   {
     new_indices[i] += i;
@@ -4745,7 +4654,7 @@
   int j = u;
   int j2 = l - 1;
-  while (i >= 0)
-  {
-    if (new_indices[i] == j)
+  while(i >= 0)
+  {
+    if(new_indices[i] == j)
     {
       los[j] = los_region[i];
@@ -4767,6 +4676,5 @@
 
 //assume that los is ordered ascending by leading term, all non zero
-static void
-multi_reduction (red_object * los, int &losl, slimgb_alg * c)
+static void multi_reduction (red_object * los, int &losl, slimgb_alg * c)
 {
   poly *delay = (poly *) omalloc (losl * sizeof (poly));
@@ -4778,10 +4686,10 @@
   wlen_type max_initial_quality = 0;
 
-  for (i = 0; i < losl; i++)
+  for(i = 0; i < losl; i++)
   {
     los[i].sev = pGetShortExpVector (los[i].p);
 //SetShortExpVector();
     los[i].p = kBucketGetLm (los[i].bucket);
-    if (los[i].initial_quality > max_initial_quality)
+    if(los[i].initial_quality > max_initial_quality)
       max_initial_quality = los[i].initial_quality;
     // else
@@ -4794,44 +4702,44 @@
 //  nicht reduzierbare eintrï¿œe in ergebnisliste schreiben
   // nullen loeschen
-  while (curr_pos >= 0)
-  {
-    if ((c->use_noro_last_block)
-	&& (lies_in_last_dp_block (los[curr_pos].p, c)))
+  while(curr_pos >= 0)
+  {
+    if((c->use_noro_last_block)
+       && (lies_in_last_dp_block (los[curr_pos].p, c)))
     {
       int pn_noro = curr_pos + 1;
       poly *p_noro = (poly *) omalloc (pn_noro * sizeof (poly));
-      for (i = 0; i < pn_noro; i++)
-      {
-	int dummy_len;
-	poly p;
-	los[i].p = NULL;
-	kBucketClear (los[i].bucket, &p, &dummy_len);
-	p_noro[i] = p;
-      }
-      if (npPrimeM < 255)
-      {
-	noro_step < tgb_uint8 > (p_noro, pn_noro, c);
+      for(i = 0; i < pn_noro; i++)
+      {
+        int dummy_len;
+        poly p;
+        los[i].p = NULL;
+        kBucketClear (los[i].bucket, &p, &dummy_len);
+        p_noro[i] = p;
+      }
+      if(npPrimeM < 255)
+      {
+        noro_step < tgb_uint8 > (p_noro, pn_noro, c);
       }
       else
       {
-	if (npPrimeM < 65000)
-	{
-	  noro_step < tgb_uint16 > (p_noro, pn_noro, c);
-	}
-	else
-	{
-	  noro_step < tgb_uint32 > (p_noro, pn_noro, c);
-	}
-      }
-      for (i = 0; i < pn_noro; i++)
-      {
-	los[i].p = p_noro[i];
-	los[i].sev = pGetShortExpVector (los[i].p);
-	//ignore quality
-	kBucketInit (los[i].bucket, los[i].p, pLength (los[i].p));
+        if(npPrimeM < 65000)
+        {
+          noro_step < tgb_uint16 > (p_noro, pn_noro, c);
+        }
+        else
+        {
+          noro_step < tgb_uint32 > (p_noro, pn_noro, c);
+        }
+      }
+      for(i = 0; i < pn_noro; i++)
+      {
+        los[i].p = p_noro[i];
+        los[i].sev = pGetShortExpVector (los[i].p);
+        //ignore quality
+        kBucketInit (los[i].bucket, los[i].p, pLength (los[i].p));
       }
       qsort (los, pn_noro, sizeof (red_object), red_object_better_gen);
       int deleted =
-	multi_reduction_clear_zeroes (los, losl, pn_noro, curr_pos);
+        multi_reduction_clear_zeroes (los, losl, pn_noro, curr_pos);
       losl -= deleted;
       curr_pos -= deleted;
@@ -4840,6 +4748,6 @@
     find_erg erg;
 
-    multi_reduction_find (los, losl, c, curr_pos, erg);	//last argument should be curr_pos
-    if (erg.reduce_by < 0)
+    multi_reduction_find (los, losl, c, curr_pos, erg); //last argument should be curr_pos
+    if(erg.reduce_by < 0)
       break;
 
@@ -4854,36 +4762,35 @@
 
 
-    if (!TEST_OPT_REDTHROUGH)
-    {
-      for (i = erg.to_reduce_l; i <= erg.to_reduce_u; i++)
-      {
-	if (los[i].p != NULL)	//the check (los[i].p!=NULL) might be invalid
-	{
-	  //
-	  assume (los[i].initial_quality > 0);
-	  if (los[i].guess_quality (c)
-	      > 1.5 * delay_factor * max_initial_quality)
-	  {
-	    if (TEST_OPT_PROT)
-	      PrintS ("v");
-	    los[i].canonicalize ();
-	    if (los[i].guess_quality (c) > delay_factor * max_initial_quality)
-	    {
-	      if (TEST_OPT_PROT)
-		PrintS (".");
-	      los[i].clear_to_poly ();
-	      //delay.push_back(los[i].p);
-	      delay[delay_s] = los[i].p;
-	      delay_s++;
-	      los[i].p = NULL;
-	    }
-	  }
-	}
-      }
-    }
-    int deleted =
-      multi_reduction_clear_zeroes (los, losl, erg.to_reduce_l,
-				    erg.to_reduce_u);
-    if (erg.fromS == FALSE)
+    if(!TEST_OPT_REDTHROUGH)
+    {
+      for(i = erg.to_reduce_l; i <= erg.to_reduce_u; i++)
+      {
+        if(los[i].p != NULL)    //the check (los[i].p!=NULL) might be invalid
+        {
+          //
+          assume (los[i].initial_quality > 0);
+          if(los[i].guess_quality (c)
+             > 1.5 * delay_factor * max_initial_quality)
+          {
+            if(TEST_OPT_PROT)
+              PrintS ("v");
+            los[i].canonicalize ();
+            if(los[i].guess_quality (c) > delay_factor * max_initial_quality)
+            {
+              if(TEST_OPT_PROT)
+                PrintS (".");
+              los[i].clear_to_poly ();
+              //delay.push_back(los[i].p);
+              delay[delay_s] = los[i].p;
+              delay_s++;
+              los[i].p = NULL;
+            }
+          }
+        }
+      }
+    }
+    int deleted = multi_reduction_clear_zeroes (los, losl, erg.to_reduce_l,
+                                                erg.to_reduce_u);
+    if(erg.fromS == FALSE)
       curr_pos = si_max (erg.to_reduce_u, erg.reduce_by);
     else
@@ -4893,16 +4800,16 @@
 
     //Print("deleted %i \n",deleted);
-    if ((TEST_V_UPTORADICAL) && (!(erg.fromS)))
+    if((TEST_V_UPTORADICAL) && (!(erg.fromS)))
       sort_region_down (los, si_min (erg.to_reduce_l, erg.reduce_by),
-			(si_max (erg.to_reduce_u, erg.reduce_by)) - deleted,
-			c);
+                        (si_max (erg.to_reduce_u, erg.reduce_by)) - deleted,
+                        c);
     else
       sort_region_down (los, erg.to_reduce_l, erg.to_reduce_u - deleted, c);
 
-    if (erg.expand)
+    if(erg.expand)
     {
 #ifdef FIND_DETERMINISTIC
       int i;
-      for (i = 0; c->expandS[i]; i++);
+      for(i = 0; c->expandS[i]; i++) ;
       c->expandS = (poly *) omrealloc (c->expandS, (i + 2) * sizeof (poly));
       c->expandS[i] = erg.expand;
@@ -4910,8 +4817,8 @@
 #else
       int ecart = 0;
-      if (c->eliminationProblem)
-      {
-	ecart =
-	  c->pTotaldegree_full (erg.expand) - c->pTotaldegree (erg.expand);
+      if(c->eliminationProblem)
+      {
+        ecart =
+          c->pTotaldegree_full (erg.expand) - c->pTotaldegree (erg.expand);
       }
       add_to_reductors (c, erg.expand, erg.expand_length, ecart);
@@ -4952,20 +4859,17 @@
 }
 
-void
-red_object::flatten ()
+void red_object::flatten ()
 {
   assume (p == kBucketGetLm (bucket));
 }
 
-void
-red_object::validate ()
+void red_object::validate ()
 {
   p = kBucketGetLm (bucket);
-  if (p)
+  if(p)
     sev = pGetShortExpVector (p);
 }
 
-int
-red_object::clear_to_poly ()
+int red_object::clear_to_poly ()
 {
   flatten ();
@@ -4975,15 +4879,13 @@
 }
 
-void
-reduction_step::reduce (red_object * r, int l, int u)
-{
-}
-
-void
-simple_reducer::do_reduce (red_object & ro)
+void reduction_step::reduce (red_object * r, int l, int u)
+{
+}
+
+void simple_reducer::do_reduce (red_object & ro)
 {
   number coef;
 #ifdef HAVE_PLURAL
-  if (c->nc)
+  if(c->nc)
     nc_BucketPolyRed_Z (ro.bucket, p, &coef);
   else
@@ -4993,6 +4895,5 @@
 }
 
-void
-simple_reducer::reduce (red_object * r, int l, int u)
+void simple_reducer::reduce (red_object * r, int l, int u)
 {
   this->pre_reduce (r, l, u);
@@ -5000,5 +4901,5 @@
 //debug start
 
-  if (c->eliminationProblem)
+  if(c->eliminationProblem)
   {
     assume (p_LmEqual (r[l].p, r[u].p, c->r));
@@ -5007,13 +4908,13 @@
   }
 
-  for (i = l; i <= u; i++)
+  for(i = l; i <= u; i++)
   {
     this->do_reduce (r[i]);
-    if (c->eliminationProblem)
+    if(c->eliminationProblem)
     {
       r[i].sugar = si_max (r[i].sugar, reducer_deg);
     }
   }
-  for (i = l; i <= u; i++)
+  for(i = l; i <= u; i++)
   {
     kBucketSimpleContent (r[i].bucket);
@@ -5030,5 +4931,5 @@
 simple_reducer::~simple_reducer ()
 {
-  if (fill_back != NULL)
+  if(fill_back != NULL)
   {
     kBucketInit (fill_back, p, p_len);
@@ -5037,6 +4938,5 @@
 }
 
-void
-multi_reduce_step (find_erg & erg, red_object * r, slimgb_alg * c)
+void multi_reduce_step (find_erg & erg, red_object * r, slimgb_alg * c)
 {
   static int id = 0;
@@ -5049,5 +4949,5 @@
   simple_reducer *pointer;
   BOOLEAN work_on_copy = FALSE;
-  if (erg.fromS)
+  if(erg.fromS)
   {
     red = c->strat->S[rn];
@@ -5060,25 +4960,25 @@
     kBucketClear (r[rn].bucket, &red, &red_len);
 
-    if (!rField_is_Zp (c->r))
-    {
-      p_Cleardenom (red, c->r);	//should be unnecessary
+    if(!rField_is_Zp (c->r))
+    {
+      p_Cleardenom (red, c->r); //should be unnecessary
       //p_Content(red, c->r);
     }
     pNormalize (red);
-    if (c->eliminationProblem)
+    if(c->eliminationProblem)
     {
       r[rn].sugar = c->pTotaldegree_full (red);
     }
 
-    if ((!(erg.fromS)) && (TEST_V_UPTORADICAL))
-    {
-      if (polynomial_root (red, c->r))
-	lt_changed = TRUE;
+    if((!(erg.fromS)) && (TEST_V_UPTORADICAL))
+    {
+      if(polynomial_root (red, c->r))
+        lt_changed = TRUE;
       sev = p_GetShortExpVector (red, c->r);
     }
     red_len = pLength (red);
   }
-  if (((TEST_V_MODPSOLVSB) && (red_len > 1))
-      || ((c->nc) || (erg.to_reduce_u - erg.to_reduce_l > 5)))
+  if(((TEST_V_MODPSOLVSB) && (red_len > 1))
+     || ((c->nc) || (erg.to_reduce_u - erg.to_reduce_l > 5)))
   {
     work_on_copy = TRUE;
@@ -5087,15 +4987,15 @@
     pSetCoeff (m, nInit (1));
     pSetComp (m, 0);
-    for (int i = 1; i <= pVariables; i++)
+    for(int i = 1; i <= pVariables; i++)
       pSetExp (m, i, (pGetExp (r[erg.to_reduce_l].p, i) - pGetExp (red, i)));
     pSetm (m);
     poly red_cp;
 #ifdef HAVE_PLURAL
-    if (c->nc)
+    if(c->nc)
       red_cp = nc_mm_Mult_pp (m, red, c->r);
     else
 #endif
       red_cp = ppMult_mm (red, m);
-    if (!erg.fromS)
+    if(!erg.fromS)
     {
       kBucketInit (r[rn].bucket, red, red_len);
@@ -5104,5 +5004,5 @@
     //static poly redNF2 (poly h,slimgb_alg* c , int &len, number&  m,int n)
 
-    if (!c->nc)
+    if(!c->nc)
       redTailShort (red_cp, c->strat);
     //number mul;
@@ -5120,9 +5020,9 @@
 
   int reducer_deg = 0;
-  if (c->eliminationProblem)
+  if(c->eliminationProblem)
   {
     int lm_deg = c->pTotaldegree (r[erg.to_reduce_l].p);
     int ecart;
-    if (erg.fromS)
+    if(erg.fromS)
     {
       ecart = c->strat->ecartS[erg.reduce_by];
@@ -5136,5 +5036,5 @@
   pointer = new simple_reducer (red, red_len, reducer_deg, c);
 
-  if ((!work_on_copy) && (!erg.fromS))
+  if((!work_on_copy) && (!erg.fromS))
     pointer->fill_back = r[rn].bucket;
   else
@@ -5144,8 +5044,8 @@
 
   pointer->reduce (r, erg.to_reduce_l, erg.to_reduce_u);
-  if (work_on_copy)
+  if(work_on_copy)
     pDelete (&pointer->p);
   delete pointer;
-  if (lt_changed)
+  if(lt_changed)
   {
     assume (!erg.fromS);
@@ -5154,6 +5054,5 @@
 }
 
-void
-simple_reducer::pre_reduce (red_object * r, int l, int u)
-{
-}
+void simple_reducer::pre_reduce (red_object * r, int l, int u)
+{
+}
