Index: /branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/create.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/create.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/create.c	(revision 20856)
@@ -3,8 +3,14 @@
 int create (int argc, char **argv) {
   
-  int i;
+  int i, N, INT;
   float start, end, delta;
   Vector *vec;
   
+  INT = FALSE;
+  if ((N = get_argument (argc, argv, "-int"))) {
+    INT = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
   if ((argc != 5) && (argc != 4)) {
     gprint (GP_ERR, "USAGE: create vector start end [delta]\n");
@@ -27,9 +33,23 @@
   }
 
+  if (INT && (delta != (int)delta)) {
+    gprint (GP_ERR, "integer vector requested but fractional step-size specified\n");
+    return (FALSE);
+  }
+
   vec[0].Nelements = (end - start) / delta;
-  REALLOCATE (vec[0].elements.Flt, opihi_flt, vec[0].Nelements);
 
-  for (i = 0; i < vec[0].Nelements; i++) {
-    vec[0].elements.Flt[i] = start + i*delta;
+  if (INT) {
+    vec[0].type = OPIHI_INT;
+    REALLOCATE (vec[0].elements.Int, opihi_int, vec[0].Nelements);
+    for (i = 0; i < vec[0].Nelements; i++) {
+      vec[0].elements.Int[i] = start + i*delta;
+    }
+  } else {
+    vec[0].type = OPIHI_FLT;
+    REALLOCATE (vec[0].elements.Flt, opihi_flt, vec[0].Nelements);
+    for (i = 0; i < vec[0].Nelements; i++) {
+      vec[0].elements.Flt[i] = start + i*delta;
+    }
   }
 
Index: /branches/eam_branch_20081124/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/dvo/mextract.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/dvo/mextract.c	(revision 20856)
@@ -97,4 +97,5 @@
     }
     if ((vec[i] = SelectVector (name, ANYVECTOR, TRUE)) == NULL) goto escape;
+    ResetVector (vec[i], fields[i].type, NNN);
   }
 
Index: /branches/eam_branch_20081124/Ohana/src/opihi/dvo/mmextract.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/dvo/mmextract.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/dvo/mmextract.c	(revision 20856)
@@ -152,4 +152,6 @@
     if ((vec[2*i+0] = SelectVector (name1, ANYVECTOR, TRUE)) == NULL) goto escape;
     if ((vec[2*i+1] = SelectVector (name2, ANYVECTOR, TRUE)) == NULL) goto escape;
+    ResetVector (vec[2*i+0], fields[i].type, NNN);
+    ResetVector (vec[2*i+1], fields[i].type, NNN);
   }
 
Index: /branches/eam_branch_20081124/Ohana/src/opihi/include/dvomath.h
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/include/dvomath.h	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/include/dvomath.h	(revision 20856)
@@ -97,4 +97,5 @@
 void          InitVectors           PROTO((void));
 int           CopyVector            PROTO((Vector *out, Vector *in));
