Index: trunk/ppSub/src/ppSub.c
===================================================================
--- trunk/ppSub/src/ppSub.c	(revision 23242)
+++ trunk/ppSub/src/ppSub.c	(revision 23740)
@@ -28,4 +28,5 @@
     psLibInit(NULL);
 
+    ppSubData *data = NULL;             // Processing data
     pmConfig *config = pmConfigRead(&argc, argv, PPSUB_RECIPE); // Configuration
     if (!config) {
@@ -49,5 +50,7 @@
     }
 
-    if (!ppSubArgumentsSetup(argc, argv, config)) {
+    data = ppSubDataAlloc(); // Processing data
+
+    if (!ppSubArguments(argc, argv, config, data)) {
         psErrorStackPrint(stderr, "Error reading arguments.\n");
         exitValue = PS_EXIT_CONFIG_ERROR;
@@ -55,5 +58,5 @@
     }
 
-    if (!ppSubCamera(config)) {
+    if (!ppSubCamera(config, data)) {
         psErrorStackPrint(stderr, "Error setting up camera.\n");
         exitValue = PS_EXIT_CONFIG_ERROR;
@@ -61,11 +64,5 @@
     }
 
-    if (!ppSubArgumentsParse(config)) {
-        psErrorStackPrint(stderr, "Error reading arguments.\n");
-        exitValue = PS_EXIT_CONFIG_ERROR;
-        goto die;
-    }
-
-    if (!ppSubLoop(config)) {
+    if (!ppSubLoop(config, data)) {
         psErrorStackPrint(stderr, "Error performing subtraction.\n");
         exitValue = PS_EXIT_SYS_ERROR;
@@ -77,6 +74,8 @@
     psTimerStop();
 
+    psFree(data);
+    psFree(config);
+
     pmVisualClose(); //close plot windows, if -visual is set
-    psFree(config);
     pmModelClassCleanup();
     pmConfigDone();
