Index: trunk/psastro/src/psastro.c
===================================================================
--- trunk/psastro/src/psastro.c	(revision 5510)
+++ trunk/psastro/src/psastro.c	(revision 5560)
@@ -4,6 +4,4 @@
 
     psMetadata *header = NULL;
-    pmAstromGridMatchStat stat;
-    pmAstromMatch *match;
 
     // load configuration information
@@ -11,20 +9,20 @@
 
     // load the input data (cmp file)
-    psArray *rawstars = pmSourcesReadCMP (&header, argv[1]);
+    psArray *rawstars = psastroReadCMP (&header, argv[2]);
 
     // simple layout interpretation, basic WCS conversion
-    psFPA *fpa = psastroBuildFPA (header, rawstars);
+    pmFPA *fpa = psastroBuildFPA (header, rawstars);
 
     // limit fit to bright stars only 
-    psFPA *subset = psastroSelectBrightStars (fpa, config);
-
-    // use the header & config info to project rawstars on the focal plane
-    psastroProjectRawstars (subset);
+    psastroSelectBrightStars (fpa, config);
 
     // fpa and subset point to the same astrometry terms
-    psastroChipAstrom (subset, config);
+    psastroChipAstrom (fpa, config);
 
     // write out data (cmp file)
-    psastroWriteCMP (fpa, argv[2]);
+    psastroWriteCMP (fpa, argv[3]);
+
+    psFree (config);
+    psFree (fpa);
 
     exit (0);