+int           MatchVector           PROTO((Vector *out, Vector *in, char type));
 int           MoveVector            PROTO((Vector *out, Vector *in));
 int           DeleteVector          PROTO((Vector *vec));
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.data/graphtools.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.data/graphtools.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.data/graphtools.c	(revision 20856)
@@ -8,9 +8,18 @@
 
   if (xvec != NULL) {
-    maxX = minX = xvec[0].elements.Flt[0];
-    for (i = 1; i < xvec[0].Nelements; i++) {
-      if (!finite(xvec[0].elements.Flt[i])) continue;
-      maxX = MAX (maxX, xvec[0].elements.Flt[i]);
-      minX = MIN (minX, xvec[0].elements.Flt[i]);
+    if (xvec->type == OPIHI_FLT) {
+      maxX = minX = xvec[0].elements.Flt[0];
+      for (i = 1; i < xvec[0].Nelements; i++) {
+	if (!finite(xvec[0].elements.Flt[i])) continue;
+	maxX = MAX (maxX, xvec[0].elements.Flt[i]);
+	minX = MIN (minX, xvec[0].elements.Flt[i]);
+      }
+    } else {
+      maxX = minX = xvec[0].elements.Int[0];
+      for (i = 1; i < xvec[0].Nelements; i++) {
+	if (!finite(xvec[0].elements.Int[i])) continue;
+	maxX = MAX (maxX, xvec[0].elements.Int[i]);
+	minX = MIN (minX, xvec[0].elements.Int[i]);
+      }
     }
     range = maxX - minX;
@@ -22,9 +31,18 @@
 
   if (yvec != NULL) {
-    maxY = minY = yvec[0].elements.Flt[0];
-    for (i = 1; i < yvec[0].Nelements; i++) {
-      if (!finite(yvec[0].elements.Flt[i])) continue;
-      maxY = MAX (maxY, yvec[0].elements.Flt[i]);
-      minY = MIN (minY, yvec[0].elements.Flt[i]);
+    if (xvec->type == OPIHI_FLT) {
+      maxY = minY = yvec[0].elements.Flt[0];
+      for (i = 1; i < yvec[0].Nelements; i++) {
+	if (!finite(yvec[0].elements.Flt[i])) continue;
+	maxY = MAX (maxY, yvec[0].elements.Flt[i]);
+	minY = MIN (minY, yvec[0].elements.Flt[i]);
+      }
+    } else {
+      maxY = minY = yvec[0].elements.Int[0];
+      for (i = 1; i < yvec[0].Nelements; i++) {
+	if (!finite(yvec[0].elements.Int[i])) continue;
+	maxY = MAX (maxY, yvec[0].elements.Int[i]);
+	minY = MIN (minY, yvec[0].elements.Int[i]);
+      }
     }
     range = maxY - minY;
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/VectorOps.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/VectorOps.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/VectorOps.c	(revision 20856)
@@ -63,4 +63,5 @@
 }
 
+// XXX add TYPE to arguments?
 Vector *SelectVector (char *name, int mode, int verbose) {
 
@@ -159,4 +160,31 @@
 }
 
+int MatchVector(Vector *out, Vector *in, char type) {
+  if (out[0].elements.Ptr) free (out[0].elements.Ptr);
+  out[0].Nelements = in[0].Nelements;
+  if (type == OPIHI_FLT) {
+    ALLOCATE (out[0].elements.Flt, opihi_flt, out[0].Nelements);
+    out[0].type = OPIHI_FLT;
+  } else {
+    ALLOCATE (out[0].elements.Int, opihi_int, out[0].Nelements);
+    out[0].type = OPIHI_INT;
+  }
+  return (TRUE);
+}
+
+// ResetVector (vecx, OPIHI_FLT, MAX (Npts, 1));
+int ResetVector (Vector *vec, char type, int Nelements) {
+
+  vec[0].Nelements = Nelements;
+  if (type == OPIHI_FLT) {
+    REALLOCATE (vec[0].elements.Flt, opihi_flt, Nelements);
+    vec[0].type = OPIHI_FLT;
+  } else {
+    REALLOCATE (vec[0].elements.Int, opihi_int, Nelements);
+    vec[0].type = OPIHI_INT;
+  }
+  return TRUE;
+}
+
 /* move data from in to out - use old memory space */
 int MoveNamedVector (char *out, char *in) {
@@ -203,8 +231,11 @@
   gprint (GP_LOG, "    N       name      size\n");
   for (i = 0; i < Nvectors; i++) {
-    gprint (GP_LOG, "%5d %10s %10d\n",
-	     i, vectors[i][0].name, vectors[i][0].Nelements);
-  }
-  return (TRUE);
-}
-  
+    if (vectors[i][0].type == OPIHI_FLT) {
+      gprint (GP_LOG, "%5d %10s %10d (FLT)\n", i, vectors[i][0].name, vectors[i][0].Nelements);
+    } else {
+      gprint (GP_LOG, "%5d %10s %10d (INT)\n", i, vectors[i][0].name, vectors[i][0].Nelements);
+    }
+  }
+  return (TRUE);
+}
+  
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/check_stack.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/check_stack.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/check_stack.c	(revision 20856)
@@ -4,5 +4,5 @@
 
   int i, Nx, Ny, Nv, size;
-  char *c;
+  char *c1, *c2;
 
   Nv = Nx = Ny = -1;
@@ -11,9 +11,14 @@
     if (stack[i].type == 'X') {
 
-      /** if this is a number, put it on the list of scalers and move on **/
-      // XXX need to handle IntValue vs FltValue
-      stack[i].FltValue = strtod (stack[i].name, &c);
-      if (c == stack[i].name + strlen (stack[i].name)) {
-	stack[i].type  = 'S';
+      /** if this is a number, put it on the list of scalars and move on.  assume value is
+       * an int unless proven otherwise **/
+      stack[i].FltValue = strtod (stack[i].name, &c1);
+      stack[i].IntValue = strtol (stack[i].name, &c2, 0);
+      if (c2 == stack[i].name + strlen (stack[i].name)) {
+	stack[i].type  = 's'; // 's' == (int)
+	continue;
+      } 
+      if (c1 == stack[i].name + strlen (stack[i].name)) {
+	stack[i].type  = 'S'; // 'S' == (float)
 	continue;
       } 
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/dvomath.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/dvomath.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/dvomath.c	(revision 20856)
@@ -76,8 +76,12 @@
     case 0:
       if (Ncstack == 1) {
-	  /* use exact input work */
-	  sprintf (outname, "%s", stack[0].name);
+	/* use exact input word */
+	sprintf (outname, "%s", stack[0].name);
       } else {
+	if (stack[0].type == 's') {
+	  sprintf (outname, "%d", stack[0].IntValue);
+	} else {
 	  sprintf (outname, "%.12g", stack[0].FltValue);
+	}
       }
       break;
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/evaluate_stack.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/evaluate_stack.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/evaluate_stack.c	(revision 20856)
@@ -21,5 +21,5 @@
 
   if (*Nstack == 1) {
-    if (stack[0].type == 'S') {
+    if ((stack[0].type == 'S') || (stack[0].type == 's')) {
       clear_stack (&tmp_stack);
       return (TRUE);
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/expand_vectors.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/expand_vectors.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/expand_vectors.c	(revision 20856)
@@ -126,5 +126,9 @@
 	}
 	if (I < 0) I += vec[0].Nelements;
-	f1 = vec[0].elements.Flt[I];
+	if (vec[0].type == OPIHI_FLT) {
+	    f1 = vec[0].elements.Flt[I];
+	} else {
+	    f1 = vec[0].elements.Int[I];
+	}
       }
     }
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/multicommand.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/multicommand.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/multicommand.c	(revision 20856)
@@ -88,5 +88,5 @@
 		exit (32);
 	      default:
-		gprint (GP_ERR, "server is busy...\n");
+		gprint (GP_ERR, "server is busy...32\n");
 		bufferPending = TRUE;
 		goto escape;
@@ -101,5 +101,5 @@
 		exit (33);
 	      default:
-		gprint (GP_ERR, "server is busy...\n");
+		gprint (GP_ERR, "server is busy...33\n");
 		bufferPending = TRUE;
 		goto escape;
@@ -116,5 +116,5 @@
 		exit (34);
 	      default:
-		gprint (GP_ERR, "server is busy...\n");
+		gprint (GP_ERR, "server is busy...34\n");
 		bufferPending = TRUE;
 		goto escape;
@@ -131,5 +131,5 @@
 		exit (35);
 	      default:
-		gprint (GP_ERR, "server is busy...\n");
+		gprint (GP_ERR, "server is busy...35\n");
 		bufferPending = TRUE;
 		goto escape;
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/parse.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/parse.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/parse.c	(revision 20856)
@@ -190,5 +190,9 @@
       }
       if (Nx < 0) Nx += vec[0].Nelements;
-      vec[0].elements.Flt[Nx] = atof (val);
+      if (vec[0].type == OPIHI_FLT) {
+	  vec[0].elements.Flt[Nx] = atof (val);
+      } else {
+	  vec[0].elements.Int[Nx] = atol (val);
+      }
     }
 
Index: /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/stack_math.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/stack_math.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/stack_math.c	(revision 20856)
@@ -4,5 +4,9 @@
    labeled by "m". if one of the input matrices is already a temp variable, we 
    can continue using it this round 
-   */
+*/
+
+// XXX we temporarily drop the concept of using one of the temporary input vectors for 
+// the output vector (thus saving an ALLOC): we have to juggle the size of the input vectors 
+// as well as their temporary state
 
 int VV_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
@@ -18,8 +22,4 @@
   Nx = V1[0].vector[0].Nelements;
 
-  // XXX we temporarily drop the concept of using one of the temporary input vectors for 
-  // the output vector (thus saving an ALLOC): we have to juggle the size of the input vectors 
-  // as well as their temporary state
-
   // create the output vector guaranteed to be temporary until the very end
   OUT[0].vector = InitVector ();
@@ -28,45 +28,45 @@
   // set up the possible operations : int OP int -> int, all else yield float
   // OP is the operation performed on *M1 and *M2
-# define VV_FUNC(OP) \
-  if ((V1->vector->type == OPIHI_FLT) && (V2->vector->type == OPIHI_FLT)) { \
-    CopyVector (OUT[0].vector, V1[0].vector); \
-    opihi_flt *M1  =  V1[0].vector[0].elements.Flt; \
-    opihi_flt *M2  =  V2[0].vector[0].elements.Flt; \
-    opihi_flt *out = OUT[0].vector[0].elements.Flt; \
-    for (i = 0; i < Nx; i++, out++, M1++, M2++) { \
-  	*out = OP; \
-    } \
-    break; \
-  } \
-  if ((V1->vector->type == OPIHI_FLT) && (V2->vector->type != OPIHI_FLT)) { \
-    CopyVector (OUT[0].vector, V1[0].vector); \
-    opihi_flt *M1  =  V1[0].vector[0].elements.Flt; \
-    opihi_int *M2  =  V2[0].vector[0].elements.Int; \
-    opihi_flt *out = OUT[0].vector[0].elements.Flt; \
-    for (i = 0; i < Nx; i++, out++, M1++, M2++) { \
-  	*out = OP; \
-    } \
-    break; \
-  } \
-  if ((V1->vector->type != OPIHI_FLT) && (V2->vector->type == OPIHI_FLT)) { \
-    CopyVector (OUT[0].vector, V2[0].vector); \
-    opihi_int *M1  =  V1[0].vector[0].elements.Int; \
-    opihi_flt *M2  =  V2[0].vector[0].elements.Flt; \
-    opihi_flt *out = OUT[0].vector[0].elements.Flt; \
-    for (i = 0; i < Nx; i++, out++, M1++, M2++) { \
-  	*out = OP; \
-    } \
-    break; \
-  } \
-  if ((V1->vector->type != OPIHI_FLT) && (V2->vector->type != OPIHI_FLT)) { \
-    CopyVector (OUT[0].vector, V1[0].vector); \
-    opihi_int *M1  =  V1[0].vector[0].elements.Int; \
-    opihi_int *M2  =  V2[0].vector[0].elements.Int; \
-    opihi_int *out = OUT[0].vector[0].elements.Int; \
-    for (i = 0; i < Nx; i++, out++, M1++, M2++) { \
-  	*out = OP; \
-    } \
-    break; \
-  }
+# define VV_FUNC(OP) {							\
+    if ((V1->vector->type == OPIHI_FLT) && (V2->vector->type == OPIHI_FLT)) { \
+      CopyVector (OUT[0].vector, V1[0].vector);				\
+      opihi_flt *M1  =  V1[0].vector[0].elements.Flt;			\
+      opihi_flt *M2  =  V2[0].vector[0].elements.Flt;			\
+      opihi_flt *out = OUT[0].vector[0].elements.Flt;			\
+      for (i = 0; i < Nx; i++, out++, M1++, M2++) {			\
+  	*out = OP;							\
+      }									\
+      break;								\
+    }									\
+    if ((V1->vector->type == OPIHI_FLT) && (V2->vector->type != OPIHI_FLT)) { \
+      CopyVector (OUT[0].vector, V1[0].vector);				\
+      opihi_flt *M1  =  V1[0].vector[0].elements.Flt;			\
+      opihi_int *M2  =  V2[0].vector[0].elements.Int;			\
+      opihi_flt *out = OUT[0].vector[0].elements.Flt;			\
+      for (i = 0; i < Nx; i++, out++, M1++, M2++) {			\
+  	*out = OP;							\
+      }									\
+      break;								\
+    }									\
+    if ((V1->vector->type != OPIHI_FLT) && (V2->vector->type == OPIHI_FLT)) { \
+      CopyVector (OUT[0].vector, V2[0].vector);				\
+      opihi_int *M1  =  V1[0].vector[0].elements.Int;			\
+      opihi_flt *M2  =  V2[0].vector[0].elements.Flt;			\
+      opihi_flt *out = OUT[0].vector[0].elements.Flt;			\
+      for (i = 0; i < Nx; i++, out++, M1++, M2++) {			\
+  	*out = OP;							\
+      }									\
+      break;								\
+    }									\
+    if ((V1->vector->type != OPIHI_FLT) && (V2->vector->type != OPIHI_FLT)) { \
+      CopyVector (OUT[0].vector, V1[0].vector);				\
+      opihi_int *M1  =  V1[0].vector[0].elements.Int;			\
+      opihi_int *M2  =  V2[0].vector[0].elements.Int;			\
+      opihi_int *out = OUT[0].vector[0].elements.Int;			\
+      for (i = 0; i < Nx; i++, out++, M1++, M2++) {			\
+  	*out = OP;							\
+      }									\
+      break;								\
+    } }
 
   switch (op[0]) {
@@ -90,8 +90,8 @@
     case 'A': VV_FUNC((*M1 && *M2) ? 1 : 0);
     case 'O': VV_FUNC((*M1 || *M2) ? 1 : 0);
-  default:
-    sprintf (line, "error: op %c not defined!", op[0]);
-    push_error (line);
-    return (FALSE);
+    default:
+      sprintf (line, "error: op %c not defined!", op[0]);
+      push_error (line);
+      return (FALSE);
   }
 # undef VV_FUNC
