Index: Singular/LIB/algebra.lib
===================================================================
--- Singular/LIB/algebra.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/algebra.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,4 +1,4 @@
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: algebra.lib,v 1.16 2008-07-02 09:42:59 Singular Exp $";
+version="$Id: algebra.lib,v 1.17 2008-10-06 17:04:26 Singular Exp $";
 category="Commutative Algebra";
 info="
@@ -395,5 +395,5 @@
         ideal A = imap(R2,A);
         A = std(A);
-        ideal ker = nselect(A,1,n);
+        ideal ker = nselect(A,1..n);
         setring R2;
         if ( defined(Q)==voice )
@@ -717,5 +717,5 @@
     def bsr = basering;
  // ------- checking whether phi is injective by computing the kernel -------
-    ideal ker = nselect(A,1,n);
+    ideal ker = nselect(A,1..n);
     t = size(ker);
     setring pr;
Index: Singular/LIB/bfct.lib
===================================================================
--- Singular/LIB/bfct.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/bfct.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: bfct.lib,v 1.4 2008-10-01 17:44:37 levandov Exp $";
+version="$Id: bfct.lib,v 1.5 2008-10-06 17:04:26 Singular Exp $";
 category="Noncommutative";
 info="
@@ -994,5 +994,5 @@
   setring DDh;
   dbprint(ppl, "the initial ideal:", string(matrix(inF)));
-  inF = nselect(inF,3,2*n+4);
+  inF = nselect(inF,3..2*n+4);
   inF = nselect(inF,1);
   dbprint(ppl, "generators containing only s:", string(matrix(inF)));
Index: Singular/LIB/dmod.lib
===================================================================
--- Singular/LIB/dmod.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/dmod.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: dmod.lib,v 1.30 2008-08-07 20:14:21 levandov Exp $";
+version="$Id: dmod.lib,v 1.31 2008-10-06 17:04:26 Singular Exp $";
 category="Noncommutative";
 info="
@@ -880,5 +880,5 @@
   dbprint(ppl-1, K);
   ideal M = engine(K,eng);
-  ideal K2 = nselect(M,1,Nnew-1);
+  ideal K2 = nselect(M,1..Nnew-1);
   kill K,M;
   dbprint(ppl,"// -2-3- _x,_Dx are eliminated in @R2");
@@ -1109,5 +1109,5 @@
   dbprint(ppl-1, K);
   ideal M = engine(K,eng);
-  ideal K2 = nselect(M,1,Nnew-1);
+  ideal K2 = nselect(M,1..Nnew-1);
   kill K,M;
   dbprint(ppl,"// -2-3- _x,_Dx are eliminated in @R2");
@@ -1259,5 +1259,5 @@
   ideal M = engine(J,eng);
   int Nnew = nvars(@R2);
-  ideal K2 = nselect(M,1,Nnew-1);
+  ideal K2 = nselect(M,1..Nnew-1);
   int ppl = printlevel-voice+2;
   dbprint(ppl,"// -1-1- _x,_Dx are eliminated in basering");
@@ -1454,5 +1454,5 @@
   ideal M = engine(J,eng);
   int Nnew = nvars(@R2);
-  ideal K2 = nselect(M,1,Nnew-1);
+  ideal K2 = nselect(M,1..Nnew-1);
   dbprint(ppl,"// -2-0- _x,_Dx are eliminated in basering");
   dbprint(ppl-1, K2);
@@ -1760,5 +1760,5 @@
   dbprint(ppl-1, K);
   ideal M = engine(K,eng);
-  ideal K2 = nselect(M,1,Nnew-1);
+  ideal K2 = nselect(M,1..Nnew-1);
   kill K,M;
   dbprint(ppl,"// -2-3- _x,_Dx are eliminated in @R2");
@@ -2260,5 +2260,5 @@
   dbprint(ppl-1, I);
   ideal J = engine(I,eng);
-  ideal K = nselect(J,1,P);
+  ideal K = nselect(J,1..P);
   kill I,J;
   dbprint(ppl,"// -1-3- all t(i) are eliminated");
@@ -2345,5 +2345,5 @@
   dbprint(ppl-1, K);
   ideal M = engine(K,eng);
-  ideal K2 = nselect(M,1,Nnew-P);
+  ideal K2 = nselect(M,1..Nnew-P);
   kill K,M;
   dbprint(ppl,"// -2-3- _x,_Dx are eliminated in @R2");
@@ -2581,5 +2581,5 @@
   dbprint(ppl-1, I);
   ideal J = engine(I,eng);
-  ideal K = nselect(J,1,2);
+  ideal K = nselect(J,1..2);
   dbprint(ppl,"// -1-3- u,v are eliminated");
   dbprint(ppl-1, K);  // K is without u,v
@@ -2653,5 +2653,5 @@
   dbprint(ppl-1, K);
   ideal M  = engine(K,eng);
-  ideal K2 = nselect(M,1,2);
+  ideal K2 = nselect(M,1..2);
   dbprint(ppl,"// -2-3- t,Dt are eliminated");
   dbprint(ppl-1, K2);
@@ -2722,5 +2722,5 @@
   dbprint(ppl-1, K);
   ideal M = engine(K,eng);
-  ideal K3 = nselect(M,1,Nnew-1);
+  ideal K3 = nselect(M,1..Nnew-1);
   dbprint(ppl,"// -3-3-  _x,_Dx are eliminated in @R3");
   dbprint(ppl-1, K3);
@@ -2959,5 +2959,5 @@
   dbprint(ppl-1, I);
   ideal J = engine(I,eng);
-  ideal K = nselect(J,1,2);
+  ideal K = nselect(J,1..2);
   dbprint(ppl,"// -1-3- u,v are eliminated");
   dbprint(ppl-1, K);  // K is without u,v
@@ -3031,5 +3031,5 @@
   dbprint(ppl-1, K);
   ideal M  = engine(K,eng);
-  ideal K2 = nselect(M,1,2);
+  ideal K2 = nselect(M,1..2);
   dbprint(ppl,"// -2-3- t,Dt are eliminated");
   dbprint(ppl-1, K2);
@@ -3464,5 +3464,5 @@
   dbprint(ppl-1, I);
   ideal J = engine(I,eng);
-  ideal K = nselect(J,1,2);
+  ideal K = nselect(J,1..2);
   dbprint(ppl,"// -1-3- t,Dt are eliminated");
   dbprint(ppl-1, K);  // K is without t, Dt
@@ -3689,5 +3689,5 @@
   dbprint(ppl-1, I);
   ideal J = engine(I,eng);
-  ideal K = nselect(J,1,2);
+  ideal K = nselect(J,1..2);
   dbprint(ppl,"// -1-3- t,Dt are eliminated");
   dbprint(ppl-1, K);  // K is without t, Dt
@@ -3861,5 +3861,5 @@
   ideal M = engine(J,eng);
   int Nnew = nvars(@R2);
