   // Start declaration
   Serial.print("unsigned int  ");          // variable type
   Serial.print("rawData[");                // array name
-  Serial.print(results->rawlen + 1, DEC);  // array size
+  Serial.print(results->rawlen - 1, DEC);  // array size
   Serial.print("] = {");                   // Start declaration
 
   // Dump data
   for (int i = 1;  i < results->rawlen;  i++) {
     Serial.print(results->rawbuf[i] * USECPERTICK, DEC);
-    Serial.print(",");
+    if ( i < results->rawlen-1 ) Serial.print(","); // ',' not needed on last one
     if (!(i & 1))  Serial.print(" ");
   }
 
   // End declaration
-  Serial.print("0};");  // Turn LED off at the end
+  Serial.print("};");  // 
 
   // Comment
   Serial.print("  // ");

      if (x < 1000)  Serial.print(" ") ;
      if (x < 100)   Serial.print(" ") ;
      Serial.print(x, DEC);
      Serial.print(", ");
    }
    if (!(i % 8))  Serial.println("");
  }

{
  // Print Raw data
  Serial.print("Timing[");
  Serial.print(results->rawlen-1, DEC);
  Serial.println("]: ");

  for (int i = 1;  i < results->rawlen;  i++) {