@@ -122,21 +122,50 @@
   Nx = V2[0].vector[0].Nelements;
 
-  if (V2[0].type == 'v') { /** use V2 as temp buffer, but header of V1 **/
-    OUT[0].vector = V2[0].vector;
-    V2[0].type = 'V'; /* prevent it from being freed below */
-  } else {  /* no spare temp buffer */
-    OUT[0].vector = InitVector ();
-    CopyVector (OUT[0].vector, V2[0].vector);
-  }
+  OUT[0].vector = InitVector ();
   OUT[0].type = 'v';   /*** <<--- says this is a temporary matrix ***/
 
-  opihi_flt  M1  = V1[0].FltValue;
-  opihi_flt *M2  = V2[0].vector[0].elements.Flt;
-  opihi_flt *out = OUT[0].vector[0].elements.Flt;
-
-# define SV_FUNC(OP) \
-    for (i = 0; i < Nx; i++, out++, M2++) \
-      *out = OP; \
-    break; 
+  // set up the possible operations : int OP int -> int, all else yield float
+  // OP is the operation performed on *M1 and *M2
+# define SV_FUNC(OP)						\
+  if ((V1->type == 'S') && (V2->vector->type == OPIHI_FLT)) {	\
+    CopyVector (OUT[0].vector, V2[0].vector);			\
+    opihi_flt  M1  =  V1[0].FltValue;				\
+    opihi_flt *M2  =  V2[0].vector[0].elements.Flt;		\
+    opihi_flt *out = OUT[0].vector[0].elements.Flt;		\
+    for (i = 0; i < Nx; i++, out++, M2++) {			\
+      *out = OP;						\
+    }								\
+    break;							\
+  }								\
+  if ((V1->type == 'S') && (V2->vector->type != OPIHI_FLT)) {	\
+    MatchVector (OUT[0].vector, V2[0].vector, OPIHI_FLT);	\
+    opihi_flt  M1  =  V1[0].FltValue;				\
+    opihi_int *M2  =  V2[0].vector[0].elements.Int;		\
+    opihi_flt *out = OUT[0].vector[0].elements.Flt;		\
+    for (i = 0; i < Nx; i++, out++, M2++) {			\
+      *out = OP;						\
+    }								\
+    break;							\
+  }								\
+  if ((V1->type == 's') && (V2->vector->type == OPIHI_FLT)) {	\
+    CopyVector (OUT[0].vector, V2[0].vector);			\
+    opihi_int  M1  =  V1[0].IntValue;				\
+    opihi_flt *M2  =  V2[0].vector[0].elements.Flt;		\
+    opihi_flt *out = OUT[0].vector[0].elements.Flt;		\
+    for (i = 0; i < Nx; i++, out++, M2++) {			\
+      *out = OP;						\
+    }								\
+    break;							\
+  }								\
+  if ((V1->type == 's') && (V2->vector->type != OPIHI_FLT)) {	\
+    CopyVector (OUT[0].vector, V2[0].vector);			\
+    opihi_int  M1  =  V1[0].IntValue;				\
+    opihi_int *M2  =  V2[0].vector[0].elements.Int;		\
+    opihi_int *out = OUT[0].vector[0].elements.Int;		\
+    for (i = 0; i < Nx; i++, out++, M2++) {			\
+      *out = OP;						\
+    }								\
+    break;							\
+  }
 
   switch (op[0]) { 
@@ -188,21 +217,50 @@
   Nx = V1[0].vector[0].Nelements;
 
-  if (V1[0].type == 'v') { /** use V1 as temp buffer **/
-    OUT[0].vector = V1[0].vector;
-    V1[0].type = 'V'; /* prevent it from being freed below */
-  } else {  /* no spare temp buffer */
-    OUT[0].vector = InitVector ();
-    CopyVector (OUT[0].vector, V1[0].vector);
-  }
+  OUT[0].vector = InitVector ();
   OUT[0].type = 'v';   /*** <<--- says this is a temporary matrix ***/
 
-  opihi_flt *M1  = V1[0].vector[0].elements.Flt;
-  opihi_flt  M2  = V2[0].FltValue;
-  opihi_flt *out = OUT[0].vector[0].elements.Flt;
-
-# define VS_FUNC(OP) \
-    for (i = 0; i < Nx; i++, out++, M1++) \
-      *out = OP; \
-    break; 
+  // set up the possible operations : int OP int -> int, all else yield float
+  // OP is the operation performed on *M1 and *M2
+# define VS_FUNC(OP)						\
+  if ((V2->type == 'S') && (V1->vector->type == OPIHI_FLT)) {	\
+    CopyVector (OUT[0].vector, V1[0].vector);			\
+    opihi_flt *M1  =  V1[0].vector[0].elements.Flt;		\
+    opihi_flt  M2  =  V2[0].FltValue;				\
+    opihi_flt *out = OUT[0].vector[0].elements.Flt;		\
+    for (i = 0; i < Nx; i++, out++, M1++) {			\
+      *out = OP;						\
+    }								\
+    break;							\
+  }								\
+  if ((V2->type == 'S') && (V1->vector->type != OPIHI_FLT)) {	\
+    MatchVector (OUT[0].vector, V1[0].vector, OPIHI_FLT);	\
+    opihi_int *M1  =  V1[0].vector[0].elements.Int;		\
+    opihi_flt  M2  =  V2[0].FltValue;				\
+    opihi_flt *out = OUT[0].vector[0].elements.Flt;		\
+    for (i = 0; i < Nx; i++, out++, M1++) {			\
+      *out = OP;						\
+    }								\
+    break;							\
+  }								\
+  if ((V2->type == 's') && (V1->vector->type == OPIHI_FLT)) {	\
+    CopyVector (OUT[0].vector, V1[0].vector);			\
+    opihi_flt *M1  =  V1[0].vector[0].elements.Flt;		\
+    opihi_int  M2  =  V2[0].IntValue;				\
+    opihi_flt *out = OUT[0].vector[0].elements.Flt;		\
+    for (i = 0; i < Nx; i++, out++, M1++) {			\
+      *out = OP;						\
+    }								\
+    break;							\
+  }								\
+  if ((V2->type == 's') && (V1->vector->type != OPIHI_FLT)) {	\
+    CopyVector (OUT[0].vector, V1[0].vector);			\
+    opihi_int *M1  =  V1[0].vector[0].elements.Int;		\
+    opihi_int  M2  =  V2[0].IntValue;				\
+    opihi_int *out = OUT[0].vector[0].elements.Int;		\
+    for (i = 0; i < Nx; i++, out++, M1++) {			\
+      *out = OP;						\
+    }								\
+    break;							\
+  }
 
   switch (op[0]) { 
@@ -276,11 +334,11 @@
   float     *out = (float *)OUT[0].buffer[0].matrix.buffer;
 
-# define MV_FUNC(OP) \
-    for (i = 0; i < Ny; i++, M2++) { \
-      for (j = 0; j < Nx; j++, out++, M1++) { \
-        *out = OP; \
-      } \
-    } \
-    break; 
+# define MV_FUNC(OP)				\
+  for (i = 0; i < Ny; i++, M2++) {		\
+    for (j = 0; j < Nx; j++, out++, M1++) {	\
+      *out = OP;				\
+    }						\
+  }						\
+  break; 
 
   switch (op[0]) { 
@@ -355,12 +413,12 @@
   float     *out = (float *)OUT[0].buffer[0].matrix.buffer;
 
-# define VM_FUNC(OP) \
-    for (i = 0; i < Ny; i++) { \
-      M1  = V1[0].vector[0].elements.Flt; \
-      for (j = 0; j < Nx; j++, out++, M1++, M2++) { \
-        *out = OP; \
-      } \
-    } \
-    break; 
+# define VM_FUNC(OP)					\
+  for (i = 0; i < Ny; i++) {				\
+    M1  = V1[0].vector[0].elements.Flt;			\
+    for (j = 0; j < Nx; j++, out++, M1++, M2++) {	\
+      *out = OP;					\
+    }							\
+  }							\
+  break; 
 
   switch (op[0]) { 
@@ -437,86 +495,36 @@
   out = (float *)OUT[0].buffer[0].matrix.buffer;
 
+# define MM_FUNC(OP)					\
+  for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) {	\
+    *out = OP;						\
+  }							\
+  break; 
+
   switch (op[0]) { 
-  case '+': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
-      *out = *M1 + *M2;
-    break; 
-  case '-': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
-      *out = *M1 - *M2;
-    break; 
-  case '*': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
-      *out = *M1 * *M2;
-    break; 
-  case '/': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
-      *out = *M1 / *M2;
-    break; 
-  case '%': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
-      *out = (int) *M1 % (int) *M2;
-    break; 
-  case 0x5e: 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = pow (*M1, *M2);
-    break; 
-  case '@': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = DEG_RAD*atan2 (*M1, *M2);
-    break; 
-  case 'D': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = MIN (*M1, *M2);
-    break; 
-  case 'U': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = MAX (*M1, *M2);
-    break; 
-  case '<': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = (*M1 < *M2) ? 1 : 0;
-    break; 
-  case '>': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = (*M1 > *M2) ? 1 : 0;
-    break; 
-  case '&': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = ((int)*M1 & (int)*M2);
-    break; 
-  case '|': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = ((int)*M1 | (int)*M2);
-    break; 
-  case 'E': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = (*M1 == *M2) ? 1 : 0;
-    break; 
-  case 'N': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = (*M1 != *M2) ? 1 : 0;
-    break; 
-  case 'L': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = (*M1 <= *M2) ? 1 : 0;
-    break; 
-  case 'G': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = (*M1 >= *M2) ? 1 : 0;
-    break; 
-  case 'A': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = (*M1 && *M2) ? 1 : 0;
-    break; 
-  case 'O': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
-      *out = (*M1 || *M2) ? 1 : 0;
-    break; 
-  default:
-    sprintf (line, "error: op %c not defined!", op[0]);
-    push_error (line);
-    return (FALSE);
-  }
+    case '+': MM_FUNC(*M1 + *M2);
+    case '-': MM_FUNC(*M1 - *M2);
+    case '*': MM_FUNC(*M1 * *M2);
+    case '/': MM_FUNC(*M1 / *M2);
+    case '%': MM_FUNC((int) *M1 % (int) *M2);
+    case '^': MM_FUNC(pow (*M1, *M2));
+    case '@': MM_FUNC(DEG_RAD*atan2 (*M1, *M2));
+    case 'D': MM_FUNC(MIN (*M1, *M2));
+    case 'U': MM_FUNC(MAX (*M1, *M2));
+    case '<': MM_FUNC((*M1 < *M2) ? 1 : 0);
+    case '>': MM_FUNC((*M1 > *M2) ? 1 : 0);
+    case '&': MM_FUNC(((int)*M1 & (int)*M2));
+    case '|': MM_FUNC(((int)*M1 | (int)*M2));
+    case 'E': MM_FUNC((*M1 == *M2) ? 1 : 0);
+    case 'N': MM_FUNC((*M1 != *M2) ? 1 : 0);
+    case 'L': MM_FUNC((*M1 <= *M2) ? 1 : 0);
+    case 'G': MM_FUNC((*M1 >= *M2) ? 1 : 0);
+    case 'A': MM_FUNC((*M1 && *M2) ? 1 : 0);
+    case 'O': MM_FUNC((*M1 || *M2) ? 1 : 0);
+    default:
+      sprintf (line, "error: op %c not defined!", op[0]);
+      push_error (line);
+      return (FALSE);
+  }
+# undef MM_FUNC
 
   /** free up any temporary buffers: **/
@@ -538,13 +546,9 @@
   /* at the end, V1 and V2 are deleted only if they were temporary */
   return (TRUE);
-
-}
-
+}
 
 int MS_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
 
   int i, Nx, Ny;