-  ideal K2 = nselect(M,1,Nnew-1);
+  ideal K2 = nselect(M,1..Nnew-1);
   int ppl = printlevel-voice+2;
   dbprint(ppl,"// -1-1- _x,_Dx are eliminated in basering");
@@ -4116,5 +4116,5 @@
 //   dbprint(ppl,"// -1-2- starting the elimination of u,v in @R");
 //   ideal J = engine(I,eng);
-//   ideal K = nselect(J,1,2);
+//   ideal K = nselect(J,1..2);
 //   dbprint(ppl,"// -1-3- u,v are eliminated in @R");
 //   dbprint(ppl-1,K); // without u,v: not yet our answer
@@ -4188,5 +4188,5 @@
 //   dbprint(ppl,"// -2-2- starting elimination for t,Dt in @R2");
 //   ideal J  = engine(K2,eng);
-//   ideal K  = nselect(J,1,2);
+//   ideal K  = nselect(J,1..2);
 //   dbprint(ppl,"// -2-3- t,Dt are eliminated");
 //   dbprint(ppl-1,K);
@@ -5029,5 +5029,5 @@
   dbprint(ppl-1, J);
   ideal G = engine(J,eng);
-  ideal K = nselect(G,1,N-1);
+  ideal K = nselect(G,1..N-1);
   kill J,G;
   dbprint(ppl,"// -1-3- _x,_Dx are eliminated");
Index: Singular/LIB/dmodapp.lib
===================================================================
--- Singular/LIB/dmodapp.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/dmodapp.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: dmodapp.lib,v 1.8 2008-10-01 17:44:38 levandov Exp $";
+version="$Id: dmodapp.lib,v 1.9 2008-10-06 17:04:26 Singular Exp $";
 category="Noncommutative";
 info="
@@ -852,5 +852,5 @@
   ideal M = groebner(J);
   int Nnew = nvars(@R2);
-  ideal K2 = nselect(M,1,Nnew-1);
+  ideal K2 = nselect(M,1..Nnew-1);
   int ppl = printlevel-voice+2;
   dbprint(ppl,"// -1-1- _x,_Dx are eliminated in basering");
@@ -1171,5 +1171,5 @@
   dbprint(ppl-1,"// -1-2-1- result of the  elimination of @t,@Dt in @R");
   dbprint(ppl-1, J);;
-  ideal K = nselect(J,1,2);
+  ideal K = nselect(J,1..2);
   dbprint(ppl,"// -1-3- @t,@Dt are eliminated");
   dbprint(ppl-1, K);  // K is without t, Dt
Index: Singular/LIB/elim.lib
===================================================================
--- Singular/LIB/elim.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/elim.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,6 +1,6 @@
-// $Id: elim.lib,v 1.22 2008-04-22 17:20:51 Singular Exp $
+// $Id: elim.lib,v 1.23 2008-10-06 17:04:26 Singular Exp $
 // (GMG, last modified 22.06.96)
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: elim.lib,v 1.22 2008-04-22 17:20:51 Singular Exp $";
+version="$Id: elim.lib,v 1.23 2008-10-06 17:04:26 Singular Exp $";
 category="Commutative Algebra";
 info="
@@ -9,10 +9,11 @@
 PROCEDURES:
  blowup0(j[,s1,s2]);    create presentation of blownup ring of ideal j
- elim(id,n,m);          variable n..m eliminated from id (ideal/module)
+ elim(id,v);            eliminate variables in v from id (ideal/module)
  elim1(id,p);           p=product of vars to be eliminated from id
- nselect(id,n[,m]);     select generators not containing nth [..mth] variable
+ nselect(id,v);         select generators not containing variables given by v
  sat(id,j);             saturated quotient of ideal/module id by ideal j
- select(id,n[,m]);      select generators containing all variables n...m
- select1(id,n[,m]);     select generators containing one variable n...m
+ select(id,v);          select generators containing all variables given by v
+ select1(id,v);         select generators containing one variable given by v
+
            (parameters in square brackets [] are optional)
 ";
@@ -188,7 +189,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
-proc elim (id, int n, int m)
-"USAGE:   elim(id,n,m);  id ideal/module, n,m integers
-RETURNS: ideal/module obtained from id by eliminating variables var(n) to var(m)
+proc elim (id, intvec va)
+"USAGE:   elim(id,v);  id ideal/module, v intvec
+RETURNS: ideal/module obtained from id by eliminating variables in v
 NOTE:    no special monomial ordering is required, result is a SB with
          respect to ordering dp (resp. ls) if the first var not to be
@@ -201,5 +202,5 @@
 //---- get variables to be eliminated and create string for new ordering ------
    int ii; poly vars=1;
-   for( ii=n; ii<=m; ii++ ) { vars=vars*var(ii); }
+   for( ii=1; ii<=size(va); ii++ ) { vars=vars*var(va[ii]); }
    if(  attrib(basering,"global")) { string ordering = "),dp;"; }
    else { string ordering = "),ls;"; }
@@ -221,7 +222,7 @@
    ring r=0,(x,y,u,v,w),dp;
    ideal i=x-u,y-u2,w-u3,v-x+y3;
-   elim(i,3,4);
+   elim(i,3..4);
    module m=i*gen(1)+i*gen(2);
-   m=elim(m,3,4);show(m);
+   m=elim(m,3..4);show(m);
 }
 ///////////////////////////////////////////////////////////////////////////////
@@ -267,18 +268,32 @@
 ///////////////////////////////////////////////////////////////////////////////
 
