Index: Singular/LIB/multigrading.lib
===================================================================
--- Singular/LIB/multigrading.lib	(revision fec3bde6a8e1670c13a5b3176f479ac2b3da7399)
+++ Singular/LIB/multigrading.lib	(revision 2815e8ac192a591e3d2618c320e12f21d3e7a2cd)
@@ -16,5 +16,5 @@
 OVERVIEW: This library allows one to virtually add multigradings to Singular.
 For more see http://code.google.com/p/convex-singular/wiki/Multigrading
-For theoretical references see: 
+For theoretical references see:
 E. Miller, B. Sturmfels: 'Combinatorial Commutative Algebra' and
 M. Kreuzer, L. Robbiano: 'Computational Commutative Algebra'.
@@ -32,5 +32,5 @@
 createGroup(S,L);          create a group generated by S, with relations L
 createQuotientGroup(L);    create a group generated by the unit matrix whith relations L
-createTorsionFreeGroup(S); create a group generated by S which is torsionfree 
+createTorsionFreeGroup(S); create a group generated by S which is torsionfree
 printGroup(G);             print a group
 
@@ -54,5 +54,5 @@
 intersectLattices(A,B);   compute an integral basis for the intersection of the lattices A and B.
 isIntegralSurjective(P);  test whether the map P of lattices is surjective.
-isPrimitiveSublattice(A); test whether A generates a primitive sublattice. 
+isPrimitiveSublattice(A); test whether A generates a primitive sublattice.
 intInverse(A);            compute the integral inverse matrix of the intmat A
 intAdjoint(A,i,j);        delete row i and column j of the intmat A.
@@ -70,5 +70,5 @@
 isPositive();             test whether the current multigrading is positive
 isZeroElement(p);         test whether p has zero multidegree
-areZeroElements(M);       test whether an integer matrix M considered as a collection of columns has zero multidegree   
+areZeroElements(M);       test whether an integer matrix M considered as a collection of columns has zero multidegree
 isHomogeneous(a);         test whether 'a' is multigraded-homogeneous
 
@@ -79,5 +79,5 @@
 mDegModulo(I,J);          compute the multigraded 'modulo' module of I and J
 mDegResolution(M,l[,m]);  compute the multigraded resolution of M
-mDegTensor(m,n);          compute the tensor product of multigraded modules m,n 
+mDegTensor(m,n);          compute the tensor product of multigraded modules m,n
 mDegTor(i,m,n);           compute the Tor_i(m,n) for multigraded modules m,n
 
@@ -128,5 +128,5 @@
 proc createGradedRingHomomorphism(def src, ideal Im, def A)
 "USAGE: createGradedRingHomomorphism(R, f, A); ring R, ideal f, group homomorphism A
-PURPOSE: create a multigraded group ring homomorphism defined by 
+PURPOSE: create a multigraded group ring homomorphism defined by
 a ring map from R to the current ring, given by generators images f
 and a group homomorphism A between grading groups
@@ -137,16 +137,16 @@
   string isGRH = "isGRH";
 
-  if( !isGradedRingHomomorphism(def src, ideal Im, def A) ) 
+  if( !isGradedRingHomomorphism(src, Im, A) )
   {
     ERROR("Input data is wrong");
   }
-  
+
   list h;
   h[3] = A;
-  
+
 //  map f = src, Im;
   h[2] = Im; // f?
   h[1] = src;
-  
+
   attrib(h, isGRH, (1==1)); // mark it "a graded ring homomorphism"
 
@@ -165,5 +165,5 @@
 proc isGradedRingHomomorphism(def src, ideal Im, def A)
 "USAGE: isGradedRingHomomorphism(R, f, A); ring R, ideal f, group homomorphism A
-PURPOSE: test a multigraded group ring homomorphism defined by 
+PURPOSE: test a multigraded group ring homomorphism defined by
 a ring map from R to the current ring, given by generators images f
 and a group homomorphism A between grading groups
@@ -176,7 +176,7 @@
   intmat result_degs = mDeg(Im);
   print(result_degs);
-   
+
   setring src;
-   
+
   intmat input_degs = mDeg(maxideal(1));
   print(input_degs);
@@ -184,10 +184,10 @@
   def image_degs = A * input_degs;
   print( image_degs );
-  
+
   def df = image_degs - result_degs;
   print(df);
-  
+
   setring dst;
-   
+
   return (areZeroElements( df ));
 }
@@ -195,5 +195,5 @@
 {
   "EXAMPLE:"; echo=2;
-  
+
   ring r = 0, (x, y, z), dp;
   intmat S1[3][3] =
@@ -203,10 +203,10 @@
   intmat L1[3][1] =
     0,
-    0, 
+    0,
     0;
-   
+
   def G1 = createGroup(S1, L1); // (S1 + L1)/L1
   printGroup(G1);
-   
+
   setBaseMultigrading(S1, L1); // to change...
 
@@ -221,5 +221,5 @@
   def G2 = createGroup(S2, L2);
   printGroup(G2);
-   
+
   setBaseMultigrading(S2, L2); // to change...
 
@@ -229,5 +229,5 @@
       1, 0, 0,
       3, 2, -6;
-   
+
   // graded ring homomorphism is given by (compatible):
   print(F);
@@ -238,5 +238,5 @@
 
   print(h);
-  
+
   // not a homo..
   intmat B[nrows(L2)][nrows(L1)] =
@@ -247,5 +247,5 @@
   isGradedRingHomomorphism(r, ideal(F), B);
   def hh = createGradedRingHomomorphism(r, ideal(F), B);
-  
+
   if( defined(hh) ) { ERROR("That input was not valid"); }
 }
@@ -254,6 +254,6 @@
 proc createQuotientGroup(intmat L)
 "
-L - relations 
-TODO: bad name 
+L - relations
+TODO: bad name
 "
 {
@@ -267,5 +267,5 @@
 "
 S - generators
-TODO: bad name 
+TODO: bad name
 "
 {
@@ -279,5 +279,5 @@
 proc createGroup(intmat S, intmat L)
 "USAGE: createGroup(S, L); S, L are integer matrices
-PURPOSE: create the group of the form (S+L)/L, i.e. 
+PURPOSE: create the group of the form (S+L)/L, i.e.
 S specifies generators, L specifies relations.
 RETURN: group
@@ -289,5 +289,5 @@
   string attrGroupSNF = "smith";
 
-   
+
 /*
   if( size(#) > 0 )
@@ -305,8 +305,8 @@
       } else { ERROR("Wrong optional argument: 2"); }
     }
-  } 
-  if( !defined(S) ) 
+  }
+  if( !defined(S) )
   {}
-*/    
+*/
 
   if( nrows(L) != nrows(S) )
@@ -314,5 +314,5 @@
     ERROR("Incompatible matrices!");
   }
-  
+
   def H = attrib(L, attrGroupHNF);
   if( !defined(H) || typeof(H) != "intmat")
@@ -320,5 +320,5 @@
     attrib(L, attrGroupHNF, hermiteNormalForm(L));
   } else { kill H; }
-  
+
   def HH = attrib(L, attrGroupSNF);
   if( !defined(HH) || typeof(HH) != "intmat")
@@ -337,5 +337,5 @@
 {
   "EXAMPLE:"; echo=2;
-   
+
   intmat S[3][3] =
     1, 0, 0,
@@ -345,11 +345,11 @@
   intmat L[3][2] =
     1, 1,
-    1, 3, 
+    1, 3,
     1, 5;
-   
+
   def G = createGroup(S, L); // (S+L)/L
 
   printGroup(G);
-   
+
   kill S, L, G;
 
@@ -366,7 +366,7 @@
 
   printGroup(G);
-   
+
   kill S, L, G;
-   
+
   // ----------- extreme case ------------ //
   intmat S[1][3] =
@@ -396,5 +396,5 @@
   "Relations: ";
   print(G[2]);
-  
+
 //  attrib(G[2]);
 }
@@ -402,5 +402,5 @@
 {
   "EXAMPLE:"; echo=2;
-   
+
 }
 
@@ -418,5 +418,5 @@
 {
   "EXAMPLE:"; echo=2;
-   
+
 }
 
@@ -426,5 +426,5 @@
 {
   string isGroup = "isGroup";
-  
+
   // valid?
   if( typeof(G) != "list" ){ return(0); }
@@ -435,13 +435,13 @@
 
 //  if( !defined(a) ) { return(0); }
-//  if( typeof(a) != "int" ) { return(0); } 
+//  if( typeof(a) != "int" ) { return(0); }
 //  if( !a ){ return(0); }
 
-   
+
   if( size(G) != 2 ){ return(0); }
   if( typeof(G[1]) != "intmat" ){ return(0); }
   if( typeof(G[2]) != "intmat" ){ return(0); }
   if( nrows(G[1]) != nrows(G[2]) ){ return(0); }
-   
+
   return(1==1);
 }
@@ -460,5 +460,5 @@
   string attrMgrad   = "mgrad";
   string attrGradingGroup = "gradingGroup";