-  float *out, *M1;
-  opihi_flt M2;
   char line[512]; // this is only used to report an error 
   
@@ -562,90 +566,40 @@
   OUT[0].type = 'm';      /*** <<--- says this is a temporary matrix ***/
 
-  M1  = (float *)V1[0].buffer[0].matrix.buffer;
-  M2  = V2[0].FltValue;
-  out = (float *)OUT[0].buffer[0].matrix.buffer;
+  float *M1    = (float *)V1[0].buffer[0].matrix.buffer;
+  opihi_flt M2 = V2[0].FltValue;
+  float *out   = (float *)OUT[0].buffer[0].matrix.buffer;
+
+# define MS_FUNC(OP)				\
+  for (i = 0; i < Nx*Ny; i++, out++, M1++) {	\
+    *out = OP;					\
+  }						\
+  break; 
 
   switch (op[0]) { 
-  case '+': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++)
-      *out = *M1 + M2;
-    break; 
-  case '-': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++)
-      *out = *M1 - M2;
-    break; 
-  case '*': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++)
-      *out = *M1 * M2;
-    break; 
-  case '/': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++)
-      *out = *M1 / M2;
-    break; 
-  case '%': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++)
-      *out = (int) *M1 % (int) M2;
-    break; 
-  case 0x5e: 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = pow (*M1, M2);
-    break; 
-  case '@': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = DEG_RAD*atan2 (*M1, M2);
-    break; 
-  case 'D': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = MIN (*M1, M2);
-    break; 
-  case 'U': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = MAX (*M1, M2);
-    break; 
-  case '<': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = (*M1 < M2) ? 1 : 0;
-    break; 
-  case '>': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = (*M1 > M2) ? 1 : 0;
-    break; 
-  case '&': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = ((int)*M1 & (int)M2);
-    break; 
-  case '|': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = ((int)*M1 | (int)M2);
-    break; 
-  case 'E': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = (*M1 == M2) ? 1 : 0;
-    break; 
-  case 'N': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = (*M1 != M2) ? 1 : 0;
-    break; 
-  case 'L': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = (*M1 <= M2) ? 1 : 0;
-    break; 
-  case 'G': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = (*M1 >= M2) ? 1 : 0;
-    break; 
-  case 'A': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = (*M1 && M2) ? 1 : 0;
-    break; 
-  case 'O': 
-    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
-      *out = (*M1 || M2) ? 1 : 0;
-    break; 
-  default:
-    sprintf (line, "error: op %c not defined!", op[0]);
-    push_error (line);
-    return (FALSE);
-  }
+    case '+': MS_FUNC(*M1 + M2);
+    case '-': MS_FUNC(*M1 - M2);
+    case '*': MS_FUNC(*M1 * M2);
+    case '/': MS_FUNC(*M1 / M2);
+    case '%': MS_FUNC((int) *M1 % (int) M2);
+    case '^': MS_FUNC(pow (*M1, M2));
+    case '@': MS_FUNC(DEG_RAD*atan2 (*M1, M2));
+    case 'D': MS_FUNC(MIN (*M1, M2));
+    case 'U': MS_FUNC(MAX (*M1, M2));
+    case '<': MS_FUNC((*M1 < M2) ? 1 : 0);
+    case '>': MS_FUNC((*M1 > M2) ? 1 : 0);
+    case '&': MS_FUNC(((int)*M1 & (int)M2));
+    case '|': MS_FUNC(((int)*M1 | (int)M2));
+    case 'E': MS_FUNC((*M1 == M2) ? 1 : 0);
+    case 'N': MS_FUNC((*M1 != M2) ? 1 : 0);
+    case 'L': MS_FUNC((*M1 <= M2) ? 1 : 0);
+    case 'G': MS_FUNC((*M1 >= M2) ? 1 : 0);
+    case 'A': MS_FUNC((*M1 && M2) ? 1 : 0);
+    case 'O': MS_FUNC((*M1 || M2) ? 1 : 0);
+    default:
+      sprintf (line, "error: op %c not defined!", op[0]);
+      push_error (line);
+      return (FALSE);
+  }
+# undef MS_FUNC
 
   if (V1[0].type == 'm') {
@@ -658,5 +612,4 @@
 
   return (TRUE);
-
 }
 
