Index: factory/facAbsFact.cc
===================================================================
--- factory/facAbsFact.cc	(revision 4553b124a4bec0578e5f5f8d00c2d61d8464a7d6)
+++ factory/facAbsFact.cc	(revision 809d634e3370e14c61f7b1ee234231400c570c0f)
@@ -33,6 +33,4 @@
 TIMING_DEFINE_PRINT(fac_evalpoint)
 
-void out_cf(const char *s1,const CanonicalForm &f,const char *s2);
-
 //TODO optimize choice of p -> choose p as large as possible (better than small p since factorization mod p does not require field extension, also less lifting)
 int choosePoint (const CanonicalForm& F, int tdegF, CFArray& eval, bool rec)
@@ -48,7 +46,4 @@
   int i, p;
   eval=CFArray (2);
-  printf ("tdegF= %d\n", tdegF);
-  out_cf ("F= ", F, "\n");
-  printf ("getCharacteristic()= %d\n", getCharacteristic());
   while (1)
   {
@@ -59,10 +54,6 @@
       f= E2(f1);
       f2= E2 (F);
-      out_cf ("f= ", f, "\n");
-      printf ("isOn (SW_RATIONAL)= %d\n", isOn (SW_RATIONAL));
-      printf ("cf_getSmallPrime (cf_getNumSmallPrimes())= %d\n", cf_getSmallPrime (cf_getNumSmallPrimes()-1));
-      if ((!f.isZero()) && (abs(f) > cf_getSmallPrime (cf_getNumSmallPrimes()-1)))
+      if ((!f.isZero()) && (abs(f)>cf_getSmallPrime (cf_getNumSmallPrimes()-1)))
       {
-        printf ("hier0\n");
         for (i= cf_getNumPrimes()-1; i >= 0; i--)
         {
@@ -71,6 +62,7 @@
             p= cf_getPrime(i);
             Fp= mod (F,p);
-            out_cf ("Fp0= ", Fp, "\n");
-            if (totaldegree (Fp) == tdegF && degree (mod (f2,p), 1) == degree (F,1) && degree (mod (f1, p),2) == degree (F,2))
+            if (totaldegree (Fp) == tdegF &&
+                degree (mod (f2,p), 1) == degree (F,1) &&
+                degree (mod (f1, p),2) == degree (F,2))
             {
               eval[0]= E1[1];
@@ -83,5 +75,4 @@
       else if (!f.isZero())
       {
-        printf ("hier\n");
         for (i= cf_getNumSmallPrimes()-1; i >= 0; i--)
         {
@@ -90,6 +81,7 @@
             p= cf_getSmallPrime (i);
             Fp= mod (F,p);
-            out_cf ("Fp1= ", Fp, "\n");
-            if (totaldegree (Fp) == tdegF && degree (mod (f2, p),1) == degree (F,1) && degree (mod (f1,p),2) == degree (F,2))
+            if (totaldegree (Fp) == tdegF &&
+                degree (mod (f2, p),1) == degree (F,1) &&
+                degree (mod (f1,p),2) == degree (F,2))
             {
               eval[0]= E1[1];
@@ -102,22 +94,16 @@
       E2.nextpoint();
       On (SW_RATIONAL);
-      out_cf ("E2= ", E2[2], "\n");
     }
     E1.nextpoint();
-    out_cf ("E1= ", E1[1], "\n");
   }
   return 0;
 }
 
-//TODO sowohl bzgl. x als auch y auswerten und minpoly berechnen
+//G is assumed to be bivariate, irreducible over Q, primitive wrt x and y, compressed
 CFAFList absFactorizeMain (const CanonicalForm& G)
 {
-  //F is assumed to be bivariate, irreducible over Q, primitive wrt x and y, compressed
-
-  out_cf ("F= ", G, "\n");
   CanonicalForm F= bCommonDen (G)*G;
   Off (SW_RATIONAL);
   F /= icontent (F);
-  out_cf ("F after icontent= ", F, "\n");
   On (SW_RATIONAL);
   CFArray eval;
@@ -130,4 +116,6 @@
   Variable x= Variable (1);
   Variable y= Variable (2);
+  CanonicalForm bufF= F;
+  CFFListIterator iter;
 differentevalpoint:
   while (1)
@@ -141,25 +129,13 @@
     factors= factorize (Fp);
 
-    for (CFFListIterator iter= factors; iter.hasItem(); iter++)
-    {
-      out_cf ("factors= ", iter.getItem().factor(), "\n");
-      printf ("exp= %d\n", iter.getItem().exp());
-    }
-    printf ("p= %d\n", p);
     if (factors.getFirst().factor().inCoeffDomain())
       factors.removeFirst();
-    printf ("factors.length()= %d\n", factors.length());
-    printf ("factors.getFirst().exp()= %d\n", factors.getFirst().exp());
+
     if (factors.length() == 1 && factors.getFirst().exp() == 1)
     {
-      if (absIrredTest (Fp)) //TODO absIrredTest mit shift, modular absIrredTest
+      if (absIrredTest (Fp))
       {
-        printf ("irred after test\n");
-        printf ("absIrred\n");
         setCharacteristic(0);
         alpha= rootOf (x);
-    out_cf ("G= ", G, "\n");
-    out_cf ("getMipo (alpha)= ", getMipo (alpha), "\n");
-
         return CFAFList (CFAFactor (G, getMipo (alpha), 1));
       }
@@ -169,5 +145,4 @@
         if (modularIrredTestWithShift (F))
         {
-          printf ("irred after modular test\n");
           alpha= rootOf (x);
           return CFAFList (CFAFactor (G, getMipo (alpha), 1));
@@ -177,7 +152,6 @@
       }
     }
-    CFFListIterator iter= factors;
+    iter= factors;
     smallestFactor= iter.getItem().factor();
-    out_cf ("smallestFactor before= ", smallestFactor, "\n");
     while (smallestFactor.isUnivariate() && iter.hasItem())
     {
@@ -185,9 +159,7 @@
       if (!iter.hasItem())
         break;
-      out_cf ("factors= ", iter.getItem().factor(), "\n");
-      printf ("exp= %d\n", iter.getItem().exp());
       smallestFactor= iter.getItem().factor();
     }
-    //TODO univariate Faktoren rausschmeiÃen!
+
     minTdeg= totaldegree (smallestFactor);
     if (iter.hasItem())
@@ -195,7 +167,6 @@
     for (; iter.hasItem(); iter++)
     {
-      out_cf ("factors= ", iter.getItem().factor(), "\n");
-      printf ("exp= %d\n", iter.getItem().exp());
-      if (!iter.getItem().factor().isUnivariate() && (totaldegree (iter.getItem().factor()) < minTdeg))
+      if (!iter.getItem().factor().isUnivariate() &&
+          (totaldegree (iter.getItem().factor()) < minTdeg))
       {
         smallestFactor= iter.getItem().factor();
@@ -209,13 +180,4 @@
   }
   CanonicalForm Gp= Fp/smallestFactor;
-  out_cf ("Gp before= ", Gp, "\n");
-  out_cf ("smallestFactor= ", smallestFactor, "\n");
-  printf ("degree (Gp,1)= %d\n", degree (Gp, 1));
-  printf ("degree smallestFactor= %d\n", degree (smallestFactor, 1));
-  printf ("degree (Fp,1)= %d\n", degree (Fp,1));
-  printf ("degree (F,1)= %d\n", degree (F,1));
-  out_cf ("eval[1]= ", eval[1], "\n");
-  out_cf ("eval[0]= ", eval[0], "\n");
-  //printf ("Gp*smallestFactor==Fp ? %d\n", Gp*smallestFactor == Fp);
   Gp= Gp /Lc (Gp);
 
@@ -223,16 +185,14 @@
   CanonicalForm smallestFactorEvaly= smallestFactor (eval[0].mapinto(),1);
   CanonicalForm Gpx= Gp (eval[1].mapinto(), 2);
-  out_cf ("Gp eval= ", Gp, "\n");
   CanonicalForm smallestFactorEvalx= smallestFactor (eval[1].mapinto(),2);
 
-  out_cf ("smallestFactorEvalx= ", smallestFactorEvalx, "\n");
-  out_cf ("gcd (Gpx, smallestFactorEvalx)= ", gcd (Gpx, smallestFactorEvalx), "\n");
-  bool xValid= !(Gpx.inCoeffDomain() || smallestFactorEvalx.inCoeffDomain() || !gcd (Gpx, smallestFactorEvalx).inCoeffDomain());
-  bool yValid= !(Gpy.inCoeffDomain() || smallestFactorEvaly.inCoeffDomain() || !gcd (Gpy, smallestFactorEvaly).inCoeffDomain());
+  bool xValid= !(Gpx.inCoeffDomain() || smallestFactorEvalx.inCoeffDomain() ||
+               !gcd (Gpx, smallestFactorEvalx).inCoeffDomain());
+  bool yValid= !(Gpy.inCoeffDomain() || smallestFactorEvaly.inCoeffDomain() ||
+               !gcd (Gpy, smallestFactorEvaly).inCoeffDomain());
   if (!xValid && !yValid)
   {
     rec= true;
     setCharacteristic (0);
-    printf ("goto1\n");
     goto differentevalpoint;
   }
@@ -260,13 +220,7 @@
 
   CFArray mipos= CFArray (loop-i);
-  printf ("loop= %d\n", loop);
-  printf ("xValid= %d\n", xValid);
-  printf ("yValid= %d\n", yValid);
-
   for (; i < loop; i++)
   {
     CanonicalForm Fi= F(eval[i-1],i);
-    //CanonicalForm Fx= F(eval[0],1);
-    //CanonicalForm Fy= F(eval[1],2);
 
     int s= tdegF/minTdeg + 1;
@@ -285,17 +239,17 @@
     k= k+1;
     fmpz_poly_t FLINTFi;
-    out_cf ("Fi= ", Fi, "\n");
     convertFacCF2Fmpz_poly_t (FLINTFi, Fi);
     setCharacteristic (p);
-    printf ("p= %d\n", p);
     nmod_poly_t FLINTFpi, FLINTGpi;
     if (i == 2)
     {
-      convertFacCF2nmod_poly_t (FLINTFpi, smallestFactorEvalx/lc (smallestFactorEvalx));
+      convertFacCF2nmod_poly_t (FLINTFpi,
+                                smallestFactorEvalx/lc (smallestFactorEvalx));
       convertFacCF2nmod_poly_t (FLINTGpi, Gpx/lc (Gpx));
     }
     else
     {
-      convertFacCF2nmod_poly_t (FLINTFpi, smallestFactorEvaly/lc (smallestFactorEvaly));
+      convertFacCF2nmod_poly_t (FLINTFpi,
+                                smallestFactorEvaly/lc (smallestFactorEvaly));
       convertFacCF2nmod_poly_t (FLINTGpi, Gpy/lc (Gpy));
     }
@@ -305,6 +259,4 @@
     nmod_poly_factor_insert (nmodFactors, FLINTGpi, 1L);
 
-    //out_cf ("Gpx= ", Gpx, "\n");
-    //out_cf ("smallestFactorEvalx= ", smallestFactorEvalx, "\n");
     long * link= new long [2];
     fmpz_poly_t *v= new fmpz_poly_t[2];
@@ -315,8 +267,8 @@
     fmpz_poly_init(w[1]);
 
-    printf ("k= %ld\n", k);
     fmpz_poly_factor_t liftedFactors;
     fmpz_poly_factor_init (liftedFactors);
-    _fmpz_poly_hensel_start_lift(liftedFactors, link, v, w, FLINTFi, nmodFactors, k); //lift factors up to p^k
+    _fmpz_poly_hensel_start_lift (liftedFactors, link, v, w, FLINTFi,
+                                  nmodFactors, k);
 
     nmod_poly_factor_clear (nmodFactors);
@@ -326,7 +278,9 @@
     setCharacteristic(0);
     modpk pk= modpk (p,k);
-    CanonicalForm liftedSmallestFactor= convertFmpz_poly_t2FacCF ((fmpz_poly_t &)liftedFactors->p[0],Variable (1));
-
-    CanonicalForm otherFactor= convertFmpz_poly_t2FacCF ((fmpz_poly_t &)liftedFactors->p[1],Variable (1));
+    CanonicalForm liftedSmallestFactor=
+    convertFmpz_poly_t2FacCF ((fmpz_poly_t &)liftedFactors->p[0],Variable (1));
+
+    CanonicalForm otherFactor=
+    convertFmpz_poly_t2FacCF ((fmpz_poly_t &)liftedFactors->p[1],Variable (1));
     CanonicalForm test= pk (otherFactor*liftedSmallestFactor);
 
@@ -378,7 +332,5 @@
       {
         rec=true;
-        printf ("goto2\n");
         goto differentevalpoint;
-        //TODO check if mipoFactors has length 1 and multiplicity 1 - if not choose a new point!
       }
     }
@@ -395,12 +347,13 @@
       alpha= rootOf (mipos[1]);
   }
+  else if (xValid && yValid)
+  {
+    if (mipos[0].isZero())
+      alpha= rootOf (mipos[1]);
+    else
+      alpha= rootOf (mipos[0]);
+  }
   else
     alpha= rootOf (mipo);
-
-  for (i= 0; i < mipos.size(); i++)
-  {
-    out_cf ("mipos= ", mipos [i], "\n");
-    out_cf ("maxNorm mipo= ", maxNorm (mipos[i]), "\n");
-  }
 
   CanonicalForm F1;
@@ -419,11 +372,17 @@
     F1= F (eval[0], 1);
 
+  bool swap= false;
+  if (F1.level() == 2)
+  {
+    swap= true;
+    F1=swapvar (F1, x, y);
+    F= swapvar (F, x, y);
+  }
+
   QaF1Factors= factorize (F1, alpha);
   if (QaF1Factors.getFirst().factor().inCoeffDomain())
     QaF1Factors.removeFirst();
-  out_cf ("mipo0= ", getMipo (alpha), "\n");
-  for (CFFListIterator iter= QaF1Factors; iter.hasItem(); iter++)
-  {
-    out_cf ("QaF1Factors= ", iter.getItem().factor(), "\n");
+  for (iter= QaF1Factors; iter.hasItem(); iter++)
+  {
     if (degree (iter.getItem().factor()) > minTdeg)
       wrongMipo++;
@@ -432,20 +391,24 @@
   if (wrongMipo == QaF1Factors.length())
   {
-    if (xValid && yValid)
-    {
-      if (mipo==mipos[0])
+    if (xValid && yValid && !mipos[0].isZero() && !mipos[1].isZero())
+    {
+      if (maxNorm (mipos[0]) < maxNorm (mipos[1])) //try the other minpoly
         alpha= rootOf (mipos[1]);
       else
         alpha= rootOf (mipos[0]);
     }
+    else
+    {
+      rec= true;
+      F= bufF;
+      goto differentevalpoint;
+    }
 
     wrongMipo= 0;
-    out_cf ("mipo1= ", getMipo (alpha), "\n");
     QaF1Factors= factorize (F1, alpha);
     if (QaF1Factors.getFirst().factor().inCoeffDomain())
       QaF1Factors.removeFirst();
-    for (CFFListIterator iter= QaF1Factors; iter.hasItem(); iter++)
-    {
-      out_cf ("QaF1Factors= ", iter.getItem().factor(), "\n");
+    for (iter= QaF1Factors; iter.hasItem(); iter++)
+    {
       if (degree (iter.getItem().factor()) > minTdeg)
         wrongMipo++;
@@ -454,23 +417,22 @@
     {
       rec= true;
-      printf ("goto30\n");
+      F= bufF;
       goto differentevalpoint;
     }
   }
 
-  CanonicalForm A= F;
-  CanonicalForm Aeval= F1;
-
-  out_cf ("F1= ", F1, "\n");
-  A *= bCommonDen (A);
-  A= A (y + eval[1], y); //TODO find right evaluation point and swap if necessary
-
-  out_cf ("A= ", A, "\n");
-  out_cf ("A[0]= ", A(0,y), "\n");
-  int liftBound= degree (A,y) + 1;
+  CanonicalForm evaluation;
+  if (swap)
+    evaluation= eval[0];
+  else
+    evaluation= eval[1];
+
+  F *= bCommonDen (F);
+  F= F (y + evaluation, y);
+
+  int liftBound= degree (F,y) + 1;
 
   modpk b= modpk();
 
-  //bool mipoHasDen= false;
   CanonicalForm den= 1;
 
@@ -478,43 +440,37 @@
 
   CFList uniFactors;
-  for (CFFListIterator iter=QaF1Factors; iter.hasItem(); iter++)
-  {
+  for (iter=QaF1Factors; iter.hasItem(); iter++)
     uniFactors.append (iter.getItem().factor());
-    out_cf ("uniFactors.getLast()= ", uniFactors.getLast(), "\n");
-  }
-
-
-    A /= Lc (Aeval);
-    //mipoHasDen= !bCommonDen(mipo).isOne();
-    //mipo *= bCommonDen (mipo);
-    ZZX NTLmipo= convertFacCF2NTLZZX (mipo);
-    ZZX NTLLcf= convertFacCF2NTLZZX (Lc (A*bCommonDen (A)));
-    ZZ NTLf= resultant (NTLmipo, NTLLcf);
-    ZZ NTLD= discriminant (NTLmipo);
-    den= abs (convertZZ2CF (NTLD*NTLf));
-
-    // make factors elements of Z(a)[x] disable for modularDiophant
-    CanonicalForm multiplier= 1;
-    for (CFListIterator i= uniFactors; i.hasItem(); i++)
-    {
-      multiplier *= bCommonDen (i.getItem());
-      i.getItem()= i.getItem()*bCommonDen(i.getItem());
-    }
-    A *= multiplier;
-    A *= bCommonDen (A);
-
-    Off (SW_RATIONAL);
-    int ii= 0;
-    CanonicalForm discMipo= convertZZ2CF (NTLD);
-    findGoodPrime (F*discMipo,ii);
-    findGoodPrime (Aeval*discMipo,ii);
-    findGoodPrime (A*discMipo,ii);
-
-    int pp=cf_getBigPrime(ii);
-    b = coeffBound( A, pp, mipo );
-    modpk bb= coeffBound (Aeval, pp, mipo);
-    if (bb.getk() > b.getk() ) b=bb;
-      bb= coeffBound (F, pp, mipo);
-    if (bb.getk() > b.getk() ) b=bb;
+
+  F /= Lc (F1);
+  ZZX NTLmipo= convertFacCF2NTLZZX (mipo);
+  ZZX NTLLcf= convertFacCF2NTLZZX (Lc (F*bCommonDen (F)));
+  ZZ NTLf= resultant (NTLmipo, NTLLcf);
+  ZZ NTLD= discriminant (NTLmipo);
+  den= abs (convertZZ2CF (NTLD*NTLf));
+
+  // make factors elements of Z(a)[x] disable for modularDiophant
+  CanonicalForm multiplier= 1;
+  for (CFListIterator i= uniFactors; i.hasItem(); i++)
+  {
+    multiplier *= bCommonDen (i.getItem());
+    i.getItem()= i.getItem()*bCommonDen(i.getItem());
+  }
+  F *= multiplier;
+  F *= bCommonDen (F);
+
+  Off (SW_RATIONAL);
+  int ii= 0;
+  CanonicalForm discMipo= convertZZ2CF (NTLD);
+  findGoodPrime (bufF*discMipo,ii);
+  findGoodPrime (F1*discMipo,ii);
+  findGoodPrime (F*discMipo,ii);
+
+  int pp=cf_getBigPrime(ii);
+  b = coeffBound( F, pp, mipo );
+  modpk bb= coeffBound (F1, pp, mipo);
+  if (bb.getk() > b.getk() ) b=bb;
+    bb= coeffBound (F, pp, mipo);
+  if (bb.getk() > b.getk() ) b=bb;
 
   ExtensionInfo dummy= ExtensionInfo (alpha, false);
@@ -525,21 +481,20 @@
   TIMING_START (fac_bi_hensel_lift);
   uniFactors= henselLiftAndEarly
-              (A, earlySuccess, earlyFactors, degs, liftBound,
-               uniFactors, dummy, eval[1], b, den);
+              (F, earlySuccess, earlyFactors, degs, liftBound,
+               uniFactors, dummy, evaluation, b, den);
   TIMING_END_AND_PRINT (fac_bi_hensel_lift,
                         "time for bivariate hensel lifting over Q: ");
   DEBOUTLN (cerr, "lifted factors= " << uniFactors);
 
-  CanonicalForm MODl= power (y, liftBound); //TODO
+  CanonicalForm MODl= power (y, liftBound);
 
   On (SW_RATIONAL);
-  A *= bCommonDen (A);
+  F *= bCommonDen (F);
   Off (SW_RATIONAL);
 
-  printf ("earlyFactors.length()= %d\n", earlyFactors.length());
   CFList biFactors;
 
   TIMING_START (fac_bi_factor_recombination);
-  biFactors= factorRecombination (uniFactors, A, MODl, degs, 1,
+  biFactors= factorRecombination (uniFactors, F, MODl, degs, 1,
                                 uniFactors.length()/2, b, den);
   TIMING_END_AND_PRINT (fac_bi_factor_recombination,
@@ -554,7 +509,6 @@
 
   for (CFListIterator i= biFactors; i.hasItem(); i++)
-    i.getItem()= i.getItem() (y - eval[1], y); //TODO
-
-  bool swap= false;
+    i.getItem()= i.getItem() (y - evaluation, y);
+
   bool swap2= false;
   appendSwapDecompress (biFactors, CFList(), CFList(), swap, swap2, CFMap());
@@ -565,13 +519,9 @@
   bool found= false;
 
-  out_cf ("mipo= ", mipo, "\n");
-  printf ("minTdeg= %d\n", minTdeg);
-  for (CFListIterator iter= biFactors; iter.hasItem(); iter++)
-  {
-    out_cf ("biFactors= ", iter.getItem(), "\n");
-    printf ("totaldegree ()= %d\n", totaldegree (iter.getItem()));
-    if (totaldegree (iter.getItem()) == minTdeg)
-    {
-      result= CFAFList (CFAFactor (iter.getItem(), getMipo (alpha), 1));
+  for (CFListIterator i= biFactors; i.hasItem(); i++)
+  {
+    if (totaldegree (i.getItem()) == minTdeg)
+    {
+      result= CFAFList (CFAFactor (i.getItem(), getMipo (alpha), 1));
       found= true;
       break;
@@ -579,178 +529,8 @@
   }
 
-  if (found)
-  {
-    printf ("thisexitexit\n\n");
-    return result;
-  }
-
-  /*  A *= bCommonDen (A);
-  A= A (y + evaluation, y);
-
-  int liftBound= degree (A, y) + 1;
-
-  modpk b= modpk();
-  bool mipoHasDen= false;
-  CanonicalForm den= 1;
-
-  if (!extension)
-  {
-    Off (SW_RATIONAL);
-    int i= 0;
-    findGoodPrime(F,i);
-    findGoodPrime(Aeval,i);
-    findGoodPrime(A,i);
-    if (i >= cf_getNumBigPrimes())
-      printf ("out of primes\n"); //TODO exit
-
-    int p=cf_getBigPrime(i);
-    b = coeffBound( A, p );
-    modpk bb= coeffBound (Aeval, p);
-    if (bb.getk() > b.getk() ) b=bb;
-      bb= coeffBound (F, p);
-    if (bb.getk() > b.getk() ) b=bb;
-  }
-  else
-  {
-    A /= Lc (Aeval);
-    mipoHasDen= !bCommonDen(mipo).isOne();
-    mipo *= bCommonDen (mipo);
-    ZZX NTLmipo= convertFacCF2NTLZZX (mipo);
-    ZZX NTLLcf= convertFacCF2NTLZZX (Lc (A*bCommonDen (A)));
-    ZZ NTLf= resultant (NTLmipo, NTLLcf);
-    ZZ NTLD= discriminant (NTLmipo);
-    den= abs (convertZZ2CF (NTLD*NTLf));
-
-    // make factors elements of Z(a)[x] disable for modularDiophant
-    CanonicalForm multiplier= 1;
-    for (CFListIterator i= uniFactors; i.hasItem(); i++)
-    {
-      multiplier *= bCommonDen (i.getItem());
-      i.getItem()= i.getItem()*bCommonDen(i.getItem());
-    }
-    A *= multiplier;
-    A *= bCommonDen (A);
-
-    Off (SW_RATIONAL);
-    int i= 0;
-    CanonicalForm discMipo= convertZZ2CF (NTLD);
-    findGoodPrime (F*discMipo,i);
-    findGoodPrime (Aeval*discMipo,i);
-    findGoodPrime (A*discMipo,i);
-
-    int p=cf_getBigPrime(i);
-    b = coeffBound( A, p, mipo );
-    modpk bb= coeffBound (Aeval, p, mipo);
-    if (bb.getk() > b.getk() ) b=bb;
-      bb= coeffBound (F, p, mipo);
-    if (bb.getk() > b.getk() ) b=bb;
-  }
-
-  ExtensionInfo dummy= ExtensionInfo (false);
-  if (extension)
-    dummy= ExtensionInfo (v, false);
-  bool earlySuccess= false;
-  CFList earlyFactors;
-  TIMING_START (fac_bi_hensel_lift);
-  uniFactors= henselLiftAndEarly
-              (A, earlySuccess, earlyFactors, degs, liftBound,
-               uniFactors, dummy, evaluation, b, den);
-  TIMING_END_AND_PRINT (fac_bi_hensel_lift,
-                        "time for bivariate hensel lifting over Q: ");
-  DEBOUTLN (cerr, "lifted factors= " << uniFactors);
-
-  CanonicalForm MODl= power (y, liftBound);
-
-  if (mipoHasDen)
-  {
-    Variable vv;
-    for (CFListIterator iter= uniFactors; iter.hasItem(); iter++)
-      if (hasFirstAlgVar (iter.getItem(), vv))
-        break;
-    for (CFListIterator iter= uniFactors; iter.hasItem(); iter++)
-      iter.getItem()= replacevar (iter.getItem(), vv, v);
-  }
-
-  On (SW_RATIONAL);
-  A *= bCommonDen (A);
-  Off (SW_RATIONAL);
-
-  TIMING_START (fac_bi_factor_recombination);
-  factors= factorRecombination (uniFactors, A, MODl, degs, 1,
-                                uniFactors.length()/2, b, den);
-  TIMING_END_AND_PRINT (fac_bi_factor_recombination,
-                        "time for bivariate factor recombination over Q: ");
-
-  On (SW_RATIONAL);
-
-  if (earlySuccess)
-    factors= Union (earlyFactors, factors);
-  else if (!earlySuccess && degs.getLength() == 1)
-    factors= earlyFactors;
-
-  for (CFListIterator i= factors; i.hasItem(); i++)
-    i.getItem()= i.getItem() (y - evaluation, y);
-
-  appendSwapDecompress (factors, conv (contentAxFactors),
-                        conv (contentAyFactors), swap, swap2, N);
-  if (isOn (SW_RATIONAL))
-    normalize (factors);*/
-
-  TIMING_START (fac_Qa_factorize);
-  CFFList QaFactors= factorize (F, alpha); //TODO lift these factors
-  TIMING_END_AND_PRINT (fac_Qa_factorize, "time to factorize over Qa: ");
-
-  /*mipo= getMipo (alpha);
-  out_cf ("maxNorm (mipo)= ", maxNorm (mipo), "\n");
-  QaFactors.append (CFFactor (mipo, 1)); //last factor is the minimal polynomial that defines the extension
-  if (degree (mipo) < 3)
-    printf ("scheissescheissescheissescheisse\n");*/
-  printf ("minTdeg= %d\n", minTdeg);
-  //CFAFList result;
-  //bool found= false;
-  out_cf ("mipo= ", getMipo (alpha), "\n");
-  for (CFFListIterator iter= QaFactors; iter.hasItem(); iter++)
-  {
-    out_cf ("QaFactors= ", iter.getItem().factor(), "\n");
-    printf ("totaldegree ()= %d\n", totaldegree (iter.getItem().factor()));
-    if (totaldegree (iter.getItem().factor()) == minTdeg)
-    {
-      result= CFAFList (CFAFactor (iter.getItem().factor(), getMipo (alpha), 1));
-      found= true;
-      break;
-    }
-  }
-  if (!found && xValid && yValid)
-  {
-    if (mipo == mipos [0])
-      mipo= mipos[1];
-    else
-      mipo= mipos[0];
-    alpha= rootOf (mipo);
-
-    QaFactors= factorize (F, alpha);
-
-    for (CFFListIterator iter= QaFactors; iter.hasItem(); iter++)
-    {
-      out_cf ("QaFactors= ", iter.getItem().factor(), "\n");
-      printf ("totaldegree ()= %d\n", totaldegree (iter.getItem().factor()));
-      if (totaldegree (iter.getItem().factor()) == minTdeg)
-      {
-        result= CFAFList (CFAFactor (iter.getItem().factor(), getMipo (alpha), 1));
-        found= true;
-        break;
-      }
-    }
-    if (!found)
-    {
-      rec= true;
-      printf ("goto31\n");
-      goto differentevalpoint;
-    }
-  }
-  else if (!found)
+  if (!found)
   {
     rec= true;
-    printf ("goto32\n");
+    F= bufF;
     goto differentevalpoint;
   }
@@ -758,4 +538,5 @@
   return result;
 }
+
 #endif
 #endif
