anchor.diff:          return new Future.value("");
         }
   
  +      // Delete temporary directory
  +      modelDir.deleteSync(recursive: true);
  +
         // Parse out code from stdout
         List<String> contentWithJson = content.split('\n');
   
  -      for(var i = 0; i < contentWithJson.length; i++) {
  -        // Order of checks based on probability of hits in content
  -        if(contentWithJson[i].contains("extends") &&
  -           contentWithJson[i].contains("VaneModel") &&
  -           contentWithJson[i].contains("class")) {
  -          String clazz = contentWithJson[i].split('extends')[0].trim().split(' ')[1];
  +      // Loop over generated code and add it to the model classes
  +      List<String> generatedCode = codeGen.stdout.toString().split(delimit);
  +      for(var i = 0; i < generatedCode.length; i++) {
  +        // Save generated code (and inherently it's length used below)
  +        models[i].code = generatedCode[i].split('\n');
   
  -          while(i < contentWithJson.length) {
  -            i++;
  +        // Calculate offset used to insert generated code, we add the original
  +        // row the class was found at with the totalt amount of inserted row
  +        // so far (the added rows from added generated code).
  +        int offset = models.sublist(0, i).fold(0, (x, y) => x + y.code.length);
   
  -            if(contentWithJson[i].contains('${clazz}.model()') == true) {
  -              contentWithJson.insert(i + 1, '\n${codeGen.stdout}');
  -              i = i + 1 + codeGen.stdout.length;
  -              break;
  -            }
  -          }
  -        }
  +        // Add the original row to the offset
  +        offset = offset + models[i].row;
  +
  +        // Add function used for Json encode/decode to the outputed code
  +        contentWithJson.insertAll(offset, models[i].code);
         }
   
         // Write new code with json serialization code to build dir
  
positive.code: part of vane_transformer;
  
  /*
   * Algorithm to find where to insert toJson() function:
   *
   * 1. Find a row that contains "class" + "extends" + "VaneModel"
   * 2. Parse out the model class from said row, called Model here
   * 3. Continue until we find a row with "Model.model()"
   * 4. Insert toJson() function below "Model.model()"
   *
   */
  
        /// 1. Create a new temp dir, /tmp/model_62342336
        /// 2. Add a pubspec.yaml based on imports in model.dart
        /// 3. Run pub get
        /// 4. Run a program with VaneModel.transform to get the generated code
        ///      - Inside this function, double check if the model override
        ///        toJson, then don't add a second toJson....
  
  
  class VaneModelTransformer extends Transformer {
    final BarbackSettings _settings;
  
negative.code:   }
  }
  
  