@@ -665,6 +618,4 @@
 
   int i, Nx, Ny;
-  float *out, *M2;
-  opihi_flt M1;
   char line[512]; // this is only used to report an error 
   
@@ -681,90 +632,39 @@
   OUT[0].type = 'm'; /*** <<--- says this is a temporary matrix ***/
 
-  M1  = V1[0].FltValue;
-  M2  = (float *)OUT[0].buffer[0].matrix.buffer;
-  out = (float *)OUT[0].buffer[0].matrix.buffer;
+  opihi_flt M1 = V1[0].FltValue;
+  float *M2    = (float *)V2[0].buffer[0].matrix.buffer;
+  float *out   = (float *)OUT[0].buffer[0].matrix.buffer;
+
+# define SM_FUNC(OP)				\
+  for (i = 0; i < Nx*Ny; i++, out++, M2++)	\
+    *out = OP;					\
+  break; 
 
   switch (op[0]) { 
-  case '+': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++)
-      *out = M1 + *M2;
-    break; 
-  case '-': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++)
-      *out = M1 - *M2;
-    break; 
-  case '*': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++)
-      *out = M1 * *M2;
-    break; 
-  case '/': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++)
-      *out = M1 / *M2;
-    break; 
-  case '%': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++)
-      *out = (int) M1 % (int) *M2;
-    break; 
-  case 0x5e: 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++)
-      *out = pow (M1, *M2);
-    break; 
-  case '@': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = DEG_RAD*atan2 (M1, *M2);
-    break; 
-  case 'D': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = MIN (M1, *M2);
-    break; 
-  case 'U': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = MAX (M1, *M2);
-    break; 
-  case '<': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = (M1 < *M2) ? 1 : 0;
-    break; 
-  case '>': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = (M1 > *M2) ? 1 : 0;
-    break; 
-  case '&': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = ((int)M1 & (int)*M2);
-    break; 
-  case '|': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = ((int)M1 | (int)*M2);
-    break; 
-  case 'E': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = (M1 == *M2) ? 1 : 0;
-    break; 
-  case 'N': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = (M1 != *M2) ? 1 : 0;
-    break; 
-  case 'L': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = (M1 <= *M2) ? 1 : 0;
-    break; 
-  case 'G': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = (M1 >= *M2) ? 1 : 0;
-    break; 
-  case 'A': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = (M1 && *M2) ? 1 : 0;
-    break; 
-  case 'O': 
-    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
-      *out = (M1 || *M2) ? 1 : 0;
-    break; 
-  default:
-    sprintf (line, "error: op %c not defined!", op[0]);
-    push_error (line);
-    return (FALSE);
-  }
+    case '+': SM_FUNC(M1 + *M2);
+    case '-': SM_FUNC(M1 - *M2);
+    case '*': SM_FUNC(M1 * *M2);
+    case '/': SM_FUNC(M1 / *M2);
+    case '%': SM_FUNC((int) M1 % (int) *M2);
+    case '^': SM_FUNC(pow (M1, *M2));
+    case '@': SM_FUNC(DEG_RAD*atan2 (M1, *M2));
+    case 'D': SM_FUNC(MIN (M1, *M2));
+    case 'U': SM_FUNC(MAX (M1, *M2));
+    case '<': SM_FUNC((M1 < *M2) ? 1 : 0);
+    case '>': SM_FUNC((M1 > *M2) ? 1 : 0);
+    case '&': SM_FUNC(((int)M1 & (int)*M2));
+    case '|': SM_FUNC(((int)M1 | (int)*M2));
+    case 'E': SM_FUNC((M1 == *M2) ? 1 : 0);
+    case 'N': SM_FUNC((M1 != *M2) ? 1 : 0);
+    case 'L': SM_FUNC((M1 <= *M2) ? 1 : 0);
+    case 'G': SM_FUNC((M1 >= *M2) ? 1 : 0);
+    case 'A': SM_FUNC((M1 && *M2) ? 1 : 0);
+    case 'O': SM_FUNC((M1 || *M2) ? 1 : 0);
+    default:
+      sprintf (line, "error: op %c not defined!", op[0]);
+      push_error (line);
+      return (FALSE);
+  }
+# undef SM_FUNC
 
   if (V2[0].type == 'm') {
@@ -780,77 +680,64 @@
 }
 
-
 int SS_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
 
-  opihi_flt M1, M2;
   char line[512]; // this is only used to report an error 
 
