       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();


#include "TrueRandom.h" //https://github.com/sirleech/TrueRandom

//debug settings
#define DEBUG 0 //0 debug off, 1 debug on. turn off when unnecessary to preserve power
#define DEBUG_TO_SD 0 //0 debug off, 1 debug on

//sd card variables
#define POWA 4    // pin 4 supplies power to microSD card breakout and temp sensor
