/**
   * does the post-processing, called by Slic3r Generator
   *
   * @return
   */
  protected BuildCode runPostProcessing() {
    // Load our code to a source iterator
    source = new MutableGCodeSource(generator.output.file);

    if (!dualstruding) {
      if (prependStart) runPrepend(startCode);
      if (appendEnd) runAppend(endCode);

      if (!multiHead) toolheadTarget = ToolheadAlias.SINGLE;

      if (toolheadTarget != null) runToolheadSwap(toolheadTarget);
    }

    // these display the build % on The Replicator
    if (addProgressUpdates) {
      source.addSlic3rProgressUpdates();
    }

    if (prependMetaInfo) {
      MutableGCodeSource metaInfo = new MutableGCodeSource();
      String curDate = getPrettyPrintDate();
      String machineName = (machineType != null ? machineType.getName() : "CNC Machine");
      // metaInfo.add("(** UUID: " + UUID.randomUUID().toString() + " **)");
      metaInfo.add("(** This GCode was generated by ReplicatorG " + Base.VERSION_NAME + " **)");
      // TRICKY: calling a static method on an instance of a class is considered bad practice,
      //				but I'm not sure how to access displayName without it
      metaInfo.add("(*  using " + generator.displayName + "  *)");
      metaInfo.add(
          "(*  for a " + (multiHead ? "Dual headed " : "Single headed ") + machineName + "  *)");
      metaInfo.add("(*  on " + curDate + " *)");

      runPrepend(metaInfo);
    }

    // scans to cool unused head if required
    //		if( multiHead )
    //			source.coolUnusedToolhead();

    // Write the modified source back to our file
    source.writeToFile(generator.output.file);

    return generator.output;
  }