-  M1 = V1[0].FltValue;
-  M2 = V2[0].FltValue;
-  OUT[0].type = 'S';
+# define SS_FUNC(OP)				\
+  if ((V1->type == 'S') && (V2->type == 'S')) { \
+    opihi_flt M1 = V1[0].FltValue;		\
+    opihi_flt M2 = V2[0].FltValue;		\
+    OUT[0].type = 'S';				\
+    OUT[0].FltValue = OP;			\
+    break;					\
+  }						\
+  if ((V1->type == 'S') && (V2->type == 's')) { \
+    opihi_flt M1 = V1[0].FltValue;		\
+    opihi_int M2 = V2[0].IntValue;		\
+    OUT[0].type = 'S';				\
+    OUT[0].FltValue = OP;			\
+    break;					\
+  }						\
+  if ((V1->type == 's') && (V2->type == 'S')) { \
+    opihi_int M1 = V1[0].IntValue;		\
+    opihi_flt M2 = V2[0].FltValue;		\
+    OUT[0].type = 'S';				\
+    OUT[0].FltValue = OP;			\
+    break;					\
+  }						\
+  if ((V1->type == 's') && (V2->type == 's')) { \
+    opihi_int M1 = V1[0].IntValue;		\
+    opihi_int M2 = V2[0].IntValue;		\
+    OUT[0].type = 's';				\
+    OUT[0].IntValue = OP;			\
+    break;					\
+  }
 
   switch (op[0]) { 
-  case '+': 
-    OUT[0].FltValue = M1 + M2;
-    break;    
-  case '-': 
-    OUT[0].FltValue = M1 - M2;
-    break;    
-  case '*': 
-    OUT[0].FltValue = M1 * M2;
-    break;    
-  case '/': 
-    OUT[0].FltValue = M1 / M2;
-    break; 
-  case '%': 
-    OUT[0].FltValue = (int) M1 % (int) M2;
-    break; 
-  case 0x5e: 
-    OUT[0].FltValue = pow (M1, M2);
-    break; 
-  case '@': 
-    OUT[0].FltValue = DEG_RAD*atan2 (M1, M2);
-    break; 
-  case 'D': 
-    OUT[0].FltValue = MIN (M1, M2);
-    break; 
-  case 'U': 
-    OUT[0].FltValue = MAX (M1, M2);
-    break; 
-  case '<': 
-    OUT[0].FltValue = (M1 < M2) ? 1 : 0;
-    break; 
-  case '>': 
-    OUT[0].FltValue = (M1 > M2) ? 1 : 0;
-    break; 
-  case '&': 
-    OUT[0].FltValue = ((int)M1 & (int)M2);
-    break; 
-  case '|': 
-    OUT[0].FltValue = ((int)M1 | (int)M2);
-    break; 
-  case 'E': 
-    OUT[0].FltValue = (M1 == M2) ? 1 : 0;
-    break; 
-  case 'N': 
-    OUT[0].FltValue = (M1 != M2) ? 1 : 0;
-    break; 
-  case 'L': 
-    OUT[0].FltValue = (M1 <= M2) ? 1 : 0;
-    break; 
-  case 'G': 
-    OUT[0].FltValue = (M1 >= M2) ? 1 : 0;
-    break; 
-  case 'A': 
-    OUT[0].FltValue = (M1 && M2) ? 1 : 0;
-    break; 
-  case 'O': 
-    OUT[0].FltValue = (M1 || M2) ? 1 : 0;
-    break; 
-  default:
-    sprintf (line, "error: op %c not defined!", op[0]);
-    push_error (line);
-    return (FALSE);
-  }
+    case '+': SS_FUNC(M1 + M2);
+    case '-': SS_FUNC(M1 - M2);
+    case '*': SS_FUNC(M1 * M2);
+    case '/': SS_FUNC(M1 / M2);
+    case '%': SS_FUNC((int) M1 % (int) M2);
+    case '^': SS_FUNC(pow (M1, M2));
+    case '@': SS_FUNC(DEG_RAD*atan2 (M1, M2));
+    case 'D': SS_FUNC(MIN (M1, M2));
+    case 'U': SS_FUNC(MAX (M1, M2));
+    case '<': SS_FUNC((M1 < M2) ? 1 : 0);
+    case '>': SS_FUNC((M1 > M2) ? 1 : 0);
+    case '&': SS_FUNC(((int)M1 & (int)M2));
+    case '|': SS_FUNC(((int)M1 | (int)M2));
+    case 'E': SS_FUNC((M1 == M2) ? 1 : 0);
+    case 'N': SS_FUNC((M1 != M2) ? 1 : 0);
+    case 'L': SS_FUNC((M1 <= M2) ? 1 : 0);
+    case 'G': SS_FUNC((M1 >= M2) ? 1 : 0);
+    case 'A': SS_FUNC((M1 && M2) ? 1 : 0);
+    case 'O': SS_FUNC((M1 || M2) ? 1 : 0);
+    default:
+      sprintf (line, "error: op %c not defined!", op[0]);
+      push_error (line);
+      return (FALSE);
+  }
+# undef SS_FUNC
 
   clear_stack (V1);
@@ -867,5 +754,5 @@
 
   /* only 'N' and 'E' are allowed for WW_binary operations. anything else is either a
-   syntax error or is a string which looks like a math expression. */
+     syntax error or is a string which looks like a math expression. */
 
   if ((op[0] != 'N') && (op[0] != 'E')) {
@@ -889,14 +776,14 @@
 
   switch (op[0]) { 
-  case 'E': 
-    value = strcmp (V1[0].name, V2[0].name) ? 0 : 1;
+    case 'E': 
+      value = strcmp (V1[0].name, V2[0].name) ? 0 : 1;
     break; 
-  case 'N': 
-    value = strcmp (V1[0].name, V2[0].name) ? 1 : 0;
+    case 'N': 
+      value = strcmp (V1[0].name, V2[0].name) ? 1 : 0;
     break; 
-  default:
-    sprintf (line, "error: op %c not defined for string operations!", op[0]);
-    push_error (line);
-    return (FALSE);
+    default:
+      sprintf (line, "error: op %c not defined for string operations!", op[0]);
+      push_error (line);
+      return (FALSE);
   }
 
@@ -914,45 +801,68 @@
 int S_unary (StackVar *OUT, StackVar *V1, char *op) {
 
-  opihi_flt M1;
+  char line[512]; // this is only used to report an error 
   
-  M1  = V1[0].FltValue;
-  OUT[0].type = 'S';
-
-  if (!strcmp (op, "="))     {    }
-  if (!strcmp (op, "abs"))   {    OUT[0].FltValue = fabs(M1);           }
-  if (!strcmp (op, "int"))   {    OUT[0].FltValue = (float)(int)(M1);   }
-  if (!strcmp (op, "exp"))   {    OUT[0].FltValue = exp (M1);           }
-  if (!strcmp (op, "ten"))   {    OUT[0].FltValue = pow (10.0,M1);      }
-  if (!strcmp (op, "log"))   {    OUT[0].FltValue = log10 (M1);         }
-  if (!strcmp (op, "ln"))    {    OUT[0].FltValue = log (M1);           }
-  if (!strcmp (op, "sqrt"))  {    OUT[0].FltValue = sqrt (M1);          }
-  if (!strcmp (op, "erf"))   {    OUT[0].FltValue = erf (M1);           }
-
-  if (!strcmp (op, "sinh"))  {    OUT[0].FltValue = sinh (M1);          }
-  if (!strcmp (op, "cosh"))  {    OUT[0].FltValue = cosh (M1);          }
-  if (!strcmp (op, "asinh")) {    OUT[0].FltValue = asinh (M1);         }
-  if (!strcmp (op, "acosh")) {    OUT[0].FltValue = acosh (M1);         }
-  if (!strcmp (op, "lgamma")) {   OUT[0].FltValue = lgamma (M1);        }
-
-  if (!strcmp (op, "sin"))   {    OUT[0].FltValue = sin (M1);           }
-  if (!strcmp (op, "cos"))   {    OUT[0].FltValue = cos (M1);           }
-  if (!strcmp (op, "tan"))   {    OUT[0].FltValue = tan (M1);           }
-  if (!strcmp (op, "dsin"))  {    OUT[0].FltValue = sin (M1*RAD_DEG);   }
-  if (!strcmp (op, "dcos"))  {    OUT[0].FltValue = cos (M1*RAD_DEG);   }
-  if (!strcmp (op, "dtan"))  {    OUT[0].FltValue = tan (M1*RAD_DEG);   }
-  if (!strcmp (op, "asin"))  {    OUT[0].FltValue = asin (M1);          }
-  if (!strcmp (op, "acos"))  {    OUT[0].FltValue = acos (M1);          }
-  if (!strcmp (op, "atan"))  {    OUT[0].FltValue = atan (M1);          }
-  if (!strcmp (op, "dasin")) {    OUT[0].FltValue = asin (M1)*DEG_RAD;  }
-  if (!strcmp (op, "dacos")) {    OUT[0].FltValue = acos (M1)*DEG_RAD;  }
-  if (!strcmp (op, "datan")) {    OUT[0].FltValue = atan (M1)*DEG_RAD;  }
-  if (!strcmp (op, "rnd"))   {    OUT[0].FltValue = drand48();           }
-  if (!strcmp (op, "not"))   {    OUT[0].FltValue = !(M1);              }
-  if (!strcmp (op, "--"))    {    OUT[0].FltValue = - (M1);             }
-  if (!strcmp (op, "isinf")) {    OUT[0].FltValue = !finite(M1);        }
-  if (!strcmp (op, "isnan")) {    OUT[0].FltValue = isnan(M1);          } 
-
-  clear_stack (V1);
-  return (TRUE);
+# define S_FUNC(OP,FTYPE) {			\
+    if (V1->type == 'S') {			\
+      opihi_flt M1  = V1[0].FltValue;		\
+      OUT[0].type = 'S';			\
+      OUT[0].FltValue = OP;			\
+      clear_stack (V1);				\
+      return (TRUE);				\
+    }						\
+    if ((FTYPE == 'S') && (V1->type == 's')) {	\
+      opihi_int M1  = V1[0].IntValue;		\
+      OUT[0].type = 'S';			\
+      OUT[0].FltValue = OP;			\
+      clear_stack (V1);				\
+      return (TRUE);				\
+    }						\
+    if ((FTYPE == 's') && (V1->type == 's')) {	\
+      opihi_int M1  = V1[0].FltValue;		\
+      OUT[0].type = 's';			\
+      OUT[0].IntValue = OP;			\
+      clear_stack (V1);				\
+      return (TRUE);				\
+    }						\
+  }
+
+  if (!strcmp (op, "="))      S_FUNC(M1, 's');
+  if (!strcmp (op, "abs"))    S_FUNC(fabs(M1), 's');
+  if (!strcmp (op, "int"))    S_FUNC((int)(M1), 's');
+  if (!strcmp (op, "exp"))    S_FUNC(exp (M1), 'S');
+  if (!strcmp (op, "ten"))    S_FUNC(pow (10.0,M1), 'S');
+  if (!strcmp (op, "log"))    S_FUNC(log10 (M1), 'S');
+  if (!strcmp (op, "ln"))     S_FUNC(log (M1), 'S');
+  if (!strcmp (op, "sqrt"))   S_FUNC(sqrt (M1), 'S');
+  if (!strcmp (op, "erf"))    S_FUNC(erf (M1), 'S');
+  if (!strcmp (op, "sinh"))   S_FUNC(sinh (M1), 'S');
+  if (!strcmp (op, "cosh"))   S_FUNC(cosh (M1), 'S');
+  if (!strcmp (op, "asinh"))  S_FUNC(asinh (M1), 'S');
+  if (!strcmp (op, "acosh"))  S_FUNC(acosh (M1), 'S');
+  if (!strcmp (op, "lgamma")) S_FUNC(lgamma (M1), 'S');
+  if (!strcmp (op, "sin"))    S_FUNC(sin (M1), 'S');
+  if (!strcmp (op, "cos"))    S_FUNC(cos (M1), 'S');
+  if (!strcmp (op, "tan"))    S_FUNC(tan (M1), 'S');
+  if (!strcmp (op, "dsin"))   S_FUNC(sin (M1*RAD_DEG), 'S');
+  if (!strcmp (op, "dcos"))   S_FUNC(cos (M1*RAD_DEG), 'S');
+  if (!strcmp (op, "dtan"))   S_FUNC(tan (M1*RAD_DEG), 'S');
+  if (!strcmp (op, "asin"))   S_FUNC(asin (M1), 'S');
+  if (!strcmp (op, "acos"))   S_FUNC(acos (M1), 'S');
+  if (!strcmp (op, "atan"))   S_FUNC(atan (M1), 'S');
+  if (!strcmp (op, "dasin"))  S_FUNC(asin (M1)*DEG_RAD, 'S');
+  if (!strcmp (op, "dacos"))  S_FUNC(acos (M1)*DEG_RAD, 'S');
+  if (!strcmp (op, "datan"))  S_FUNC(atan (M1)*DEG_RAD, 'S');
+  if (!strcmp (op, "rnd"))    S_FUNC(M1*0.0 + drand48(), 'S');
+  if (!strcmp (op, "not"))    S_FUNC(!(M1), 's');
+  if (!strcmp (op, "--"))     S_FUNC(-(M1), 's');
+  if (!strcmp (op, "isinf"))  S_FUNC(!finite(M1), 'S'); // XXX modify in future 
+  if (!strcmp (op, "isnan"))  S_FUNC(isnan(M1), 'S'); // XXX modify in future   
+
+# undef S_FUNC
+
+  clear_stack (V1);
+  sprintf (line, "error: op %s not defined!", op);
+  push_error (line);
+  return (FALSE);
 
 }
