 
   // open the file. note that only one file can be open at a time,
   // so you have to close this one before opening another.
-  File dataFile = SD.open("data.txt", FILE_WRITE);
+  File dataFile = SD.open(filename, FILE_WRITE);
 
   byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
   // retrieve data from DS3231

#endif    
    sample_count = 0;
    sum = 0;
    append_to_disk(voltage);

#if DEBUG_TO_SD
  write_Text_To_Disk("data.txt","Woke up, logging");
#endif

#if DEBUG

#endif

#if DEBUG_TO_SD
  write_Text_To_Disk(filename,"Going To Sleep");
#endif

  //enter deep sleep
