 
 void newFile(){
 
-    // File format should be: UNIXTIME_yyyy-mm-ddThhmmss
-    // For example: 1506907892_2017-10-02T193101.csv
-    // which is: 2017/Oct/02 7:39:01pm
-    /*
-    int unix   = now.unixtime();
+    // Fat32 limits file names to 8 characters plus a 3 character extension
+    // UNIX time is 10 characters long so we truncate off the first two characters to 
+    // form the file name. 
+
+    DateTime now = RTC.now();
+    unsigned long unix   = now.unixtime();
     int year   = now.year();
     int month  = now.month();
     int day    = now.day();
     int hour   = now.hour();
     int minute = now.minute();
     int second = now.second();
-    */
-    unsigned long unix   = 1506907891;
-    int year   = 2017;
-    int month  = 10;
-    int day    = 2;
-    int hour   = 19;
-    int minute = 31;
-    int second = 4;
 
     char buff[580];
     char *header = buff;

float STREAM_INTERVAL = 1;

// define the Real Time Clock object
RTC_DS1307 RTC; 

// for the data logging shield, we use digital pin 10 for the SD cs line
const int chipSelect = 0;

// the logging file
File TGC_logfile;


    sei(); //enable interupts
  

    // initialize the SD card
    serialOut("Initializing SD card...");
    // make sure that the default chip select pin is set to
    // output, even if you don't use it:
    pinMode(10, OUTPUT);

    // see if the card is present and can be initialized:
    if (!SD.begin(chipSelect)) {
