       int topDigit = uuidNumber[i] >> 4;
       int bottomDigit = uuidNumber[i] & 0x0f;
       // Print high hex digit
+#if DEBUG
+      Serial.print( "0123456789ABCDEF"[topDigit]);
+      Serial.print("0123456789ABCDEF"[bottomDigit]);
+#endif
       dataFile.print( "0123456789ABCDEF"[topDigit] );
       // Low hex digit
       dataFile.print( "0123456789ABCDEF"[bottomDigit] );
     }
+#if DEBUG
+    Serial.println();
+#endif
+
+    dataFile.close();
   }
 }
 

  Serial.begin(9600);
#endif

/*REMOVE
  // set pin 4 (POWA) to output so that we can control the
  //power of the sd reader and the temp sensor
  pinMode(POWA, OUTPUT);
  // turn on SD card and temp sensor 
  digitalWrite(POWA, HIGH);
*/

  //set up sd card
  sd_setup();


    // take a number of analog samples and add them up
    while (sample_count < NUM_VOLTAGE_SAMPLES) {
        sum += analogRead(A3);
        /*REMOVE*/
#if DEBUG_TO_SD
        write_Text_To_Disk("sum = "+String(sum)+"\n");
#endif
#if DEBUG       
        Serial.println("sum = "+String(sum)+"\n");
#endif
        sample_count++;
        delay(10);
    }
    // use 5.0 for a 5.0V ADC reference voltage
    // 5.015V is the calibrated reference voltage
    voltage = ((float)sum / (float)NUM_VOLTAGE_SAMPLES * 5) / 1024.0;
    sample_count = 0;
    sum = 0;
    voltage *= 11;
    // send voltage for display on Serial Monitor
    // voltage multiplied by 11 when using voltage divider that
    // divides by 11. 11.132 is the calibrated voltage divide
    // value
#if DEBUG
    Serial.print(voltage);
    Serial.println (" V");
#endif    
 