-  
+
   if( size(#) > 0 )
   {
@@ -466,5 +466,5 @@
     {
       def L = createGroup(M, #[1]);
-    } 
+    }
 
     if( isGroup(#[1]) )
@@ -477,5 +477,5 @@
       }
     }
-  } 
+  }
   else
   {
@@ -484,9 +484,9 @@
 
   if( !defined(L) ){ ERROR("Wrong arguments: no group given?"); }
-   
-
-  
-  attrib(basering, attrMgrad, M); 
-  attrib(basering, attrGradingGroup, L); 
+
+
+
+  attrib(basering, attrMgrad, M);
+  attrib(basering, attrGradingGroup, L);
 
   ideal Q = ideal(basering);
@@ -495,6 +495,6 @@
     "Warning: your quotient ideal is not homogenous (multigrading was set anyway)!";
   }
- 
-   
+
+
 
 
@@ -503,5 +503,5 @@
 {
   "EXAMPLE:"; echo=2;
-   
+
   ring R = 0, (x, y, z), dp;
 
@@ -515,7 +515,7 @@
   intmat L[3][2] =
     1, 1,
-    1, 3, 
+    1, 3,
     1, 5;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M, L); // Grading: Z^3/L
@@ -523,12 +523,12 @@
   // Weights are accessible via "getVariableWeights()":
   getVariableWeights();
-  
-  // Test all possible usages: 
+
+  // Test all possible usages:
   (getVariableWeights() == M) && (getVariableWeights(R) == M) && (getVariableWeights(basering) == M);
 
   // Grading group is accessible via "getLattice()":
   getLattice();
-  
-  // Test all possible usages: 
+
+  // Test all possible usages:
   (getLattice() == L) && (getLattice(R) == L) && (getLattice(basering) == L);
 
@@ -536,5 +536,5 @@
   getLattice("hermite");
 
-  // Test all possible usages: 
+  // Test all possible usages:
   intmat H = hermiteNormalForm(L);
   (getLattice("hermite") == H) && (getLattice(R, "hermite") == H) && (getLattice(basering, "hermite") == H);
@@ -553,5 +553,5 @@
     0,
     2;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M, L); // Grading: Z + (Z/2Z)
@@ -573,5 +573,5 @@
   intmat L[1][1] =
     0;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M); // Grading: Z^3
@@ -614,10 +614,10 @@
   def M = attrib(R, attrMgrad);
   if( typeof(M) == "intmat"){ return (M); }
-  ERROR( "Sorry no multigrading matrix!" );  
+  ERROR( "Sorry no multigrading matrix!" );
 }
 example
 {
   "EXAMPLE:"; echo=2;
-   
+
   ring R = 0, (x, y, z), dp;
 
@@ -631,7 +631,7 @@
   intmat L[3][2] =
     1, 1,
-    1, 3, 
+    1, 3,
     1, 5;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M, L); // Grading: Z^3/L
@@ -653,5 +653,5 @@
     0,
     2;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M, L); // Grading: Z + (Z/2Z)
@@ -671,5 +671,5 @@
   intmat L[1][1] =
     0;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M); // Grading: Z^3
@@ -697,6 +697,6 @@
       def R = #[i];
       i++;
-    } 
-  } 
+    }
+  }
 
   if( !defined(R) )
@@ -706,16 +706,16 @@
 
   def G = attrib(R, attrGradingGroup);
-  
+
   if( !isGroup(G) )
   {
     ERROR("Sorry no grading group!");
-  }   
-
-  return(G); 
+  }
+
+  return(G);
 }
 example
 {
   "EXAMPLE:"; echo=2;
-   
+
   ring R = 0, (x, y, z), dp;
 
@@ -729,7 +729,7 @@
   intmat L[3][2] =
     1, 1,
-    1, 3, 
+    1, 3,
     1, 5;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M, L); // Grading: Z^3/L
@@ -738,5 +738,5 @@
 
   printGroup( G );
-  
+
   G[1] == M; G[2] == L;
 
@@ -754,5 +754,5 @@
     0,
     2;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M, L); // Grading: Z + (Z/2Z)
@@ -761,5 +761,5 @@
 
   printGroup( G );
-  
+
   G[1] == M; G[2] == L;
 
@@ -774,5 +774,5 @@
   intmat L[1][1] =
     0;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M); // Grading: Z^3
@@ -781,5 +781,5 @@
 
   printGroup( G );
-  
+
   G[1] == M; G[2] == L;
 
@@ -792,5 +792,5 @@
 "USAGE: getLattice([R[,opt]])
 PURPOSE: get associated grading group matrix, i.e. generators (cols) of the grading group
-RETURN: intmat, the grading group matrix, or 
+RETURN: intmat, the grading group matrix, or
 its hermite normal form if an optional argument (\"hermiteNormalForm\") is given or
 smith normal form if an optional argument (\"smith\") is given
@@ -804,6 +804,6 @@
     {
       i++;
-    } 
-  } 
+    }
+  }
 
   string attrGradingGroupHNF = "hermite";
@@ -811,6 +811,6 @@
 
   def G = getGradingGroup(#);
-  
-//  printGroup(G); 
+
+//  printGroup(G);
 
 
@@ -824,6 +824,6 @@
       def M = attrib(T, attrGradingGroupHNF);
       if( (!defined(M)) or (typeof(M) != "intmat") )
-      { 
-	M = hermiteNormalForm(T); 
+      {
+        M = hermiteNormalForm(T);
       }
       return (M);
@@ -834,6 +834,6 @@
       def M = attrib(T, attrGradingGroupSNF);
       if( (!defined(M)) or (typeof(M) != "intmat") )
-      { 
-	M = smithNormalForm(T); 
+      {
+        M = smithNormalForm(T);
       }
       return (M);
@@ -841,10 +841,10 @@
   }
 
-  return(T); 
+  return(T);
 }
 example
 {
   "EXAMPLE:"; echo=2;
-   
+
   ring R = 0, (x, y, z), dp;
 
@@ -858,7 +858,7 @@
   intmat L[3][2] =
     1, 1,
-    1, 3, 
+    1, 3,
     1, 5;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M, L); // Grading: Z^3/L
@@ -883,5 +883,5 @@
     0,
     2;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M, L); // Grading: Z + (Z/2Z)
@@ -904,5 +904,5 @@
   intmat L[1][1] =
     0;
-   
+
   // attaches M & L to R (==basering):
   setBaseMultigrading(M); // Grading: Z^3
@@ -920,5 +920,5 @@
 "
 {
-  if( typeof(m) == "ideal" ) 
+  if( typeof(m) == "ideal" )
   {
     return (m[i]);
@@ -928,5 +928,5 @@
   {
     def v = getModuleGrading(m);
-    
+
     return ( setModuleGrading(m[i],v) );
   }
@@ -948,5 +948,5 @@
 
   def V = attrib(m, attrModuleGrading);
-  
+
   if( typeof(V) != "intmat" )
   {
@@ -957,5 +957,5 @@
       return (VV);
     }
-     
+
     ERROR("Sorry: vector or module need module-grading-matrix! See 'getModuleGrading'.");
   }
@@ -970,5 +970,5 @@
     ERROR("Sorry wrong width of V: " + string(ncols(V)));
   }
-   
+
   return (V);
 }
