Index: trunk/Ohana/src/imregister/spreg/modify.c
===================================================================
--- trunk/Ohana/src/imregister/spreg/modify.c	(revision 2803)
+++ trunk/Ohana/src/imregister/spreg/modify.c	(revision 3491)
@@ -2,15 +2,12 @@
 # include "spreg.h"
 
-void ModifySubset (int *match, int Nmatch) {
+void ModifySubset (DB *db, Spectrum *spectrum, int Nspectrum, int *match, int Nmatch) {
 
   int i, j, Nold;
   char *tmppath;
-  int Nspectrum;
-  Spectrum *spectrum;
+  VTable vtable;
 
   Nold = 0;
   tmppath = NULL;
-
-  spectrum = get_spectra (&Nspectrum);
 
   /* create some necessary variables */
@@ -41,5 +38,9 @@
   }
 
-  update_db (match, Nmatch);
+  fits_vtable_from_ftable (&vtable, &db[0].ftable, match, Nmatch);
+  for (i = 0; i < Nmatch; i++) {
+    fits_convert_Spectrum (vtable.buffer[i], 1);
+  }
+  fits_db_update (db, &vtable);
   fprintf (stderr, "SUCCESS\n");
   exit (0);