@@ -963,55 +873,78 @@
   
   Nx = V1[0].vector[0].Nelements;
- 
-  if (V1[0].type == 'v') {  /** use V1 as temp buffer **/
-    OUT[0].vector = V1[0].vector;
-    V1[0].type = 'V'; /* prevent it from being freed below */
-  } else {  /* no spare temp buffer */
-    OUT[0].vector = InitVector ();
-    CopyVector (OUT[0].vector, V1[0].vector);
-  }
+
+  OUT[0].vector = InitVector ();
   OUT[0].type = 'v'; /*** <<--- says this is a temporary matrix ***/
-  opihi_flt *M1  = V1[0].vector[0].elements.Flt;
-  opihi_flt *out = OUT[0].vector[0].elements.Flt;
-
-  if (!strcmp (op, "="))     { } /* already set equal */
-  if (!strcmp (op, "abs"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = fabs(*M1);         }}
-  if (!strcmp (op, "int"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = (float)(int)(*M1); }}
-  if (!strcmp (op, "exp"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = exp(*M1);          }}
-  if (!strcmp (op, "ten"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = pow(10.0,*M1);     }}
-  if (!strcmp (op, "log"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = log10(*M1);        }}
-  if (!strcmp (op, "ln"))    { for (i = 0; i < Nx; i++, out++, M1++) { *out = log(*M1);          }}
-  if (!strcmp (op, "sqrt"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = sqrt(*M1);         }}
-  if (!strcmp (op, "erf"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = erf(*M1);          }}
-
-  if (!strcmp (op, "sinh"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = sinh(*M1);        }}
-  if (!strcmp (op, "cosh"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = cosh(*M1);        }}
-  if (!strcmp (op, "asinh"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = asinh(*M1);       }}
-  if (!strcmp (op, "acosh"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = acosh(*M1);       }}
-  if (!strcmp (op, "lgamma")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = lgamma(*M1);      }}
-
-  if (!strcmp (op, "sin"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = sin(*M1);          }}
-  if (!strcmp (op, "cos"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = cos(*M1);          }}
-  if (!strcmp (op, "tan"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = tan(*M1);          }}
-  if (!strcmp (op, "dsin"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = sin(*M1*RAD_DEG);  }}
-  if (!strcmp (op, "dcos"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = cos(*M1*RAD_DEG);  }}
-  if (!strcmp (op, "dtan"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = tan(*M1*RAD_DEG);  }}
-  if (!strcmp (op, "asin"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = asin(*M1);         }}
-  if (!strcmp (op, "acos"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = acos(*M1);         }}
-  if (!strcmp (op, "atan"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = atan(*M1);         }}
-  if (!strcmp (op, "dasin")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = asin(*M1)*DEG_RAD; }}
-  if (!strcmp (op, "dacos")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = acos(*M1)*DEG_RAD; }}
-  if (!strcmp (op, "datan")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = atan(*M1)*DEG_RAD; }}
-  if (!strcmp (op, "rnd"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = drand48();         }}
-  if (!strcmp (op, "ramp"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = i;                 }}
-  if (!strcmp (op, "zero"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = 0;                 }}
-  if (!strcmp (op, "not"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = !(*M1);            }}
-  if (!strcmp (op, "--"))    { for (i = 0; i < Nx; i++, out++, M1++) { *out = -(*M1);            }}
-  if (!strcmp (op, "isinf")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = !finite(*M1);      }}
-  if (!strcmp (op, "isnan")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = isnan(*M1);        }}
-
-  /* xramp and yramp only make sense in for matrices. for vectors, xramp = ramp, yramp = zero */
-  if (!strcmp (op, "xramp")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = i;                 }}
-  if (!strcmp (op, "yramp")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = 0;                 }}
+
+# define V_FUNC(OP,FTYPE) {					\
+  if (V1->vector->type == OPIHI_FLT) {				\
+    CopyVector (OUT[0].vector, V1[0].vector);			\
+    opihi_flt *M1  = V1[0].vector[0].elements.Flt;		\
+    opihi_flt *out = OUT[0].vector[0].elements.Flt;		\
+    for (i = 0; i < Nx; i++, out++, M1++) {			\
+      *out = OP;						\
+    }								\
+    clear_stack (V1);						\
+    return (TRUE);						\
+  }								\
+  if ((V1->vector->type == OPIHI_INT) && (FTYPE == 'S')) {	\
+    MatchVector (OUT[0].vector, V1[0].vector, OPIHI_FLT);	\
+    opihi_int *M1  = V1[0].vector[0].elements.Int;		\
+    opihi_flt *out = OUT[0].vector[0].elements.Flt;		\
+    for (i = 0; i < Nx; i++, out++, M1++) {			\
+      *out = OP;						\
+    }								\
+    clear_stack (V1);						\
+    return (TRUE);						\
+  }								\
+  if ((V1->vector->type == OPIHI_INT) && (FTYPE == 's')) {	\
+    CopyVector (OUT[0].vector, V1[0].vector);			\
+    opihi_int *M1  = V1[0].vector[0].elements.Int;		\
+    opihi_int *out = OUT[0].vector[0].elements.Int;		\
+    for (i = 0; i < Nx; i++, out++, M1++) {			\
+      *out = OP;						\
+    }								\
+    clear_stack (V1);						\
+    return (TRUE);						\
+  } }							
+
+  if (!strcmp (op, "="))      V_FUNC(*M1, 's');
+  if (!strcmp (op, "abs"))    V_FUNC(fabs(*M1), 's');
+  if (!strcmp (op, "int"))    V_FUNC((int)(*M1), 's');
+  if (!strcmp (op, "exp"))    V_FUNC(exp(*M1), 'S');
+  if (!strcmp (op, "ten"))    V_FUNC(pow(10.0,*M1), 'S');
+  if (!strcmp (op, "log"))    V_FUNC(log10(*M1), 'S');
+  if (!strcmp (op, "ln"))     V_FUNC(log(*M1), 'S');
+  if (!strcmp (op, "sqrt"))   V_FUNC(sqrt(*M1), 'S');
+  if (!strcmp (op, "erf"))    V_FUNC(erf(*M1), 'S');
+  if (!strcmp (op, "sinh"))   V_FUNC(sinh(*M1), 'S');
+  if (!strcmp (op, "cosh"))   V_FUNC(cosh(*M1), 'S');
+  if (!strcmp (op, "asinh"))  V_FUNC(asinh(*M1), 'S');
+  if (!strcmp (op, "acosh"))  V_FUNC(acosh(*M1), 'S');
+  if (!strcmp (op, "lgamma")) V_FUNC(lgamma(*M1), 'S');
+  if (!strcmp (op, "sin"))    V_FUNC(sin(*M1), 'S');
+  if (!strcmp (op, "cos"))    V_FUNC(cos(*M1), 'S');
+  if (!strcmp (op, "tan"))    V_FUNC(tan(*M1), 'S');
+  if (!strcmp (op, "dsin"))   V_FUNC(sin(*M1*RAD_DEG), 'S');
+  if (!strcmp (op, "dcos"))   V_FUNC(cos(*M1*RAD_DEG), 'S');
+  if (!strcmp (op, "dtan"))   V_FUNC(tan(*M1*RAD_DEG), 'S');
+  if (!strcmp (op, "asin"))   V_FUNC(asin(*M1), 'S');
+  if (!strcmp (op, "acos"))   V_FUNC(acos(*M1), 'S');
+  if (!strcmp (op, "atan"))   V_FUNC(atan(*M1), 'S');
+  if (!strcmp (op, "dasin"))  V_FUNC(asin(*M1)*DEG_RAD, 'S');
+  if (!strcmp (op, "dacos"))  V_FUNC(acos(*M1)*DEG_RAD, 'S');
+  if (!strcmp (op, "datan"))  V_FUNC(atan(*M1)*DEG_RAD, 'S');
+  if (!strcmp (op, "rnd"))    V_FUNC(drand48(), 'S');
+  if (!strcmp (op, "ramp"))   V_FUNC(i, 's');
+  if (!strcmp (op, "zero"))   V_FUNC(0, 's');
+  if (!strcmp (op, "not"))    V_FUNC(!(*M1), 's');
+  if (!strcmp (op, "--"))     V_FUNC(-(*M1), 's');
+  if (!strcmp (op, "isinf"))  V_FUNC(!finite(*M1), 'S');
+  if (!strcmp (op, "isnan"))  V_FUNC(isnan(*M1), 'S');
+  if (!strcmp (op, "xramp"))  V_FUNC(i, 's');
+  if (!strcmp (op, "yramp"))  V_FUNC(0, 's');
+  /* xramp and yramp above only make sense for matrices. for vectors, xramp = ramp, yramp = zero */
+
+# undef V_FUNC
 
   if (V1[0].type == 'v') {
@@ -1085,5 +1018,5 @@
     for (j = 0; j < Ny; j++) {
       for (i = 0; i < Nx; i++, out++, M1++) {
-        *out = i;
+	*out = i;
       }
     }
@@ -1092,5 +1025,5 @@
     for (j = 0; j < Ny; j++) {
       for (i = 0; i < Nx; i++, out++, M1++) {
-        *out = j;
+	*out = j;
       }
     }
Index: /branches/eam_branch_20081124/Ohana/src/opihi/mana/findpeaks.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/mana/findpeaks.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/mana/findpeaks.c	(revision 20856)
@@ -76,7 +76,8 @@
   }
 