@@ -976,5 +976,5 @@
 {
   "EXAMPLE:"; echo=2;
-   
+
    ring R = 0, (x,y), dp;
    intmat M[2][2]=
@@ -984,23 +984,23 @@
      1,  2,  3,  4, 0,
      0, 10, 20, 30, 1;
-   
+
    setBaseMultigrading(M, T);
-   
+
    ideal I = x, y, xy^5;
    isHomogeneous(I);
- 
+
    intmat V = mDeg(I); print(V);
 
    module S = syz(I); print(S);
-   
+
    S = setModuleGrading(S, V);
 
    getModuleGrading(S) == V;
-   
+
    vector v = getGradedGenerator(S, 1);
    getModuleGrading(v) == V;
    isHomogeneous(v);
-   print( mDeg(v) );   
-   
+   print( mDeg(v) );
+
    isHomogeneous(S);
    print( mDeg(S) );
@@ -1022,5 +1022,5 @@
   if(nrows(G) != nrows(R)){ ERROR("Incompatible gradings.");}
   if(ncols(G) < nrows(m)){ ERROR("Multigrading does not fit to module.");}
-  
+
   attrib(m, attrModuleGrading, G);
   return(m);
@@ -1029,5 +1029,5 @@
 {
   "EXAMPLE:"; echo=2;
-   
+
    ring R = 0, (x,y), dp;
    intmat M[2][2]=
@@ -1037,24 +1037,24 @@
      1,  2,  3,  4, 0,
      0, 10, 20, 30, 1;
-   
+
    setBaseMultigrading(M, T);
-   
+
    ideal I = x, y, xy^5;
    intmat V = mDeg(I);
-   
+
    // V == M; modulo T
    print(V);
 
    module S = syz(I);
-   
+
    S = setModuleGrading(S, V);
    getModuleGrading(S) == V;
 
    print(S);
-   
+
    vector v = getGradedGenerator(S, 1);
    getModuleGrading(v) == V;
 
-   print( mDeg(v) );   
+   print( mDeg(v) );
 
    isHomogeneous(S);
@@ -1089,5 +1089,5 @@
     for(i = 1; i<=mr; i++)
     {
-      result[((i-1)*nr+1)..(i*nr),((i-1)*nc+1)..(i*nc)] = N[1..nr,1..nc]; 
+      result[((i-1)*nr+1)..(i*nr),((i-1)*nc+1)..(i*nc)] = N[1..nr,1..nc];
     }
   }
@@ -1157,5 +1157,5 @@
   else
   {
-    
+
     matrix fd[nrows(m)][0];
     matrix fd2[nrows(l[i+1])][0];
@@ -1169,5 +1169,5 @@
     freedim2 = setModuleGrading(freedim2,getModuleGrading(l[i+1]));
     freedim3 = setModuleGrading(freedim3, getModuleGrading(l[i]));
-    
+
     module mimag = mDegTensor(freedim3, m);
     //"mimag ok.";
@@ -1241,9 +1241,9 @@
 "USAGE: gisGoupHomomorphism(L1,L2,A); L1 and L2 are groups, A is an integer matrix
 PURPOSE: checks whether A defines a group homomorphism phi: L1 --> L2
-RETURN: int, 1 if A defines the homomorphism and 0 otherwise 
+RETURN: int, 1 if A defines the homomorphism and 0 otherwise
 EXAMPLE: example isGroupHomomorphism; shows an example
 "
 {
-  // TODO: L1, L2 
+  // TODO: L1, L2
   if( (ncols(A) != nrows(L1)) or (nrows(A) != nrows(L2)) )
   {
@@ -1252,6 +1252,6 @@
 
   intmat im = A * L1;
-  
-  return  (areZeroElements(im, L2)); 
+
+  return  (areZeroElements(im, L2));
 }
 example
@@ -1264,5 +1264,5 @@
      0,
      2;
-     
+
    intmat L2[3][2]=
      0, 0,
@@ -1270,5 +1270,5 @@
      0, 3;
 
-  intmat A[3][4] = 
+  intmat A[3][4] =
      1, 2, 3, 0,
      7, 0, 0, 0,
@@ -1278,9 +1278,9 @@
   isGroupHomomorphism(L1, L2, A);
 
-  intmat B[3][4] = 
+  intmat B[3][4] =
      1, 2, 3, 0,
      7, 0, 0, 0,
      1, 2, 0, 2;
-  print( B ); 
+  print( B );
 
   isGroupHomomorphism(L1, L2, B); // Not a homomorphism!
@@ -1308,5 +1308,5 @@
 
     if(H[j, i]!=0)
-    { 
+    {
       d=d*H[j, i];
     }
@@ -1314,5 +1314,5 @@
 
   if( (d*d)==1 )
-  { 
+  {
     return(1==1);
   }
@@ -1330,7 +1330,7 @@
      1, 2, 3, 4, 0,
      0,10,20,30, 1;
-   
+
    setBaseMultigrading(M,T);
-   
+
    // Is the resulting group  free?
    isTorsionFree();
@@ -1340,5 +1340,5 @@
 
    ring R=0,(x,y,z),dp;
-   intmat A[3][3] = 
+   intmat A[3][3] =
      1,0,0,
      0,1,0,
@@ -1430,8 +1430,8 @@
       }
       result= result+ list (buf);
-      
+
     }
     return(result);
-  } 
+  }
   else
   {
@@ -1522,5 +1522,5 @@
     }
   }