-proc nselect (id, int n, list#)
-"USAGE:   nselect(id,n[,m]); id a module or ideal, n, m integers
-RETURN:  generators of id not containing the variable n [up to m]
+proc nselect (id_inp, intvec v)
+"USAGE:   nselect(id,v); id = module or ideal, v = intvec
+RETURN:  generators of id not containing the variables with index an entry of v
 SEE ALSO: select, select1
 EXAMPLE: example nselect; shows examples
-"{
-   int j,k;
-   if( size(#)==0 ) { #[1]=n; }
-   for( k=1; k<=ncols(id); k++ )
-   {  for( j=n; j<=#[1]; j++ )
-      {  if( size(id[k]/var(j))!=0) { id[k]=0; break; }
-      }
-   }
-   return(simplify(id,2));
+"
+{
+  if (typeof(id_inp)!="ideal") { module id=module(id_inp); }
+  else                         { ideal id=id_inp;         }
+  int j,k;
+  int n,m = size(v), ncols(id);
+  //listvar(id);
+  for( k=1; k<=m; k++ )
+  {  
+    for( j=1; j<=n; j++ )
+    {  
+      if( size(id[k]/var(v[j]))!=0 ) 
+      { 
+         id[k]=0; break; 
+      }
+    }
+  }
+  //if(typeof(id)=="ideal") { return(simplify(id,2)); }
+  //return(simplify(module(id),2));
+  id=(simplify(module(id),2));
+  //listvar(id);
+  return(id);
+  //return(simplify(id,2));
 }
 example
@@ -289,5 +304,5 @@
    module m=i*(gen(1)+gen(2));
    show(m);
-   show(nselect(m,3,4));
+   show(nselect(m,3..4));
 }
 ///////////////////////////////////////////////////////////////////////////////
@@ -333,17 +348,22 @@
 ///////////////////////////////////////////////////////////////////////////////
 
-proc select (id, int n, list#)
-"USAGE:   select(id,n[,m]); id ideal/module, n, m integers
-RETURN:  generators of id containing the variable n [all variables up to m]
+proc select (id, intvec v)
+"USAGE:   select(id,n[,m]); id = ideal/module, v= intvec
+RETURN:  generators of id containing all variables with index an entry of v
 NOTE:    use 'select1' for selecting generators containing at least one of the
-         variables between n and m
+         variables with index an entry of v
 SEE ALSO: select1, nselect
 EXAMPLE: example select; shows examples
 "{
-   if( size(#)==0 ) { #[1]=n; }
    int j,k;
-   for( k=1; k<=ncols(id); k++ )
-   {  for( j=n; j<=#[1]; j++ )
-      {   if( size(id[k]/var(j))==0) { id[k]=0; break; }
+   int n,m = size(v), ncols(id);
+   for( k=1; k<=m; k++ )
+   {  
+      for( j=1; j<=n; j++ )
+      {   
+         if( size(id[k]/var(v[j]))==0) 
+         { 
+            id[k]=0; break; 
+         }
       }
    }
@@ -358,25 +378,27 @@
    module m=i*(gen(1)+gen(2));
    m;
-   select(m,1,2);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc select1 (id, int n, list#)
-"USAGE:   select1(id,n[,m]); id ideal/module, n, m integers
-RETURN:  generators of id containing the variable n
-         [at least one of the variables up to m]
+   select(m,1..2);
+}
+///////////////////////////////////////////////////////////////////////////////
+
+proc select1 (id, intvec v)
+"USAGE:   select1(id,v); id = ideal/module, v = intvec
+RETURN:  generators of id containing at least one of the variables with
+         index an entry of v
 NOTE:    use 'select' for selecting generators containing all the
-         variables between n and m
+         variables with index an entry of v
 SEE ALSO: select, nselect
 EXAMPLE: example select1; shows examples
 "{
-   if( size(#)==0 ) { #[1]=n; }
    int j,k;
+   int n,m = size(v), ncols(id);
    execute (typeof(id)+" I;");
-   for( k=1; k<=ncols(id); k++ )
-   {  for( j=n; j<=#[1]; j++ )
-      {
-         if( size(subst(id[k],var(j),0)) != size(id[k]) )
-         { I=I,id[k]; break; }
+   for( k=1; k<=m; k++ )
+   {  for( j=1; j<=n; j++ )
+      {
+         if( size(subst(id[k],var(v[j]),0)) != size(id[k]) )
+         {  
+            I = I,id[k]; break; 
+         }
       }
    }
@@ -391,5 +413,5 @@
    module m=i*(gen(1)+gen(2));
    m;
-   select1(m,1,2);
-}
-///////////////////////////////////////////////////////////////////////////////
+   select1(m,1..2);
+}
+///////////////////////////////////////////////////////////////////////////////
Index: Singular/LIB/equising.lib
===================================================================
--- Singular/LIB/equising.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/equising.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,3 +1,3 @@
-version="$Id: equising.lib,v 1.17 2006-07-18 15:48:12 Singular Exp $";
+version="$Id: equising.lib,v 1.18 2008-10-06 17:04:26 Singular Exp $";
 category="Singularities";
 info="
@@ -854,5 +854,5 @@
   if (typ==1) // isEquising
   {
-    if(ideal(nselect(J,1,no_b))<>0)
+    if(ideal(nselect(J,1..no_b))<>0)
     {
       setring old_ring;
@@ -941,5 +941,5 @@
   if (typ==1) // isEquising
   {
-    if(ideal(nselect(J,1,no_b))<>0)
+    if(ideal(nselect(J,1..no_b))<>0)
     {
       setring old_ring;
@@ -1062,5 +1062,5 @@
         {
           if (defined(artin_bd)) { J=jet(Jnew,artin_bd-1); }
-          if(ideal(nselect(J,1,no_b))<>0)
+          if(ideal(nselect(J,1..no_b))<>0)
           {
             setring old_ring;
@@ -1077,5 +1077,5 @@
       {
         if (defined(artin_bd)) { J=jet(Jnew,artin_bd-1); }
-        if(ideal(nselect(J,1,no_b))<>0)
+        if(ideal(nselect(J,1..no_b))<>0)
         {
           setring old_ring;
@@ -1121,5 +1121,5 @@
   {
     if (defined(artin_bd)) { J=jet(Jnew,artin_bd-1); }
-    if(ideal(nselect(J,1,no_b))<>0)
+    if(ideal(nselect(J,1..no_b))<>0)
     {
       setring old_ring;
@@ -1173,6 +1173,6 @@
   }
 
-  Jtriv = nselect(Jtriv,1,no_b);
-  ideal J_no_b = nselect(J,1,no_b);
+  Jtriv = nselect(Jtriv,1..no_b);
+  ideal J_no_b = nselect(J,1..no_b);
   if (size(J) > size(J_no_b))
   {
@@ -1227,10 +1227,10 @@
       option(redSB);
       J=std(J);
-      J=nselect(J,1,no_b);
+      J=nselect(J,1..no_b);
 
       setring myRing;
       // back to "myRing"
 
-      J=nselect(J,1,no_b);
+      J=nselect(J,1..no_b);
       Jnew=imap(QQ,J);
 
@@ -1242,5 +1242,5 @@
     {
       J=std(J);
-      J=nselect(J,1,no_b);
+      J=nselect(J,1..no_b);
       if (defined(artin_bd)){ J=jet(J,artin_bd-1); }
     }
Index: Singular/LIB/finvar.lib
===================================================================
--- Singular/LIB/finvar.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/finvar.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,4 +1,4 @@
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: finvar.lib,v 1.76 2008-01-22 09:17:19 Singular Exp $"
+version="$Id: finvar.lib,v 1.77 2008-10-06 17:04:27 Singular Exp $"
 category="Invariant theory";
 info="
@@ -7107,5 +7107,5 @@
   }
 
-  M=elim(module(M),1,n);               // eliminating x(1..n), std-calculation
+  M=elim(module(M),1..n);               // eliminating x(1..n), std-calculation
                                          // is done internally -
   M=homog(module(M),h);            // homogenize for 'minbase'
@@ -7631,5 +7631,5 @@
     { I[i]=I[i]-y(i);
     }
-    I=elim(I,1,n);
+    I=elim(I,1..n);
     execute("ring "+newring+"=("+charstr(br)+"),(y(1..m)),dp(m);");
     execute("minpoly=number("+mp+");");
Index: Singular/LIB/freegb.lib
===================================================================
--- Singular/LIB/freegb.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/freegb.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: freegb.lib,v 1.11 2008-10-02 08:14:35 Singular Exp $";
+version="$Id: freegb.lib,v 1.12 2008-10-06 17:04:27 Singular Exp $";
 category="Noncommutative";
 info="
@@ -529,5 +529,5 @@
   dbprint(ppl,J);
   // 4. skip shifted elts
-  ideal K = select1(J,1,s); // s = size(OrigNames)
+  ideal K = select1(J,1..s); // s = size(OrigNames)
   dbprint(ppl,K);
   dbprint(ppl, "done with GB");
@@ -1188,5 +1188,5 @@
   dbprint(ppl,J);
   // 4. skip shifted elts
-  ideal K = select1(J,1,s); // s = size(OrigNames)
+  ideal K = select1(J,1..s); // s = size(OrigNames)
   dbprint(ppl,K);
   dbprint(ppl, "done with GB");
Index: Singular/LIB/mregular.lib
===================================================================
--- Singular/LIB/mregular.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/mregular.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,5 +1,5 @@
 // IB/PG/GMG, last modified:  15.10.2004
 //////////////////////////////////////////////////////////////////////////////
-version = "$Id: mregular.lib,v 1.8 2005-05-06 14:38:47 hannes Exp $";
+version = "$Id: mregular.lib,v 1.9 2008-10-06 17:04:27 Singular Exp $";
 category="Commutative Algebra";
 info="
@@ -91,33 +91,33 @@
 //----- If the ideal i is not proper:
    if ( d == -1 )
-     {
-       dbprint(printlevel-voice+2,
-               "// The ideal i is (1)!
+   {
+     dbprint(printlevel-voice+2,
+             "// The ideal i is (1)!
 // Its Castelnuovo-Mumford regularity is:");
-       return (0);
-     }
+     return (0);
+   }
 //----- If the ideal i is 0:
    if ( size(I) == 0 )
-     {
-       dbprint(printlevel-voice+2,
-               "// The ideal i is (0)!
+   {
+     dbprint(printlevel-voice+2,
+             "// The ideal i is (0)!
 // Its Castelnuovo-Mumford regularity is:");
-       return (0);
-     }
+     return (0);
+   }
 //----- When the ideal i is 0-dimensional:
    if ( d == 0 )
-     {
-       H=maxdeg1(minbase(quotient(I,maxideal(1))))+1;
-       time=rtimer-time;
-       // Additional information:
-       dbprint(printlevel-voice+2,
-               "// Dimension of S/i : 0");
-       dbprint(printlevel-voice+2,
-               "// Time for computing regularity: " + string(time) + " sec.");
-       dbprint(printlevel-voice+2,
+   {
+     H=maxdeg1(minbase(quotient(I,maxideal(1))))+1;
+     time=rtimer-time;
+     // Additional information:
+     dbprint(printlevel-voice+2,
+             "// Dimension of S/i : 0");
+     dbprint(printlevel-voice+2,
+             "// Time for computing regularity: " + string(time) + " sec.");
+     dbprint(printlevel-voice+2,
 "// The Castelnuovo-Mumford regularity of i coincides with its satiety, and
  // with the regularity of the Hilbert function of S/i. Its value is:");
-       return (H);
-     }
+     return (H);
+   }
 //----- Determine the situation: NT, or NP, or nothing.
 //----- Choose the method depending on the situation, on the
@@ -125,111 +125,109 @@
 //----- in order to get the mon. ideal of nested type associated to i
    if ( e == 1 )
-     {
-       ch=0;
-     }
+   { ch=0; }
    NPtest=is_NP(I);
    if ( NPtest == 1 )
-     {
-       nesttest=is_nested(I);
-     }
+   {
+     nesttest=is_nested(I);
+   }
    if ( ch != 0 )
-     {
+   {
+     if ( NPtest == 0 )
+     {
+       N=d*n-d*(d-1)/2;
+       s = "ring rtr = (ch,t(1..N)),x(0..n),dp;";
+       execute(s);
+       ideal chcoord,m,i,I;
+       poly P;
+       map phi;
+       i=imap(r1,i);
+       chcoord=select1(maxideal(1),1..(n-d+1));
+       acc=0;
+       for ( ii = 1; ii<=d; ii++ )
+       {
+         matrix trex[1][n-d+ii+1]=t((1+acc)..(n-d+ii+acc)),1;
+         m=select1(maxideal(1),1..(n-d+1+ii));
+         for ( jj = 1; jj<=n-d+ii+1; jj++ )
+         {
+           P=P+trex[1,jj]*m[jj];
+         }
+         chcoord[n-d+1+ii]=P;
+         P=0;
+         acc=acc+n-d+ii;
+         kill trex;
+       }
+       phi=rtr,chcoord;
+       I=simplify(lead(std(phi(i))),1);
+       setring r1;
+       I=imap(rtr,I);
+       attrib(I,"isSB",1);
+     }
+     else
+     {
+       if ( nesttest == 0 )
+       {
+         N=d*(d-1)/2;
+         s = "ring rtr = (ch,t(1..N)),x(0..n),dp;";
+         execute(s);
+         ideal chcoord,m,i,I;
+         poly P;
+         map phi;
+         i=imap(r1,i);
+         chcoord=select1(maxideal(1),1..(n-d+2));
+         acc=0;
+         for ( ii = 1; ii<=d-1; ii++ )
+         {
+           matrix trex[1][ii+1]=t((1+acc)..(ii+acc)),1;
+           m=select1(maxideal(1),(n-d+2)..(n-d+2+ii));
+           for ( jj = 1; jj<=ii+1; jj++ )
+           {
+             P=P+trex[1,jj]*m[jj];
+           }
+           chcoord[n-d+2+ii]=P;
+           P=0;
+           acc=acc+ii;
+           kill trex;
+         }
+         phi=rtr,chcoord;
+         I=simplify(lead(std(phi(i))),1);
+         setring r1;
+         I=imap(rtr,I);
+         attrib(I,"isSB",1);
+       }
+     }
+   }
+   else
+   {
+     if ( NPtest == 0 )
+     {
+       while ( nl < 30 )
+       {
+         chcoord=select1(maxideal(1),1..(n-d+1));
+         nl=nl+1;
+         for ( ii = 1; ii<=d; ii++ )
+         {
+           ran=random(100,1,n-d+ii);
+           ran=intmat(ran,1,n-d+ii+1);
+           ran[1,n-d+ii+1]=1;
+           m=select1(maxideal(1),1..(n-d+1+ii));
+           for ( jj = 1; jj<=n-d+ii+1; jj++ )
+           {
+             P=P+ran[1,jj]*m[jj];
+           }
+           chcoord[n-d+1+ii]=P;
+           P=0;
+         }
+         phi=r1,chcoord;
+         dbprint(printlevel-voice+2,"// (1 random change of coord.)");
+         I=simplify(lead(std(phi(i))),1);
+         attrib(I,"isSB",1);
+         NPtest=is_NP(I);
+         if ( NPtest == 1 )
+         {
+           break;
+         }
+       }
        if ( NPtest == 0 )
-         {
-           N=d*n-d*(d-1)/2;
-           s = "ring rtr = (ch,t(1..N)),x(0..n),dp;";
-           execute(s);
-           ideal chcoord,m,i,I;
-           poly P;
-           map phi;
-           i=imap(r1,i);
-           chcoord=select1(maxideal(1),1,(n-d+1));
-           acc=0;
-           for ( ii = 1; ii<=d; ii++ )
-             {
-               matrix trex[1][n-d+ii+1]=t((1+acc)..(n-d+ii+acc)),1;
-               m=select1(maxideal(1),1,(n-d+1+ii));
-               for ( jj = 1; jj<=n-d+ii+1; jj++ )
-                 {
-                   P=P+trex[1,jj]*m[jj];
-                 }
-               chcoord[n-d+1+ii]=P;
-               P=0;
-               acc=acc+n-d+ii;
-               kill trex;
-             }
-               phi=rtr,chcoord;
-               I=simplify(lead(std(phi(i))),1);
-               setring r1;
-               I=imap(rtr,I);
-               attrib(I,"isSB",1);
-         }
-       else
-         {
-           if ( nesttest == 0 )
-             {
-               N=d*(d-1)/2;
-               s = "ring rtr = (ch,t(1..N)),x(0..n),dp;";
-               execute(s);
-               ideal chcoord,m,i,I;
-               poly P;
-               map phi;
-               i=imap(r1,i);
-               chcoord=select1(maxideal(1),1,(n-d+2));
-               acc=0;
-               for ( ii = 1; ii<=d-1; ii++ )
-                 {
-                   matrix trex[1][ii+1]=t((1+acc)..(ii+acc)),1;
-                    m=select1(maxideal(1),(n-d+2),(n-d+2+ii));
-                   for ( jj = 1; jj<=ii+1; jj++ )
-                     {
-                       P=P+trex[1,jj]*m[jj];
-                     }
-                   chcoord[n-d+2+ii]=P;
-                   P=0;
-                   acc=acc+ii;
-                   kill trex;
-                 }
-               phi=rtr,chcoord;
-               I=simplify(lead(std(phi(i))),1);
-               setring r1;
-               I=imap(rtr,I);
-               attrib(I,"isSB",1);
-             }
-         }
-     }
-   else
-     {
-       if ( NPtest == 0 )
-         {
-           while ( nl < 30 )
-             {
-               chcoord=select1(maxideal(1),1,(n-d+1));
-               nl=nl+1;
-               for ( ii = 1; ii<=d; ii++ )
-                 {
-                   ran=random(100,1,n-d+ii);
-                   ran=intmat(ran,1,n-d+ii+1);
-                   ran[1,n-d+ii+1]=1;
-                   m=select1(maxideal(1),1,(n-d+1+ii));
-                   for ( jj = 1; jj<=n-d+ii+1; jj++ )
-                     {
-                       P=P+ran[1,jj]*m[jj];
-                     }
-                   chcoord[n-d+1+ii]=P;
-                   P=0;
-                 }
-               phi=r1,chcoord;
-               dbprint(printlevel-voice+2,"// (1 random change of coord.)");
-               I=simplify(lead(std(phi(i))),1);
-               attrib(I,"isSB",1);
-               NPtest=is_NP(I);
-               if ( NPtest == 1 )
-                 {
-                   break;
-                 }
-             }
-           if ( NPtest == 0 )
-             {
+       {
        "// WARNING from proc regIdeal from lib mregular.lib:
 // The procedure has entered in 30 loops and could not put the variables
@@ -237,40 +235,40 @@
 // of coordinates may enter an infinite loop when the field is finite.
 // Try removing this optional argument.";
-       return (-1);
-             }
-           i=phi(i);
-           nesttest=is_nested(I);
-         }
+         return (-1);
+       }
+       i=phi(i);
+       nesttest=is_nested(I);
+     }
+     if ( nesttest == 0 )
+     {
+       while ( nl < 30 )
+       {
+         chcoord=select1(maxideal(1),1..(n-d+2));
+         nl=nl+1;
+         for ( ii = 1; ii<=d-1; ii++ )
+         {
+           ran=random(100,1,ii);
+           ran=intmat(ran,1,ii+1);
+           ran[1,ii+1]=1;
+           m=select1(maxideal(1),(n-d+2)..(n-d+2+ii));
+           for ( jj = 1; jj<=ii+1; jj++ )
+           {
+             P=P+ran[1,jj]*m[jj];
+           }
+           chcoord[n-d+2+ii]=P;
+           P=0;
+         }
+         phi=r1,chcoord;
+         dbprint(printlevel-voice+2,"// (1 random change of coord.)");
+         I=simplify(lead(std(phi(i))),1);
+         attrib(I,"isSB",1);
+         nesttest=is_nested(I);
+         if ( nesttest == 1 )
+         {
+           break;
+         }
+       }
        if ( nesttest == 0 )
-         {
-           while ( nl < 30 )
-             {
-               chcoord=select1(maxideal(1),1,(n-d+2));
-               nl=nl+1;
-               for ( ii = 1; ii<=d-1; ii++ )
-                 {
-                   ran=random(100,1,ii);
-                   ran=intmat(ran,1,ii+1);
-                   ran[1,ii+1]=1;
-                   m=select1(maxideal(1),(n-d+2),(n-d+2+ii));
-                   for ( jj = 1; jj<=ii+1; jj++ )
-                     {
-                       P=P+ran[1,jj]*m[jj];
-                     }
-                   chcoord[n-d+2+ii]=P;
-                   P=0;
-                 }
-               phi=r1,chcoord;
-               dbprint(printlevel-voice+2,"// (1 random change of coord.)");
-               I=simplify(lead(std(phi(i))),1);
-               attrib(I,"isSB",1);
-               nesttest=is_nested(I);
-               if ( nesttest == 1 )
-                 {
-                   break;
-                 }
-             }
-           if ( nesttest == 0 )
-             {
+       {
        "// WARNING from proc regIdeal from lib mregular.lib:
 // The procedure has entered in 30 loops and could not find a monomial
@@ -279,8 +277,8 @@
 // infinite loop when the field is finite.
 // Try removing this optional argument.";
-       return (-1);
-             }
-         }
-     }
+         return (-1);
+       }
+     }
+   }
 //
 // At this stage, we have obtained a monomial ideal I of nested type
@@ -289,165 +287,165 @@
 //----- When S/i is Cohen-Macaulay:
    for ( ii = n-d+2; ii <= n+1; ii++ )
-     {
-       K=K+select(I,ii);
-     }
+   {
+     K=K+select(I,ii);
+   }
    if ( size(K) == 0 )
-     {
-       s="ring nr = ",charstr(r0),",x(0..n-d),dp;";
-       execute(s);
-       ideal I;
-       I = imap(r1,I);
-       H=maxdeg1(minbase(quotient(I,maxideal(1))))+1;
-       time=rtimer-time;
-       // Additional information:
-       dbprint(printlevel-voice+2,
+   {
+     s="ring nr = ",charstr(r0),",x(0..n-d),dp;";
+     execute(s);
+     ideal I;
+     I = imap(r1,I);
+     H=maxdeg1(minbase(quotient(I,maxideal(1))))+1;
+     time=rtimer-time;
+     // Additional information:
+     dbprint(printlevel-voice+2,
                "// S/i is Cohen-Macaulay");
-       dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                "// Dimension of S/i ( = depth(S/i) ): "+string(d));
-       dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                "// Regularity attained at the last step of m.g.f.r. of i: YES");
-       dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                "// Regularity of the Hilbert function of S/i: " + string(H-d));
-       dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                "// Time for computing regularity: " + string(time) + " sec.");
-       dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                "// The Castelnuovo-Mumford regularity of i is:");
-       return(H);
-     }
+     return(H);
+   }
 //----- When d=1:
    if ( d == 1 )
-     {
-       H=maxdeg1(simplify(reduce(quotient(I,maxideal(1)),I),2))+1;
-       sat=H;
-       J=subst(I,x(n),1);
-       s = "ring nr = ",charstr(r0),",x(0..n-1),dp;";
-       execute(s);
-       ideal J=imap(r1,J);
-       attrib(J,"isSB",1);
-       h=maxdeg1(minbase(quotient(J,maxideal(1))))+1;
-       time=rtimer-time;
-       if ( h > H )
-         {
-           H=h;
-         }
-       // Additional information:
-       dbprint(printlevel-voice+2,
+   {
+     H=maxdeg1(simplify(reduce(quotient(I,maxideal(1)),I),2))+1;
+     sat=H;
+     J=subst(I,x(n),1);
+     s = "ring nr = ",charstr(r0),",x(0..n-1),dp;";
+     execute(s);
+     ideal J=imap(r1,J);
+     attrib(J,"isSB",1);
+     h=maxdeg1(minbase(quotient(J,maxideal(1))))+1;
+     time=rtimer-time;
+     if ( h > H )
+     {
+       H=h;
+     }
+     // Additional information:
+     dbprint(printlevel-voice+2,
                "// Dimension of S/i: 1");
-       dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                "// Depth of S/i: 0");
-       dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                "// Satiety of i: "+string(sat));
-       dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                "// Upper bound for the a-invariant of S/i: end(H^1(S/i)) <= "+
                string(h-2));
-       if ( H == sat )
-         {
-           dbprint(printlevel-voice+2,
+     if ( H == sat )
+     {
+       dbprint(printlevel-voice+2,
                    "// Regularity attained at the last step of m.g.f.r. of i: YES");
-           dbprint(printlevel-voice+2,
+       dbprint(printlevel-voice+2,
                    "// Regularity of the Hilbert function of S/i: "+string(H));
-         }
-       else
-         {
-           dbprint(printlevel-voice+2,
+     }
+     else
+     {
+       dbprint(printlevel-voice+2,
                    "// Regularity attained at the last step of m.g.f.r. of i: NO");
-         }
-           dbprint(printlevel-voice+2,
+     }
+     dbprint(printlevel-voice+2,
                    "// Time for computing regularity: "+ string(time) + " sec.");
-           dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                    "// The Castelnuovo-Mumford regularity of i is:");
-           return(H);
-     }
+     return(H);
+   }
 //----- Now d>1 and S/i is not Cohen-Macaulay:
 //
 //----- First, determine the last variable really occuring
-       lastv=n-d;
-       h=n;
-       while ( lastv == n-d and h > n-d )
-         {
-           K=select(I,h+1);
-           if ( size(K) == 0 )
-             {
-               h=h-1;
-             }
-           else
-             {
-               lastv=h;
-             }
-         }
+   lastv=n-d;
+   h=n;
+   while ( lastv == n-d and h > n-d )
+   {
+     K=select(I,h+1);
+     if ( size(K) == 0 )
+     {
+       h=h-1;
+     }
+     else
+     {
+       lastv=h;
+     }
+   }
 //----- and compute Castelnuovo-Mumford regularity:
-       s = "ring nr = ",charstr(r0),",x(0..lastv),dp;";
-       execute(s);
-       ideal I,K,KK,LL;
-       I=imap(r1,I);
-       attrib(I,"isSB",1);
-       K=simplify(reduce(quotient(I,maxideal(1)),I),2);
-       H=maxdeg1(K)+1;
-       firstind=H;
-       KK=minbase(subst(I,x(lastv),1));
-       for ( ii = n-lastv; ii<=d-2; ii++ )
-         {
-           LL=minbase(subst(I,x(n-ii-1),1));
-           attrib(LL,"isSB",1);
-           s = "ring mr = ",charstr(r0),",x(0..n-ii-1),dp;";
-           execute(s);
-           ideal K,KK;
-           KK=imap(nr,KK);
-           attrib(KK,"isSB",1);
-           K=simplify(reduce(quotient(KK,maxideal(1)),KK),2);
-           h=maxdeg1(K)+1;
-           if ( h > H )
-             {
-               H=h;
-             }
-           setring nr;
-           kill mr;
-           KK=LL;
-         }
-       // We must determine one more sat. index:
-       s = "ring mr = ",charstr(r0),",x(0..n-d),dp;";
-       execute(s);
-       ideal KK,K;
-       KK=imap(nr,KK);
-       attrib(KK,"isSB",1);
-       K=simplify(reduce(quotient(KK,maxideal(1)),KK),2);
-       h=maxdeg1(K)+1;
-       lastind=h;
-       if ( h > H )
-         {
-           H=h;
-         }
-       setring nr;
-       kill mr;
-       time=rtimer-time;
-       // Additional information:
-       dbprint(printlevel-voice+2,
+   s = "ring nr = ",charstr(r0),",x(0..lastv),dp;";
+   execute(s);
+   ideal I,K,KK,LL;
+   I=imap(r1,I);
+   attrib(I,"isSB",1);
+   K=simplify(reduce(quotient(I,maxideal(1)),I),2);
+   H=maxdeg1(K)+1;
+   firstind=H;
+   KK=minbase(subst(I,x(lastv),1));
+   for ( ii = n-lastv; ii<=d-2; ii++ )
+   {
+     LL=minbase(subst(I,x(n-ii-1),1));
+     attrib(LL,"isSB",1);
+     s = "ring mr = ",charstr(r0),",x(0..n-ii-1),dp;";
+     execute(s);
+     ideal K,KK;
+     KK=imap(nr,KK);
+     attrib(KK,"isSB",1);
+     K=simplify(reduce(quotient(KK,maxideal(1)),KK),2);
+     h=maxdeg1(K)+1;
+     if ( h > H )
+     {
+       H=h;
+     }
+     setring nr;
+     kill mr;
+     KK=LL;
+   }
+   // We must determine one more sat. index:
+   s = "ring mr = ",charstr(r0),",x(0..n-d),dp;";
+   execute(s);
+   ideal KK,K;
+   KK=imap(nr,KK);
+   attrib(KK,"isSB",1);
+   K=simplify(reduce(quotient(KK,maxideal(1)),KK),2);
+   h=maxdeg1(K)+1;
+   lastind=h;
+   if ( h > H )
+   {
+     H=h;
+   }
+   setring nr;
+   kill mr;
+   time=rtimer-time;
+   // Additional information:
+   dbprint(printlevel-voice+2,
                "// Dimension of S/i: "+string(d));
-       dbprint(printlevel-voice+2,
+   dbprint(printlevel-voice+2,
                "// Depth of S/i: "+string(n-lastv));
-       dbprint(printlevel-voice+2,
+   dbprint(printlevel-voice+2,
                "// end(H^"+string(n-lastv)+"(S/i)) = "
                +string(firstind-n+lastv-1));
-       dbprint(printlevel-voice+2,
+   dbprint(printlevel-voice+2,
                "// Upper bound for the a-invariant of S/i: end(H^"
                +string(d)+"(S/i)) <= "+string(lastind-d-1));
-       if ( H == firstind )
-         {
-           dbprint(printlevel-voice+2,
+   if ( H == firstind )
+   {
+     dbprint(printlevel-voice+2,
                    "// Regularity attained at the last step of m.g.f.r. of i: YES");
-           dbprint(printlevel-voice+2,
+     dbprint(printlevel-voice+2,
                    "// Regularity of the Hilbert function of S/i: "
                    +string(H-n+lastv));
-         }
-       else
-         {
-           dbprint(printlevel-voice+2,
+   }
+   else
+   {
+     dbprint(printlevel-voice+2,
                    "// Regularity attained at the last step of m.g.f.r. of i: NO");
-         }
-       dbprint(printlevel-voice+2,
+   }
+   dbprint(printlevel-voice+2,
                "// Time for computing regularity: "+ string(time) + " sec.");
-       dbprint(printlevel-voice+2,
+   dbprint(printlevel-voice+2,
                "// The Castelnuovo-Mumford regularity of i is:");
-       return(H);
+   return(H);
 }
 example
@@ -648,10 +646,10 @@
            map phi;
            i=imap(r1,i);
-           chcoord=select1(maxideal(1),1,(n-d+1));
+           chcoord=select1(maxideal(1),1..(n-d+1));
            acc=0;
            for ( ii = 1; ii<=d; ii++ )
              {
                matrix trex[1][n-d+ii+1]=t((1+acc)..(n-d+ii+acc)),1;
-               m=select1(maxideal(1),1,(n-d+1+ii));
+               m=select1(maxideal(1),1..(n-d+1+ii));
                for ( jj = 1; jj<=n-d+ii+1; jj++ )
                  {
@@ -680,10 +678,10 @@
                map phi;
                i=imap(r1,i);
-               chcoord=select1(maxideal(1),1,(n-d+2));
+               chcoord=select1(maxideal(1),1..(n-d+2));
                acc=0;
                for ( ii = 1; ii<=d-1; ii++ )
                  {
                    matrix trex[1][ii+1]=t((1+acc)..(ii+acc)),1;
-                    m=select1(maxideal(1),(n-d+2),(n-d+2+ii));
+                    m=select1(maxideal(1),(n-d+2)..(n-d+2+ii));
                    for ( jj = 1; jj<=ii+1; jj++ )
                      {
@@ -709,5 +707,5 @@
            while ( nl < 30 )
              {
-               chcoord=select1(maxideal(1),1,(n-d+1));
+               chcoord=select1(maxideal(1),1..(n-d+1));
                nl=nl+1;
                for ( ii = 1; ii<=d; ii++ )
@@ -716,5 +714,5 @@
                    ran=intmat(ran,1,n-d+ii+1);
                    ran[1,n-d+ii+1]=1;
-                   m=select1(maxideal(1),1,(n-d+1+ii));
+                   m=select1(maxideal(1),1..(n-d+1+ii));
                    for ( jj = 1; jj<=n-d+ii+1; jj++ )
                      {
@@ -750,5 +748,5 @@
            while ( nl < 30 )
              {
-               chcoord=select1(maxideal(1),1,(n-d+2));
+               chcoord=select1(maxideal(1),1..(n-d+2));
                nl=nl+1;
                for ( ii = 1; ii<=d-1; ii++ )
@@ -757,5 +755,5 @@
                    ran=intmat(ran,1,ii+1);
                    ran[1,ii+1]=1;
-                   m=select1(maxideal(1),(n-d+2),(n-d+2+ii));
+                   m=select1(maxideal(1),(n-d+2)..(n-d+2+ii));
                    for ( jj = 1; jj<=ii+1; jj++ )
                      {
@@ -1030,5 +1028,5 @@
            while ( nl < 30 )
              {
-               chcoord=select1(maxideal(1),1,(n-d+1));
+               chcoord=select1(maxideal(1),1..(n-d+1));
                nl=nl+1;
                for ( ii = 1; ii<=d; ii++ )
@@ -1037,5 +1035,5 @@
                    ran=intmat(ran,1,n-d+ii+1);
                    ran[1,n-d+ii+1]=1;
-                   m=select1(maxideal(1),1,(n-d+1+ii));
+                   m=select1(maxideal(1),1..(n-d+1+ii));
                    for ( jj = 1; jj<=n-d+ii+1; jj++ )
                      {
@@ -1071,5 +1069,5 @@
            while ( nl < 30 )
              {
-               chcoord=select1(maxideal(1),1,(n-d+2));
+               chcoord=select1(maxideal(1),1..(n-d+2));
                nl=nl+1;
                for ( ii = 1; ii<=d-1; ii++ )
@@ -1078,5 +1076,5 @@
                    ran=intmat(ran,1,ii+1);
                    ran[1,ii+1]=1;
-                   m=select1(maxideal(1),(n-d+2),(n-d+2+ii));
+                   m=select1(maxideal(1),(n-d+2)..(n-d+2+ii));
                    for ( jj = 1; jj<=ii+1; jj++ )
                      {
@@ -1536,5 +1534,5 @@
    while ( nl < 30 )
    {
-     chcoord=select1(maxideal(1),1,(n-d+1));
+     chcoord=select1(maxideal(1),1..(n-d+1));
      nl=nl+1;
      for ( ii = 1; ii<=d; ii++ )
@@ -1543,5 +1541,5 @@
        ran=intmat(ran,1,n-d+ii+1);
        ran[1,n-d+ii+1]=1;
-       m=select1(maxideal(1),1,(n-d+1+ii));
+       m=select1(maxideal(1),1..(n-d+1+ii));
        for ( jj = 1; jj<=n-d+ii+1; jj++ )
        {
Index: Singular/LIB/noether.lib
===================================================================
--- Singular/LIB/noether.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/noether.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,5 +1,5 @@
 // AH last modified:  01.07.2007
 //////////////////////////////////////////////////////////////////////////////
-version = "$Id: noether.lib,v 1.10 2008-04-11 14:04:40 Singular Exp $";
+version = "$Id: noether.lib,v 1.11 2008-10-06 17:04:28 Singular Exp $";
 category="Commutative Algebra";
 info="
@@ -199,9 +199,9 @@
     for ( ii = n; ii>=0; ii-- )
     {
-      chcoord=select1(maxideal(1),1,(ii));
+      chcoord=select1(maxideal(1),1..ii);
       ran=random(100,1,ii);
       ran=intmat(ran,1,ii+1);
       ran[1,ii+1]=1;
-      m=select1(maxideal(1),1,(ii+1));
+      m=select1(maxideal(1),1..(ii+1));
       for ( jj = 1; jj<=ii+1; jj++ )
       {
@@ -279,9 +279,9 @@
      for ( ii = n; ii>=0; ii-- )
      {
-       chcoord=select1(maxideal(1),1,(ii));
+       chcoord=select1(maxideal(1),1..ii);
        ran=random(100,1,ii);
        ran=intmat(ran,1,ii+1);
        ran[1,ii+1]=1;
-       m=select1(maxideal(1),1,(ii+1));
+       m=select1(maxideal(1),1..(ii+1));
        for ( jj = 1; jj<=ii+1; jj++ )
        {
@@ -384,9 +384,9 @@
   {
     nl=nl+1;
-    chcoord=select1(maxideal(1),1,(n));
+    chcoord=select1(maxideal(1),1..n);
     ran=random(100,1,n);
     ran=intmat(ran,1,n+1);
     ran[1,n+1]=1;
-    m=select1(maxideal(1),1,(n+1));
+    m=select1(maxideal(1),1..(n+1));
     for ( jj = 1; jj<=n+1; jj++ )
     {
@@ -479,9 +479,9 @@
   {
     nl=nl+1;
-    chcoord=select1(maxideal(1),1,(n));
+    chcoord=select1(maxideal(1),1..n);
     ran=random(100,1,n);
     ran=intmat(ran,1,n+1);
     ran[1,n+1]=1;
-    m=select1(maxideal(1),1,(n+1));
+    m=select1(maxideal(1),1..(n+1));
     for ( jj = 1; jj<=n+1; jj++ )
     {
Index: Singular/LIB/reszeta.lib
===================================================================
--- Singular/LIB/reszeta.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/reszeta.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: reszeta.lib,v 1.11 2007-02-24 15:15:26 Singular Exp $";
+version="$Id: reszeta.lib,v 1.12 2008-10-06 17:04:28 Singular Exp $";
 category="Commutative Algebra";
 info="
@@ -3542,5 +3542,5 @@
 //--- refine the comparison by passing to each of the numerical zeros
 //--- of the two minpolys
-  ideal stid=nselect(interId,1,nvars(R));
+  ideal stid=nselect(interId,1..nvars(R));
   ring compl_st=complex,(s,t),dp;
   def stid=imap(S,stid);
Index: Singular/LIB/rinvar.lib
===================================================================
--- Singular/LIB/rinvar.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/rinvar.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,5 +1,5 @@
 // Last change 10.12.2000 (TB)
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: rinvar.lib,v 1.16 2006-07-18 15:22:15 Singular Exp $";
+version="$Id: rinvar.lib,v 1.17 2008-10-06 17:04:28 Singular Exp $";
 category="Invariant theory";
 info="
@@ -146,5 +146,5 @@
   I2 = G, I1;
   I2 = std(I2);
-  Gn = nselect(I2, 1, nvars(RIGB));
+  Gn = nselect(I2, 1.. nvars(RIGB));
   imageSize = ncols(Gn);
 
@@ -329,5 +329,5 @@
   // forget all elements which contain other than the slack variables
 
-  J2 = nselect(J1, 1, nvars(RARB));
+  J2 = nselect(J1, 1.. nvars(RARB));
 
   execute(ringSTR2);
@@ -904,5 +904,5 @@
   // eliminate
 
-  N = nselect(J, 1, groupVars);
+  N = nselect(J, 1.. groupVars);
 
   // substitute
Index: Singular/LIB/sagbi.lib
===================================================================
--- Singular/LIB/sagbi.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/sagbi.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -1,4 +1,4 @@
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: sagbi.lib,v 1.11 2007-07-13 12:31:06 Singular Exp $";
+version="$Id: sagbi.lib,v 1.12 2008-10-06 17:04:28 Singular Exp $";
 category="Commutative Algebra";
 info="
@@ -83,5 +83,5 @@
 
     A=groebner(A);
-    ideal kern=nselect(A,1,n);// "kern" is the kernel of the ring map:
+    ideal kern=nselect(A,1..n);// "kern" is the kernel of the ring map:
                         // R1----->bsr ;y(z)----> lead(id[z]).
                         //"kern" is the ideal of algebraic relations between
@@ -216,5 +216,5 @@
                             // to A to get std(A1).
     A=A+@Res;
-    kern1=nselect(@Res,1,n);
+    kern1=nselect(@Res,1..n);
     kern=kern+kern1;
     export kern,kern1,A;
@@ -342,5 +342,5 @@
     if(choose==2)
     {
-      ideal kern= nselect(groebner(dom),1,n);//"nselect" is combinatorial command
+      ideal kern= nselect(groebner(dom),1..n);//"nselect" is combinatorial command
                                          //which uses the internal command
                                          // "simplify"
Index: Singular/LIB/standard.lib
===================================================================
--- Singular/LIB/standard.lib	(revision 100025a806c37776e35dd4b839e192304f203af8)
+++ Singular/LIB/standard.lib	(revision c99fd40e0f697a84f33e83be6c9da0914e44f6ee)
@@ -3,5 +3,5 @@
 //groebner mit Optionen versehen
 //////////////////////////////////////////////////////////////////////////////
-version="$Id: standard.lib,v 1.101 2008-01-28 11:42:30 Singular Exp $";
+version="$Id: standard.lib,v 1.102 2008-10-06 17:04:28 Singular Exp $";
 category="Miscellaneous";
 info="
@@ -824,6 +824,6 @@
 
   def P=basering;
-  if ((typeof(i_par)=="vector")||(typeof(i_par)=="module")) {module i=i_par;}
-  else {ideal i=i_par; }
+  if ((typeof(i_par)=="vector")||(typeof(i_par)=="module")||(typeof(i_par)=="matrix")) {module i=i_par;}
+  else {ideal i=i_par; } // int, poly, number, ideal
   kill i_par;
 
@@ -1346,4 +1346,5 @@
       string ri= "ring Phelp ="
                   +string(char(P))+",("+varstr_P+"),(dp,C);";
+      ri = ri + "minpoly = "+string(minpoly) + ";";
       execute(ri);
       def m=imap(P,m);
@@ -1361,4 +1362,5 @@
       string ri= "ring Phelp ="
                   +string(char(P))+",("+varstr_P+"),(ls,c);";
+      ri = ri + "minpoly = "+string(minpoly) + ";";
       execute(ri);
       def m=imap(P,m);
@@ -1374,4 +1376,5 @@
    string ri= "ring Phelp ="
                   +string(char(P))+",("+varstr_P+"),(ls,C);";
+   ri = ri + "minpoly = "+string(minpoly) + ";";
    execute(ri);
    def m=imap(P,m);
