   }
 }
 
+// Initialize the DB
 plan_id = python_persist("import plangen",
                          "str(plangen.plan_prep('%s', '%s', %s))" %
-                         (db_file, filename(plan_json), runtype));
+                         (db_file, plan_json, runtype));
 printf("DB plan_id: %s", plan_id);
 
-// python("print('hi')");
+// If the plan already exists and we are not doing a restart, abort
 assert(plan_id != "-1", "Plan already exists!");
 
+// Kickoff the workflow
 stage = 0;
 run_stage(N, S, "1", stage, propagate(), plan_id, db_file, runtype) =>
   printf("RESULTS: COMPLETE");

/*
  WORKFLOW SWIFT

  Simply run with: 'swift-t workflow.swift'
  Or specify the N, S values:
  'swift-t workflow.swift -N=6 -S=6'
  for 55,986 tasks.
  Flags:
  -N : Number of nodes per stage
  -S : Number of stages
  -r : Use RunType.RESTART, default is RunType.RUN_ALL
  --db_file : The SQLite DB file
*/

import assert;


  if (stage < S)
  {
    // Recurse to the child stages
    foreach id_child in [1:N]
    {
      run_stage(N, S, this+"."+id_child, stage+1, parent,