-  REALLOCATE (vecx[0].elements.Flt, opihi_flt, MAX (Npeak, 1));
-  REALLOCATE (vecy[0].elements.Flt, opihi_flt, MAX (Npeak, 1));
-  REALLOCATE (vecz[0].elements.Flt, opihi_flt, MAX (Npeak, 1));
+  ResetVector (vecx, OPIHI_FLT, MAX (Npeak, 1));
+  ResetVector (vecy, OPIHI_FLT, MAX (Npeak, 1));
+  ResetVector (vecz, OPIHI_FLT, MAX (Npeak, 1));
+
   /* eliminate non-local peaks */
   for (N = n = 0; n < Npeak; n++) {
Index: /branches/eam_branch_20081124/Ohana/src/opihi/mana/fitcontour.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/mana/fitcontour.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/mana/fitcontour.c	(revision 20856)
@@ -17,4 +17,8 @@
   xo = atof (argv[3]);
   yo = atof (argv[4]);
+
+  // require these to be float vectors
+  if (vecx->type != OPIHI_FLT) return (FALSE);
+  if (vecy->type != OPIHI_FLT) return (FALSE);
 
   ALLOCATE (B, double *, NTERM);
Index: /branches/eam_branch_20081124/Ohana/src/opihi/mana/rawstars.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/mana/rawstars.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/mana/rawstars.c	(revision 20856)
@@ -55,15 +55,12 @@
   Np = xp[0].Nelements;
 
-  REALLOCATE (xc[0].elements.Flt, opihi_flt, Np);
-  REALLOCATE (yc[0].elements.Flt, opihi_flt, Np);
-  REALLOCATE (sx[0].elements.Flt, opihi_flt, Np);
-  REALLOCATE (sy[0].elements.Flt, opihi_flt, Np);
-  REALLOCATE (sxy[0].elements.Flt, opihi_flt, Np);
-  REALLOCATE (zs[0].elements.Flt, opihi_flt, Np);
-  REALLOCATE (zc[0].elements.Flt, opihi_flt, Np);
-  REALLOCATE (sk[0].elements.Flt, opihi_flt, Np);
-  xc[0].Nelements = yc[0].Nelements = sx[0].Nelements = Np;
-  sy[0].Nelements = zs[0].Nelements = zc[0].Nelements = Np;
-  sxy[0].Nelements = sk[0].Nelements = Np;
+  ResetVector (xc, OPIHI_FLT, Np);
+  ResetVector (yc, OPIHI_FLT, Np);
+  ResetVector (sx, OPIHI_FLT, Np);
+  ResetVector (sy, OPIHI_FLT, Np);
+  ResetVector (sxy, OPIHI_FLT, Np);
+  ResetVector (zs, OPIHI_FLT, Np);
+  ResetVector (zc, OPIHI_FLT, Np);
+  ResetVector (sk, OPIHI_FLT, Np);
 
   v = (float *) buff[0].matrix.buffer;
Index: /branches/eam_branch_20081124/Ohana/src/opihi/mana/starcontour.c
===================================================================
--- /branches/eam_branch_20081124/Ohana/src/opihi/mana/starcontour.c	(revision 20855)
+++ /branches/eam_branch_20081124/Ohana/src/opihi/mana/starcontour.c	(revision 20856)
@@ -22,6 +22,6 @@
   N = 0;
   Npts = 100;
-  REALLOCATE (vecx[0].elements.Flt, opihi_flt, MAX (Npts, 1));
-  REALLOCATE (vecy[0].elements.Flt, opihi_flt, MAX (Npts, 1));
+  ResetVector (vecx, OPIHI_FLT, MAX (Npts, 1));
+  ResetVector (vecy, OPIHI_FLT, MAX (Npts, 1));
 
   Nx = buf[0].matrix.Naxis[0];