-  //"here is the size ",size(#); 
+  //"here is the size ",size(#);
   if(size(#) == 0){
     return(D);
@@ -1533,5 +1533,5 @@
 "EXAMPLE: "; echo=2;
 
-intmat A[5][7] = 
+intmat A[5][7] =
 1,0,1,0,-2,9,-71,
 0,-24,248,-32,-96,448,-3496,
@@ -1550,7 +1550,7 @@
 
 /******************************************************/
-proc hermiteNormalForm(intmat A, list #) 
+proc hermiteNormalForm(intmat A, list #)
 "USAGE: hermiteNormalForm( A );
-PURPOSE: Computes the (lower triangular) Hermite Normal Form 
+PURPOSE: Computes the (lower triangular) Hermite Normal Form
            of the matrix A by column operations.
 RETURN: intmat, the Hermite Normal Form of A
@@ -1558,5 +1558,5 @@
 "
 {
-  
+
   int row, column, i, j;
   int rr = nrows(A);
@@ -1574,10 +1574,10 @@
               if(A[row, j]!=0)
                 {
-		  transform = unitMatrix(cc);
-		  transform[j,j] = 0;
-		  transform[column, column] = 0;
-		  transform[column,j] = 1;
-		  transform[j,column] = 1;
-		  q = q*transform;
+                  transform = unitMatrix(cc);
+                  transform[j,j] = 0;
+                  transform[column, column] = 0;
+                  transform[column,j] = 1;
+                  transform[j,column] = 1;
+                  q = q*transform;
                   A = A*transform;
                   break;
@@ -1606,5 +1606,5 @@
               q = q*transform;
               A = A*transform;
-	      // A;
+              // A;
             }
         }
@@ -1612,6 +1612,6 @@
         {
           transform = unitMatrix(cc);
-	  transform[column,column] = -1;
-	  q = q*transform;
+          transform[column,column] = -1;
+          q = q*transform;
           A = A*transform;
         }
@@ -1623,5 +1623,5 @@
             transform[column,j]=transform[column,j]+1;}
           q = q*transform;
-          A = A*transform; 
+          A = A*transform;
         }
       }
@@ -1637,5 +1637,5 @@
   "EXAMPLE:"; echo=2;
 
-   intmat M[2][5] = 
+   intmat M[2][5] =
      1, 2, 3, 4, 0,
      0,10,20,30, 1;
@@ -1644,5 +1644,5 @@
    print(hermiteNormalForm(M));
 
-   intmat T[3][4] = 
+   intmat T[3][4] =
      3,3,3,3,
      2,1,3,0,
@@ -1652,5 +1652,5 @@
    print(hermiteNormalForm(T));
 
-   intmat A[4][5] = 
+   intmat A[4][5] =
      1,2,3,2,2,
      1,2,3,4,0,
@@ -1669,10 +1669,10 @@
 
   intvec v;
-  
+
   for( ; i > 0; i-- )
   {
     v = m[1..r, i];
     if( !isZeroElement(v, #) )
-    { 
+    {
       return (0);
     }
@@ -1709,6 +1709,6 @@
  intmat m[5][2]=mDeg(a)-mDeg(b),mDeg(b)-mDeg(c),mDeg(c)-mDeg(d),mDeg(d)-mDeg(e),mDeg(e)-mDeg(f);
  m=transpose(m);
- areZeroElementes(m);
- areZeroElementes(m,tt);
+ areZeroElements(m);
+ areZeroElements(m,tt);
 }
 
@@ -1736,5 +1736,5 @@
       }
     }
-    
+
   }
   if( !defined(H) )
@@ -1801,15 +1801,15 @@
   isZeroElement(v1);
   isZeroElement(v1, tt);
-  
+
   intvec v2 = mDeg(a) - mDeg(c);
   v2;
   isZeroElement(v2);
   isZeroElement(v2, tt);
-  
+
   intvec v3 = mDeg(e) - mDeg(f);
   v3;
   isZeroElement(v3);
   isZeroElement(v3, tt);
-  
+
   intvec v4 = mDeg(c) - mDeg(d);
   v4;
@@ -1822,12 +1822,12 @@
 proc defineHomogeneous(poly f, list #)
 "USAGE: defineHomogeneous(f[, G]); polynomial f, integer matrix G
-PURPOSE: Yields a matrix which has to be appended to the grading group matrix to make the 
+PURPOSE: Yields a matrix which has to be appended to the grading group matrix to make the
 polynomial f homogeneous in the grading by grad.
 EXAMPLE: example defineHomogeneous; shows an example
 "
 {
-  if( size(#) > 0 ) 
-  {
-    if( typeof(#[1]) == "intmat" ) 
+  if( size(#) > 0 )
+  {
+    if( typeof(#[1]) == "intmat" )
     {
       intmat grad = #[1];
@@ -1859,5 +1859,5 @@
 
   ring r =0,(x,y,z),dp;
-  intmat grad[2][3] = 
+  intmat grad[2][3] =
     1,0,1,
     0,1,1;
@@ -1870,5 +1870,5 @@
   M;
   defineHomogeneous(f, grad) == M;
-  
+
   isHomogeneous(f);
   setBaseMultigrading(grad, M);
@@ -1906,5 +1906,5 @@
     return(s);
   }
-  return(1==0); 
+  return(1==0);
 }
 example
@@ -1944,5 +1944,5 @@
 //  listvar();
   def pre = preimage(f);
-  
+
 //  "pre: ";  pre;
 
@@ -2035,9 +2035,9 @@
 
   ring r = 0,(x,y,z),dp;
-  
-  
+
+
 
   // Setting degrees for preimage ring.;
-  intmat grad[3][3] = 
+  intmat grad[3][3] =
     1,0,0,
     0,1,0,
@@ -2045,5 +2045,5 @@
 
   setBaseMultigrading(grad);
-  
+
   // grading on r:
   getVariableWeights();
@@ -2060,8 +2060,8 @@
 
   listvar();
-  
+
   map f = r,-a2b6+b5+a3b+a2+ab,-a2b7-3a2b5+b4+a,a6-b6-b3+a2; f;
 
-  
+
   // TODO: Unfortunately this is not a very spectacular example...:
   // Pushing forward f:
@@ -2071,5 +2071,5 @@
   getVariableWeights();
   getLattice();
-  
+
 
   // only for the purpose of this example
@@ -2082,7 +2082,7 @@
 proc equalMDeg(intvec exp1, intvec exp2, list #)
 "USAGE: equalMDeg(exp1, exp2[, V]); intvec exp1, exp2, intmat V
-PURPOSE: Tests if the exponent vectors of two monomials (given by exp1 and exp2) 
+PURPOSE: Tests if the exponent vectors of two monomials (given by exp1 and exp2)
 represent the same multidegree.
-NOTE: the integer matrix V encodes multidegrees of module components, 
+NOTE: the integer matrix V encodes multidegrees of module components,
 if module component is present in exp1 and exp2
 EXAMPLE: example equalMDeg; shows an example
@@ -2094,5 +2094,5 @@
   }
 
-  if( exp1 == exp2) 
+  if( exp1 == exp2)
   {
     return (1==1);
@@ -2228,5 +2228,5 @@
     def g = groebner(a); // !!!!
 
-    def b, aa; int j; 
+    def b, aa; int j;
     for( int i = ncols(a); i > 0; i-- )
     {
@@ -2243,5 +2243,5 @@
     }
     return(1==1);
-  }  
+  }
 }
 example
@@ -2252,5 +2252,5 @@
 
   //Grading and Torsion matrices:
-  intmat M[3][3] = 
+  intmat M[3][3] =
     1,0,0,
     0,1,0,
@@ -2278,9 +2278,9 @@
   /////////////////////////////////////////////////////////
   // new Torsion matrix:
-  intmat T[3][4] = 
+  intmat T[3][4] =
     3,3,3,3,
     2,1,3,0,
     1,2,0,3;
-  
+
   setBaseMultigrading(M,T);
 
@@ -2289,5 +2289,5 @@
   mDegPartition(f);
 
-  // --------------------- 
+  // ---------------------
   g;
   isHomogeneous(g);
@@ -2298,9 +2298,9 @@
   ring R = 0, (x,y,z), dp;
 
-  intmat A[2][3] = 
+  intmat A[2][3] =
     0,0,1,
     3,2,1;
-  intmat T[2][1] = 
-    -1, 
+  intmat T[2][1] =
+    -1,
      4;
   setBaseMultigrading(A, T);
@@ -2314,11 +2314,11 @@
   mDegPartition(x3 -y2z + x2 -y3 + z + 1);
 
-  
+
   module N = gen(1) + (x+y) * gen(2), z*gen(3);
 
   intmat V[2][3] = 0; // 1, 2, 3,  4, 5, 6; //  column-wise weights of components!!??
- 
+
   vector v1, v2;
- 
+
   v1 = setModuleGrading(N[1], V); v1;
   mDegPartition(v1);
@@ -2333,8 +2333,8 @@
   print( mDeg(N) );
 
-  /////////////////////////////////////// 
-
-  V = 
-    1, 2, 3,  
+  ///////////////////////////////////////
+
+  V =
+    1, 2, 3,
     4, 5, 6;
 
@@ -2351,8 +2351,8 @@
   print( mDeg(N) );
 
-  /////////////////////////////////////// 
-
-  V = 
-    0, 0, 0,  
+  ///////////////////////////////////////
+
+  V =
+    0, 0, 0,
     4, 1, 0;
 
@@ -2394,5 +2394,5 @@
   {
     intmat V = getModuleGrading(A);
-  
+
     if( nrows(V) != r )
     {
@@ -2400,5 +2400,5 @@
     }
   }
-			    
+
   if( A == 0 )
   {
@@ -2419,5 +2419,5 @@
     A = A - lead(A);
     while( size(A) > 0 )
-    { 
+    {
       v = leadexp(A); //  v;
       m = max( m, M * v, r ); // ????
@@ -2440,5 +2440,5 @@
     A = A - lead(A);
     while( size(A) > 0 )
-    { 
+    {
       v = leadexp(A); //  v;
 
@@ -2465,5 +2465,5 @@
       {
         G[j, i] = d[j];
-      }      
+      }
     }
     return(G);
@@ -2477,7 +2477,7 @@
     for( i = ncols(A); i > 0; i-- )
     {
-      v = getGradedGenerator(A, i); 
-
-      // G[1..r, i] 
+      v = getGradedGenerator(A, i);
+
+      // G[1..r, i]
       d = mDeg(v);
 
@@ -2485,5 +2485,5 @@
       {
         G[j, i] = d[j];
-      }      
+      }
 
     }
@@ -2491,5 +2491,5 @@
     return(G);
   }
- 
+
 }
 example
@@ -2515,9 +2515,9 @@
 
   setBaseMultigrading(A, Ta);
-  
+
   mDeg( x*x*y );
-  
+
   mDeg( y*y*y*x );
-  
+
   mDeg( x*y + x + 1 );
 
@@ -2529,5 +2529,5 @@
 
 //  "ideal:";
-  
+
   ideal I = y*x*x, x*y*y*y;
   print( mDeg(I) );
@@ -2537,12 +2537,12 @@
 
 //  "vectors:";
-  
+
   intmat B[2][2] = 0, 1, 1, 0;
   print(B);
-  
+
   mDeg( setModuleGrading(y*y*y*gen(2), B ));
   mDeg( setModuleGrading(x*x*gen(1), B ));
 
-  
+
   vector V = x*gen(1) + y*gen(2);
   V = setModuleGrading(V, B);
@@ -2551,15 +2551,15 @@
   vector v1 = setModuleGrading([0, 0, 0], B);
   print( mDeg( v1 ) );
-  
+
   vector v2 = setModuleGrading([0], B);
   print( mDeg( v2 ) );
 
 //  "module:";
-  
+
   module D = x*gen(1), y*gen(2);
   D;
   D = setModuleGrading(D, B);
   print( mDeg( D ) );
-  
+
 
   module DD = [0, 0],[0, 0, 0];
@@ -2585,7 +2585,7 @@
 { // TODO: What about an ideal or module???
 
-  if( typeof(p) == "poly" ) 
-  {
-    ideal I;      
+  if( typeof(p) == "poly" )
+  {
+    ideal I;
     poly mp, t, tt;
   }
@@ -2594,5 +2594,5 @@
     if(  typeof(p) == "vector" )
     {
-      module I;      
+      module I;
       vector mp, t, tt;
     }
@@ -2605,5 +2605,5 @@
   if( typeof(p) == "vector" )
   {
-    intmat V = getModuleGrading(p); 
+    intmat V = getModuleGrading(p);
   }
   else
@@ -2612,5 +2612,5 @@
   }
 
-  if( size(p) > 1) 
+  if( size(p) > 1)
   {
     intvec m;
@@ -2619,13 +2619,13 @@
     {
       m = leadexp(p);
-      mp = lead(p); 
+      mp = lead(p);
       p = p - lead(p);
       tt = p; t = 0;
 
       while( size(tt) > 0 )
-      { 
+      {
         // TODO: we do not cache matrices (M,T,H,V), which remain the same :(
         // TODO: we need some low-level procedure with all these arguments...!
-        if( equalMDeg( leadexp(tt), m, V  ) ) 
+        if( equalMDeg( leadexp(tt), m, V  ) )
         {
           mp = mp + lead(tt); // "mp", mp;
@@ -2674,10 +2674,10 @@
 
   mDegPartition(f);
-  
+
   vector v = xy*gen(1)-x3y2*gen(2)+x4y*gen(3);
   intmat B[2][3]=1,-1,-2,0,0,1;
   v = setModuleGrading(v,B);
   getModuleGrading(v);
-  
+
   mDegPartition(v, B);
 }
@@ -2689,5 +2689,5 @@
 {
   intmat A[n][n];
-  
+
   for( int i = n; i > 0; i-- )
   {
@@ -2704,5 +2704,5 @@
 "
 USAGE: finestMDeg(r); ring r
-RETURN: ring, r endowed with the finest multigrading 
+RETURN: ring, r endowed with the finest multigrading
 TODO: not yet...
 "
@@ -2733,8 +2733,8 @@
 
 
-  if( n > 0) 
-  {
-
-    intmat L[N][n]; 
+  if( n > 0)
+  {
+
+    intmat L[N][n];
     //  list L;
     int j = n;
@@ -2744,5 +2744,5 @@
       p = I[i];
 
-      if( size(p) > 1 ) 
+      if( size(p) > 1 )
       {
         intvec m0 = leadexp(p);
@@ -2759,6 +2759,6 @@
 
     print(L);
-    setBaseMultigrading(A, L);      
-  } 
+    setBaseMultigrading(A, L);
+  }
   else
   {
@@ -2797,5 +2797,5 @@
 
   if( size(#) > 0 and typeof(#[1]) == "intmat" )
-  { 
+  {
     attrib(F, "P", #[1]);
   }
@@ -2883,5 +2883,5 @@
      ERROR("Sorry: cannot find 'hilbert' command from 4ti2. Please install 4ti2!");
    }
-   
+
 //--------------------------------------------------------------------------
 // Initialization and Sanity Checks
@@ -2939,8 +2939,8 @@
    j=system("sh","hilbert -q -n sing4ti2"); ////////// be quiet + no loggin!!!
 
-   j=system("sh", "awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.hil " + 
-                "| sed s/[\\\ \\\t\\\v\\\f]/,/g " + 
-                "| sed s/,+/,/g|sed s/,,/,/g " + 
-                "| sed s/,,/,/g " + 
+   j=system("sh", "awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.hil " +
+                "| sed s/[\\\ \\\t\\\v\\\f]/,/g " +
+                "| sed s/,+/,/g|sed s/,,/,/g " +
+                "| sed s/,,/,/g " +
                 "> sing4ti2.converted" );
 
@@ -2962,10 +2962,10 @@
    string ergstr = "intvec erglist = " + s + "0;";
    execute(ergstr);
-  
+
    //   print(erglist);
-  
+
    int Rnc = erglist[1];
    int Rnr = erglist[2];
-   
+
    intmat R[Rnr][Rnc];
 
@@ -3035,5 +3035,5 @@
 
 /******************************************************/
-proc mDegBasis(intvec d) 
+proc mDegBasis(intvec d)
 "
 USAGE: multidegree d
@@ -3079,12 +3079,12 @@
 
     intmat AA[nr][nc + 2 * n];
-    AA[1..nr, 1.. nc] = A[1..nr, 1.. nc]; 
-    AA[1..nr, nc + (1.. n)] = T[1..nr, 1.. n]; 
-    AA[1..nr, nc + n + (1.. n)] = -T[1..nr, 1.. n]; 
+    AA[1..nr, 1.. nc] = A[1..nr, 1.. nc];
+    AA[1..nr, nc + (1.. n)] = T[1..nr, 1.. n];
+    AA[1..nr, nc + n + (1.. n)] = -T[1..nr, 1.. n];
 
 
     //      print ( AA );
 
-    intmat K = leftKernelZ(( AA ) ); // 
+    intmat K = leftKernelZ(( AA ) ); //
 
     //      print(K);
@@ -3095,5 +3095,5 @@
     //      "!";
 
-    intmat B = hilbert4ti2intmat(transpose(KK), 1);  
+    intmat B = hilbert4ti2intmat(transpose(KK), 1);
 
     //      "!";      print(B);
@@ -3106,5 +3106,5 @@
 
 
-  int i;  
+  int i;
   int nnr = nrows(B);
   int nnc = ncols(B);
@@ -3165,5 +3165,5 @@
   intvec v1=4,0;
   intvec v2=4,4;
-  
+
   intmat g3[1][2]=1,1;
   setBaseMultigrading(g3);
@@ -3171,10 +3171,10 @@
   v3;
   mDegBasis(v3);
-  
+
   setBaseMultigrading(g1,l);
   mDegBasis(v1);
   setBaseMultigrading(g2);
   mDegBasis(v2);
-  
+
   intmat M[2][2] = 1, -1, -1, 1;
   intvec d = -2, 2;
@@ -3242,8 +3242,8 @@
 "
 {
-  if( isHomogeneous(I, "checkGens") == 0) 
-  { 
-    ERROR ("Sorry: inhomogeneous input!"); 
-  } 
+  if( isHomogeneous(I, "checkGens") == 0)
+  {
+    ERROR ("Sorry: inhomogeneous input!");
+  }
   module S = syz(I);
   S = setModuleGrading(S, mDeg(I));
@@ -3253,5 +3253,5 @@
 {
   "EXAMPLE:"; echo=2;
-  
+
 
   ring r = 0,(x,y,z,w),dp;
@@ -3261,10 +3261,10 @@
   setBaseMultigrading(MM);
   module M = ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3);
-  
- 
+
+
   intmat v[2][nrows(M)]=
     1,
     0;
-  
+
   M = setModuleGrading(M, v);
 
@@ -3285,5 +3285,5 @@
 PURPOSE: computes the multigraded 'modulo' module of I and J
 RETURNS: module, see 'modulo' command
-NOTE: I and J should have the same multigrading, and their 
+NOTE: I and J should have the same multigrading, and their
 generators must be multigraded homogeneous
 EXAMPLE: example mDegModulo; shows an example
@@ -3291,7 +3291,7 @@
 {
   if( (isHomogeneous(I, "checkGens") == 0) or (isHomogeneous(J, "checkGens") == 0) )
-  { 
-    ERROR ("Sorry: inhomogeneous input!"); 
-  } 
+  {
+    ERROR ("Sorry: inhomogeneous input!");
+  }
   module K = modulo(I, J);
   K = setModuleGrading(K, mDeg(I));
@@ -3312,5 +3312,5 @@
 
   "Multidegrees: "; print(mDeg(h1));
-   
+
   // Let's compute modulo(h1, h2):
   def K = mDegModulo(h1, h2); K;
@@ -3326,19 +3326,19 @@
 "USAGE: mDegGroebner(I); I is a poly/vector/ideal/module
 PURPOSE: computes the multigraded standard/groebner basis of I
-NOTE: I must be multigraded homogeneous 
+NOTE: I must be multigraded homogeneous
 RETURNS: ideal/module, the computed basis
 EXAMPLE: example mDegGroebner; shows an example
 "
 {
-  if( isHomogeneous(I) == 0) 
-  { 
-    ERROR ("Sorry: inhomogeneous input!"); 
-  } 
+  if( isHomogeneous(I) == 0)
+  {
+    ERROR ("Sorry: inhomogeneous input!");
+  }
 
   def S = groebner(I);
-  
+
   if( typeof(I) == "module" or typeof(I) == "vector" )
   {
-    S = setModuleGrading(S, getModuleGrading(I));      
+    S = setModuleGrading(S, getModuleGrading(I));
   }
 
@@ -3357,12 +3357,12 @@
   setBaseMultigrading(MM);
 
-  
+
   module M = ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3);
-  
- 
+
+
   intmat v[2][nrows(M)]=
     1,
     0;
-  
+
   M = setModuleGrading(M, v);
 
@@ -3397,17 +3397,17 @@
 proc mDegResolution(def I, int ll, list #)
 "USAGE: mDegResolution(I,l,[f]); I is poly/vector/ideal/module; l,f are integers
-PURPOSE: computes the multigraded resolution of I of the length l, 
-or the whole resolution if l is zero. Returns minimal resolution if an optional 
+PURPOSE: computes the multigraded resolution of I of the length l,
+or the whole resolution if l is zero. Returns minimal resolution if an optional
 argument 1 is supplied
 NOTE: input must have multigraded-homogeneous generators.
-The returned list is truncated beginning with the first zero differential.   
+The returned list is truncated beginning with the first zero differential.
 RETURNS: list, the computed resolution
 EXAMPLE: example mDegResolution; shows an example
 "
 {
-  if( isHomogeneous(I, "checkGens") == 0) 
-  { 
-    ERROR ("Sorry: inhomogeneous input!"); 
-  } 
+  if( isHomogeneous(I, "checkGens") == 0)
+  {
+    ERROR ("Sorry: inhomogeneous input!");
+  }
 
   def R = res(I, ll, #); list L = R; int l = size(L);
@@ -3418,5 +3418,5 @@
   }
 
-  int i; 
+  int i;
   for( i = 2; i <= l; i++ )
   {
@@ -3429,13 +3429,13 @@
     }
   }
- 
+
   return (L);
 
-  
+
 }
 example
 {
   "EXAMPLE:"; echo=2;
-  
+
   ring r = 0,(x,y,z,w),dp;
 
@@ -3446,22 +3446,22 @@
   setBaseMultigrading(M);
 
-  
+
   module m= ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3);
-  
+
   isHomogeneous(ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3), "checkGens");
-  
+
   ideal A = xw-yz, x2z-y3, xz2-y2w, yw2-z3;
 
   int j;
-  
+
   for(j=1; j<=ncols(A); j++)
   {
     mDegPartition(A[j]);
   }
-  
+
   intmat v[2][1]=
     1,
     0;
-  
+
   m = setModuleGrading(m, v);
 
@@ -3490,5 +3490,5 @@
 
   /////////////////////////////////////////////////////////////////////////////
-  
+
   L = mDegResolution(maxideal(1), 0, 1);
 
@@ -3500,7 +3500,7 @@
     "Multigrading: "; print(mDeg(L[j]));
   }
-  
+
   kill v;
-  
+
 
   def h = hilbertSeries(m);
@@ -3509,5 +3509,5 @@
   numerator1;
   factorize(numerator1);
-  
+
   denominator1;
   factorize(denominator1);
@@ -3523,14 +3523,14 @@
 proc hilbertSeries(def I)
 "USAGE: hilbertSeries(I); I is poly/vector/ideal/module
-PURPOSE: computes the multigraded Hilbert Series of M 
-NOTE: input must have multigraded-homogeneous generators. 
+PURPOSE: computes the multigraded Hilbert Series of M
+NOTE: input must have multigraded-homogeneous generators.
 Multigrading should be positive.
-RETURNS: a ring in variables t_(i), s_(i), with polynomials 
-numerator1 and denominator1 and muturally prime numerator2 
+RETURNS: a ring in variables t_(i), s_(i), with polynomials
+numerator1 and denominator1 and muturally prime numerator2
 and denominator2, quotients of which give the series.
 EXAMPLE: example hilbertSeries; shows an example
 "
 {
-   
+
   if( !isFreeRepresented() )
   {
@@ -3538,9 +3538,9 @@
     //ERROR("SORRY: ONLY TORSION-FREE CASE (POSITIVE GRADING)");
   }
-   
+
   int i, j, k, v;
 
   intmat M = getVariableWeights();
-  
+
   int cc = ncols(M);
   int n = nrows(M);
@@ -3554,5 +3554,5 @@
 
   int l = size(RES);
-  
+
   list L; L[l + 1] = 0;
 
@@ -3561,5 +3561,5 @@
     intmat zeros[n][1];
     L[1] = zeros;
-  } 
+  }
   else
   {
@@ -3571,17 +3571,17 @@
     L[j + 1] = mDeg(RES[j]);
   }
-  
+
   l++;
 
   ring R = 0,(t_(1..n),s_(1..n)),dp;
-  
-  ideal units; 
+
+  ideal units;
   for( i=n; i>=1; i--)
   {
     units[i] = (var(i) * var(n + i) - 1);
   }
-  
+
   qring Q = std(units);
-  
+
   // TODO: should not it be a quotient ring depending on Torsion???
   // I am not sure about what to do in the torsion case, but since
@@ -3592,5 +3592,5 @@
   poly monom, summand, numerator;
   poly denominator = 1;
-  
+
   for( i = 1; i <= cc; i++)
   {
@@ -3603,5 +3603,5 @@
       {
         monom = monom * (var(k)^(v));
-      } 
+      }
       else
       {
@@ -3609,5 +3609,5 @@
       }
     }
-    
+
     if( monom == 1)
     {
@@ -3617,6 +3617,6 @@
     denominator = denominator * (1 - monom);
   }
-  
-  for( j = 1; j<= l; j++) 
+
+  for( j = 1; j<= l; j++)
   {
     summand = 0;
@@ -3632,5 +3632,5 @@
         {
           monom = monom * (var(k)^v);
-        } 
+        }
         else
         {
@@ -3642,10 +3642,10 @@
     numerator = numerator - (-1)^j * summand;
   }
-  
+
   if( denominator == 0 )
   {
     ERROR("Multigrading not positive.");
-  } 
-  
+  }
+
   poly denominator1 = denominator;
   poly numerator1 = numerator;
@@ -3681,5 +3681,5 @@
   "The s_(i)-variables are defined to be the inverse of the t_(i)-variables.";
   " ------------ ";
-  
+
   return(Q);
 }
@@ -3687,5 +3687,5 @@
 {
   "EXAMPLE:"; echo=2;
-  
+
   ring r = 0,(x,y,z,w),dp;
   intmat g[2][4]=
@@ -3693,5 +3693,5 @@
     0,1,3,4;
   setBaseMultigrading(g);
-  
+
   module M = ideal(xw-yz, x2z-y3, xz2-y2w, yw2-z3);
   intmat V[2][1]=
@@ -3705,5 +3705,5 @@
   factorize(numerator2);
   factorize(denominator2);
-  
+
   kill g, h; setring r;
 
@@ -3711,7 +3711,7 @@
     1,2,3,4,
     0,0,5,8;
-  
+
   setBaseMultigrading(g);
-  
+
   ideal I = x^2, y, z^3;
   I = std(I);
@@ -3728,5 +3728,5 @@
   mDeg(I);
   def h = hilbertSeries(I); setring h;
-  
+
   factorize(numerator2);
   factorize(denominator2);
@@ -3735,12 +3735,12 @@
   ////////////////////////////////////////////////
   ring R = 0,(x,y,z),dp;
-  intmat W[2][3] = 
+  intmat W[2][3] =
      1,1, 1,
      0,0,-1;
   setBaseMultigrading(W);
   ideal I = x3y,yz2,y2z,z4;
-  
+
   def h = hilbertSeries(I); setring h;
-  
+
   factorize(numerator2);
   factorize(denominator2);
@@ -3749,21 +3749,21 @@
   ////////////////////////////////////////////////
   ring R = 0,(x,y,z,a,b,c),dp;
-  intmat W[2][6] = 
+  intmat W[2][6] =
      1,1, 1,1,1,1,
      0,0,-1,0,0,0;
   setBaseMultigrading(W);
   ideal I = x3y,yz2,y2z,z4;
-  
+
   def h = hilbertSeries(I); setring h;
-  
+
   factorize(numerator2);
   factorize(denominator2);
-  
+
   kill R, W, h;
   ////////////////////////////////////////////////
   // This is example 5.3.9. from Robbianos book.
-  
+
   ring R = 0,(x,y,z,w),dp;
-  intmat W[1][4] = 
+  intmat W[1][4] =
      1,1, 1,1;
   setBaseMultigrading(W);
@@ -3771,7 +3771,7 @@
 
   hilb(std(I));
-  
+
   def h = hilbertSeries(I); setring h;
-  
+
   numerator1;
   denominator1;
@@ -3779,5 +3779,5 @@
   factorize(numerator2);
   factorize(denominator2);
-  
+
 
   kill h;
@@ -3788,5 +3788,5 @@
 
   hilb(std(I2));
-  
+
   def h = hilbertSeries(I2); setring h;
 
@@ -3798,7 +3798,7 @@
   ////////////////////////////////////////////////
   setring R;
-  
+
   W = 2,2,2,2;
-  
+
   setBaseMultigrading(W);
 
@@ -3810,13 +3810,13 @@
 
   kill w;
-  
+
 
   def h = hilbertSeries(I2); setring h;
 
-  
+
   numerator1; denominator1;
   kill h;
 
-  
+
   kill R, W;
 
@@ -3832,5 +3832,5 @@
 
   hilb(std(I));
-  
+
   def h = hilbertSeries(I); setring h;
 
@@ -3848,30 +3848,4 @@
 
   numerator1; denominator1;
-  
-  kill h;  
-  ////////////////////////////////////////////////
-  setring R;
-
-  I = x^5; I;
-
-  hilb(std(I));
-  hilb(std(I), 1);
-
-  def h = hilbertSeries(I); setring h;
-
-  numerator1; denominator1;
-  
-  
-  kill h;  
-  ////////////////////////////////////////////////
-  setring R;
-
-  I = x^10; I;
-
-  hilb(std(I));
-
-  def h = hilbertSeries(I); setring h;
-
-  numerator1; denominator1;
 
   kill h;
@@ -3879,14 +3853,13 @@
   setring R;
 
-  module M = 1;
-
-  M = setModuleGrading(M, W);
-
-  
-  hilb(std(M));
-
-  def h = hilbertSeries(M); setring h;
+  I = x^5; I;
+
+  hilb(std(I));
+  hilb(std(I), 1);
+
+  def h = hilbertSeries(I); setring h;
 
   numerator1; denominator1;
+
 
   kill h;
@@ -3894,13 +3867,9 @@
   setring R;
 
-  kill M; module M = x^5*gen(1);
-//  intmat V[1][3] = 0; // TODO: this would lead to a wrong result!!!? 
-  intmat V[1][1] = 0; // all gen(i) of degree 0!
-
-  M = setModuleGrading(M, V);
-
-  hilb(std(M));
-
-  def h = hilbertSeries(M); setring h;
+  I = x^10; I;
+
+  hilb(std(I));
+
+  def h = hilbertSeries(I); setring h;
 
   numerator1; denominator1;
@@ -3908,17 +3877,14 @@
   kill h;
   ////////////////////////////////////////////////
-  setring R; 
-
-  module N = x^5*gen(3);
-
-  kill V;
-  
-  intmat V[1][3] = 0; // all gen(i) of degree 0!
-
-  N = setModuleGrading(N, V);
-      
-  hilb(std(N));
-
-  def h = hilbertSeries(N); setring h;
+  setring R;
+
+  module M = 1;
+
+  M = setModuleGrading(M, W);
+
+
+  hilb(std(M));
+
+  def h = hilbertSeries(M); setring h;
 
   numerator1; denominator1;
@@ -3926,9 +3892,43 @@
   kill h;
   ////////////////////////////////////////////////
-  setring R; 
-
-  
+  setring R;
+
+  kill M; module M = x^5*gen(1);
+//  intmat V[1][3] = 0; // TODO: this would lead to a wrong result!!!?
+  intmat V[1][1] = 0; // all gen(i) of degree 0!
+
+  M = setModuleGrading(M, V);
+
+  hilb(std(M));
+
+  def h = hilbertSeries(M); setring h;
+
+  numerator1; denominator1;
+
+  kill h;
+  ////////////////////////////////////////////////
+  setring R;
+
+  module N = x^5*gen(3);
+
+  kill V;
+
+  intmat V[1][3] = 0; // all gen(i) of degree 0!
+
+  N = setModuleGrading(N, V);
+
+  hilb(std(N));
+
+  def h = hilbertSeries(N); setring h;
+
+  numerator1; denominator1;
+
+  kill h;
+  ////////////////////////////////////////////////
+  setring R;
+
+
   module S = M + N;
-  
+
   S = setModuleGrading(S, V);
 
@@ -3952,5 +3952,5 @@
 "
 {
-  if( 2*size(v) != nvars(h) ) 
+  if( 2*size(v) != nvars(h) )
   {
     ERROR("Wrong input/size!");
@@ -3976,9 +3976,9 @@
     V[i] = var(i) - k;
   }
-   
+
   V = groebner(V);
-   
-  n = NF(n, V); 
-  d = NF(d, V); 
+
+  n = NF(n, V);
+  d = NF(d, V);
 
   n;
@@ -3989,5 +3989,5 @@
     ERROR("Sorry: denominator is zero!");
   }
-  
+
   if( n == 0 )
   {
@@ -3996,5 +3996,5 @@
 
   poly g = gcd(n, d);
-  
+
   if( g != leadcoef(g) )
   {
@@ -4005,6 +4005,6 @@
   n;
   d;
-   
-   
+
+
   for( i = N; i > 0; i -- )
   {
@@ -4012,11 +4012,11 @@
     n;
     d;
-     
+
     k = v[i];
     k;
-     
+
     n = subst(n, var(i), k);
     d = subst(d, var(i), k);
-    
+
     if( k != 0 )
     {
@@ -4034,5 +4034,5 @@
     ERROR("Sorry: denominator is zero!");
   }
-  
+
   if( n == 0 )
   {
@@ -4041,5 +4041,5 @@
 
   poly g = gcd(n, d);
-  
+
   if( g != leadcoef(g) )
   {
@@ -4050,5 +4050,5 @@
   n;
   d;
-   
+
   if( n != leadcoef(n) || d != leadcoef(d) )
   {
@@ -4080,5 +4080,5 @@
 ideal I = mDegBasis(0);
 ideal J = attrib(I,"ZeroPart");
-/* 
+/*
 I am not quite sure what this ZeroPart is anymore. I thought it
 should contain all monomials of degree 0, but then apparently 1 should
@@ -4094,5 +4094,5 @@
   setBaseMultigrading(A);
   isPositive();
-  
+
   intmat A[1][2]=1,1;
   setBaseMultigrading(A);
@@ -4127,6 +4127,6 @@
 
   example mDegResolution;
-  
-  "// ******************* example hilbertSeries ************************//"; 
+
+  "// ******************* example hilbertSeries ************************//";
   example hilbertSeries;
 
@@ -4142,5 +4142,5 @@
   "d: ";
   print(md);
-  
+
   "M: ";
   module LL = M; // + L for d+1
@@ -4149,11 +4149,11 @@
 
 
-  intmat V = getModuleGrading(M); 
+  intmat V = getModuleGrading(M);
   intvec vi;
-  int s = nrows(M); 
+  int s = nrows(M);
   int r = nrows(V);
   int i;
   module L; def B;
-  for (i=s; i>0; i--) 
+  for (i=s; i>0; i--)
   {
     "comp: ", i;
@@ -4179,5 +4179,5 @@
   print(L);
   print(mDeg(L));
-   
+
   V = getModuleGrading(L);
 
@@ -4190,10 +4190,10 @@
     }
   }
-  
+
   L = simplify(L, 2);
   L = setModuleGrading(L, V);
   print(L);
   print(mDeg(L));
-  
+
   return(L);
 }
@@ -4204,15 +4204,15 @@
   // TODO!
   ring r = 32003, (x,y), dp;
-  
-  intmat M[2][2] = 
-    1, 0, 
+
+  intmat M[2][2] =
+    1, 0,
     0, 1;
 
   setBaseMultigrading(M);
 
-  intmat V[2][1] = 
-    0, 
+  intmat V[2][1] =
+    0,
     0;
-  
+
   "X:";
   module h1 = x;
@@ -4231,6 +4231,6 @@
 
 /******************************************************/
-/* Some functions on lattices. 
-TODO Tuebingen: - add functionality (see wiki) and 
+/* Some functions on lattices.
+TODO Tuebingen: - add functionality (see wiki) and
 - adjust them to work for groups as well.*/
 /******************************************************/
@@ -4241,5 +4241,5 @@
 proc imageLattice(intmat Q, intmat L)
 "USAGE: imageLattice(Q,L); Q and L are of type intmat
-PURPOSE: compute an integral basis for the image of the 
+PURPOSE: compute an integral basis for the image of the
 lattice L under the homomorphism of lattices Q.
 RETURN: intmat
@@ -4255,5 +4255,5 @@
 {
   "EXAMPLE:"; echo=2;
-   
+
   intmat Q[2][3] =
     1,2,3,
@@ -4275,5 +4275,5 @@
 "
 USAGE: intRank(A); intmat A
-PURPOSE: compute the rank of the integral matrix A 
+PURPOSE: compute the rank of the integral matrix A
 by computing a hermite normalform.
 RETURNS: int
@@ -4291,8 +4291,8 @@
   {
     iszero = 1;
-    
+
     for ( i = 1; i <= nrows(B); i++ )
     {
-      if ( B[i,j] != 0 ) 
+      if ( B[i,j] != 0 )
       {
         iszero = 0;
@@ -4300,5 +4300,5 @@
       }
     }
-    
+
     if ( iszero == 1 )
     {
@@ -4313,8 +4313,8 @@
   {
     iszero = 1;
-    
+
     for ( j = 1; j <= ncols(B); j++ )
     {
-      if ( B[i,j] != 0 ) 
+      if ( B[i,j] != 0 )
       {
         iszero = 0;
@@ -4322,5 +4322,5 @@
       }
     }
-    
+
     if ( iszero == 1 )
     {
@@ -4331,9 +4331,9 @@
   int r = nrows(B) - nzerorows;
 
-  if ( ncols(B) - nzerocols < r ) 
+  if ( ncols(B) - nzerocols < r )
   {
     r = ncols(B) - nzerocols;
   }
-  
+
   return(r);
 }
@@ -4359,7 +4359,7 @@
 proc isSublattice(intmat L, intmat S)
 "USAGE: isSublattice(L, S); L, S are of tpye intmat
-PURPOSE: checks whether the lattice created by L is a 
+PURPOSE: checks whether the lattice created by L is a
 sublattice of the lattice created by S.
-The procedure checks whether each generator of L is 
+The procedure checks whether each generator of L is
 contained in S.
 RETURN: 0 if false, 1 if true
@@ -4369,10 +4369,10 @@
   int a,b,g,i,j,k;
   intmat Ker;
-    
+
   // check whether each column v of L is contained in
   // the lattice generated by S
   for ( i = 1; i <= ncols(L); i++ )
   {
-    
+
     // v is the i-th column of L
     intvec v;
@@ -4398,5 +4398,5 @@
     }
 
-    
+
     // check gcd
     Ker = kernelLattice(B);
@@ -4410,5 +4410,5 @@
 
     g = R[1];
-    
+
     for ( j = 2; j <= size(R); j++ )
     {
@@ -4416,5 +4416,5 @@
     }
 
-    if ( g != 1 ) 
+    if ( g != 1 )
     {
       return(0);
@@ -4430,5 +4430,5 @@
 {
   "EXAMPLE:"; echo=2;
-   
+
   //ring R = 0,(x,y),dp;
   intmat S2[3][2]=
@@ -4457,5 +4457,5 @@
 proc latticeBasis(intmat B)
 "USAGE: latticeBasis(B); intmat B
-PURPOSE: compute an integral basis for the lattice defined by 
+PURPOSE: compute an integral basis for the lattice defined by
 the columns of B.
 RETURNS: intmat
@@ -4464,7 +4464,7 @@
 {
   int n = ncols(B);
-  int r = intRank(B); 
- 
-  if ( r == 0 ) 
+  int r = intRank(B);
+
+  if ( r == 0 )
   {
     intmat H[nrows(B)][1];
@@ -4473,5 +4473,5 @@
     for ( j = 1; j <= nrows(B); j++ )
     {
-      H[j,1] = 0;   
+      H[j,1] = 0;
     }
   }
@@ -4480,14 +4480,14 @@
     intmat H = hermiteNormalForm(B);;
 
-    if (r < n) 
+    if (r < n)
     {
       // delete columns r+1 to n
       // should be identical with the function
-      // H = submat(H,1..nrows(H),1..r); 
+      // H = submat(H,1..nrows(H),1..r);
       // for matrices
       intmat Hdel[nrows(H)][r];
       int k;
       int m;
-      
+
       for ( k = 1; k <= nrows(H); k++ )
       {
@@ -4498,14 +4498,14 @@
       }
 
-      H = Hdel;      
-    }
-  }
-  
-  return(H);  
-} 
+      H = Hdel;
+    }
+  }
+
+  return(H);
+}
 example
 {
   "EXAMPLE:"; echo=2;
-  
+
   intmat L[3][3] =
     1,4,8,
@@ -4538,5 +4538,5 @@
   else
   {
-    if ( r == n ) 
+    if ( r == n )
     {
       intmat U[n][1];  // now all entries are zero.
@@ -4549,10 +4549,10 @@
       // delete columns 1 to r
       // should be identical with the function
-      // U = submat(U,1..nrows(U),r+1..); 
+      // U = submat(U,1..nrows(U),r+1..);
       // for matrices
       intmat Udel[nrows(U)][ncols(U) - r];
       int k;
       int m;
-      
+
       for ( k = 1; k <= nrows(U); k++ )
       {
@@ -4563,5 +4563,5 @@
       }
 
-      U = Udel;  
+      U = Udel;
 
     }
@@ -4574,5 +4574,5 @@
   "EXAMPLE"; echo = 2;
 
-  intmat LL[3][4] = 
+  intmat LL[3][4] =
     1,4,7,10,
     2,5,8,11,
@@ -4634,5 +4634,5 @@
   int k;
   int m;
-      
+
   for ( k = 1; k <= nrows(Del); k++ )
   {
@@ -4642,8 +4642,8 @@
     }
   }
-  
+
   L = latticeBasis(Del);
 
-  return(L); 
+  return(L);
 
 }
@@ -4652,5 +4652,5 @@
   "EXAMPLE"; echo = 2;
 
-  intmat P[2][3] = 
+  intmat P[2][3] =
     2,6,10,
     4,8,12;
@@ -4671,7 +4671,7 @@
 proc isPrimitiveSublattice(intmat A);
 "USAGE: isPrimitiveSublattice(A); intmat A
-PURPOSE: check whether the given set of integral vectors in ZZ^m, 
-i.e. the columns of A, generate a primitive sublattice in ZZ^m 
-(a direct summand of ZZ^m). 
+PURPOSE: check whether the given set of integral vectors in ZZ^m,
+i.e. the columns of A, generate a primitive sublattice in ZZ^m
+(a direct summand of ZZ^m).
 RETURNS: int, where 0 is false and 1 is true.
 EXAMPLE: example isPrimitiveSublattice; shows an example
@@ -4680,6 +4680,6 @@
   intmat B = smithNormalForm(A);
   int r = intRank(B);
-  
-  if ( r == 0 ) 
+
+  if ( r == 0 )
   {
     return(1);
@@ -4696,5 +4696,5 @@
 {
   "EXAMPLE"; echo = 2;
-  
+
   intmat A[3][2] =
     1,4,
@@ -4704,5 +4704,5 @@
   // should be 0
   int b = isPrimitiveSublattice(A);
- 
+
   kill A,b;
 }
@@ -4711,5 +4711,5 @@
 proc isIntegralSurjective(intmat P);
 "USAGE: isIntegralSurjective(P); intmat P
-PURPOSE: test whether the given linear map P of lattices is 
+PURPOSE: test whether the given linear map P of lattices is
 surjective.
 RETURNS: int, where 0 is false and 1 is true.
@@ -4718,5 +4718,5 @@
 {
   int r = intRank(P);
-  
+
   if ( r < nrows(P) )
   {
@@ -4734,13 +4734,13 @@
 {
   "EXAMPLE"; echo = 2;
-  
+
   intmat A[3][2] =
     1,3,5,
     2,4,6;
-    
+
   // should be 0
   int b = isIntegralSurjective(A);
   print(b);
- 
+
   kill A,b;
 }
@@ -4749,6 +4749,6 @@
 proc projectLattice(intmat B)
 "USAGE: projectLattice(B); intmat B
-PURPOSE: A set of vectors in ZZ^m is given as the columns of B. 
-Then this function provides a linear map ZZ^m --> ZZ^n 
+PURPOSE: A set of vectors in ZZ^m is given as the columns of B.
+Then this function provides a linear map ZZ^m --> ZZ^n
 having the primitive span of B its kernel.
 RETURNS: intmat
@@ -4765,5 +4765,5 @@
   else
   {
-    if ( r == n ) 
+    if ( r == n )
     {
       intmat U[n][1]; // U now is the n-dim zero-vector
@@ -4772,6 +4772,6 @@
     {
       // we want a matrix with column operations so we transpose
-      list L = hermiteNormalForm(B, "transform"); //hermite(transpose(B), "transform"); 
-      intmat U = transpose(L[2]); 
+      list L = hermiteNormalForm(B, "transform"); //hermite(transpose(B), "transform");
+      intmat U = transpose(L[2]);
 
       // delete rows 1 to r
@@ -4779,5 +4779,5 @@
       int k;
       int m;
-      
+
       for ( k = 1; k <= nrows(U) - r ; k++ )
       {
@@ -4788,9 +4788,9 @@
       }
 
-      U = Udel;  
-      
-    }
-  }
-  
+      U = Udel;
+
+    }
+  }
+
   return(U);
 }
@@ -4798,15 +4798,15 @@
 {
   "EXAMPLE"; echo = 2;
-  
-  intmat B[4][2] = 
+
+  intmat B[4][2] =
     1,5,
     2,6,
     3,7,
     4,8;
-  
+
   // should result in a (2x4)-matrix with columns
   // [-1, 2], [2, â3], [-1, 0] and [0, 1].
   intmat U = projectLattice(B);
-  
+
 }
 
@@ -4814,5 +4814,5 @@
 proc intersectLattices(intmat A, intmat B)
 "USAGE: intersectLattices(A, B); intmat A, intmat B
-PURPOSE: compute an integral basis for the intersection of the 
+PURPOSE: compute an integral basis for the intersection of the
 lattices A and B.
 RETURNS: intmat
@@ -4845,8 +4845,8 @@
   // delete all rows in K from ncols(A)+1 onwards
   intmat Bas[ncols(A)][ncols(K)];
-  
+
   for ( i = 1; i <= nrows(Bas); i++ )
   {
-    for ( j = 1; j <= ncols(Bas); j++ ) 
+    for ( j = 1; j <= ncols(Bas); j++ )
     {
       Bas[i,j] = K[i,j];
@@ -4859,5 +4859,5 @@
   int r = intRank(Cut);
 
-  if ( r == 0 ) 
+  if ( r == 0 )
   {
     intmat Cutdel[nrows(Cut)][1]; // is now the zero-vector
@@ -4872,5 +4872,5 @@
     for ( i = 1; i <= nrows(Cutdel); i++ )
     {
-      for ( j = 1; j <= r; j++ ) 
+      for ( j = 1; j <= r; j++ )
       {
         Cutdel[i,j] = Cut[i,j];
@@ -4886,24 +4886,24 @@
 {
   "EXAMPLE"; echo = 2;
-  
-  intmat A[3][2] = 
+
+  intmat A[3][2] =
     1,4,
     2,5,
     3,6;
 
-  intmat B[3][2] = 
+  intmat B[3][2] =
     6,9,
     7,10,
     8,11;
-  
+
   // should result in a (2x4)-matrix with columns
   // [3, 3, 3], [0, 3, 6]
   intmat U = intersectLattices(A,B);
-  
+
 }
 
 proc intInverse(intmat A);
 "USAGE: intInverse(A); intmat A
-PURPOSE: compute the integral inverse of the intmat A. 
+PURPOSE: compute the integral inverse of the intmat A.
 If det(A) is neither 1 nor -1 an error is returned.
 RETURNS: intmat
@@ -4912,10 +4912,10 @@
 {
   int d = det(A);
-  
+
   if ( d * d != 1 ) // is d = 1 or -1? Else: error
   {
     ERROR("determinant of the given intmat has to be 1 or -1.");
   }
-  
+
   int c;
   int i,j;
@@ -4930,5 +4930,5 @@
       Ad = intAdjoint(A,i,j);
       s = 1;
-    
+
       if ( ((i + j) % 2) > 0 )
       {
@@ -5005,5 +5005,5 @@
 {
   "EXAMPLE"; echo = 2;
-  
+
   intmat A[2][3] =
     1,3,5,
@@ -5027,18 +5027,18 @@
   int m = nrows(P);
   int n = ncols(P);
-  
+
   if ( m == n )
   {
-    intmat U = intInverse(P); 
+    intmat U = intInverse(P);
   }
   else
   {
     intmat U = (hermiteNormalForm(P, "transform"))[2];
-    
+
     // delete columns m+1 to n
     intmat Udel[nrows(U)][ncols(U) - (n - m)];
     int k;
     int z;
-      
+
     for ( k = 1; k <= nrows(U); k++ )
     {
@@ -5048,6 +5048,6 @@
       }
     }
-    
-    U = Udel;  
+
+    U = Udel;
   }
 
@@ -5062,5 +5062,5 @@
     2,4,5,7;
 
-  // should be a matrix with two columns 
+  // should be a matrix with two columns
   // for example: [â2, 1, 0, 0], [3, â3, 0, 1]
   intmat U = integralSection(P);
@@ -5069,5 +5069,5 @@
   print(P * U);
 
-  kill U;  
+  kill U;
 }
 
@@ -5087,5 +5087,5 @@
   intmat L2 = H[2];
 
-  // check whether G,H are subgroups of a common group, i.e. whether L1 and L2 span the same lattice  
+  // check whether G,H are subgroups of a common group, i.e. whether L1 and L2 span the same lattice
   if ( !isSublattice(L1,L2) || !isSublattice(L2,L1))
   {
@@ -5109,5 +5109,5 @@
 {
   "EXAMPLE"; echo = 2;
-  
+
   intmat S1[2][2] =
     1,0,
@@ -5117,5 +5117,5 @@
     0;
 
-  intmat S2[2][1] = 
+  intmat S2[2][1] =
     1,
     0;
@@ -5131,5 +5131,5 @@
 
   kill G,H,N,S1,L1,S2,L2;
-    
+
 }
 
@@ -5152,6 +5152,6 @@
 
   // concatinate matrices to get S
-  intmat A = concatintmat(S1,OS1); 
-  intmat B = concatintmat(OS2,S2); 
+  intmat A = concatintmat(S1,OS1);
+  intmat B = concatintmat(OS2,S2);
   intmat At = transpose(A);
   intmat Bt = transpose(B);
@@ -5160,6 +5160,6 @@
 
   // concatinate matrices to get L
-  intmat C = concatintmat(L1,OL1); 
-  intmat D = concatintmat(OL2,L2); 
+  intmat C = concatintmat(L1,OL1);
+  intmat D = concatintmat(OL2,L2);
   intmat Ct = transpose(C);
   intmat Dt = transpose(D);
@@ -5175,5 +5175,5 @@
 {
   "EXAMPLE"; echo = 2;
-  
+
   intmat S1[2][2] =
     1,0,
@@ -5183,5 +5183,5 @@
     0;
 
-  intmat S2[2][2] = 
+  intmat S2[2][2] =
     1,0,
     0,2;
@@ -5197,5 +5197,5 @@
 
   kill G,H,N,S1,L1,S2,L2;
-    
+
 }
 
@@ -5213,5 +5213,5 @@
   int r = intRank(V);
 
- 
+
   if ( r == 0 )
   {
@@ -5221,9 +5221,9 @@
   {
     list L = smithNormalForm(V, "transform"); // L = [A,S,B] where S is the smith-NF and S = A*S*B
-    intmat P = intInverse(L[1]); 
+    intmat P = intInverse(L[1]);
 
     print(L);
-    
-    if ( r < m ) 
+
+    if ( r < m )
     {
       // delete columns r+1 to m in P:
@@ -5248,5 +5248,5 @@
 {
   "EXAMPLE"; echo = 2;
-  
+
   intmat V[2][4] =
     1,4,
