     Blink(LED, 100);
     return 0; //returns a 0, failure
   }
+  //Print data to new line
+  dataFile.print(NETWORK_ID);
+  dataFile.print("_");
+  dataFile.print(id);
+  dataFile.print(",");
+  dataFile.print(utm);
+  dataFile.print(",");
+  dataFile.print(s_v);
+  dataFile.print(",");
+  dataFile.print(t);
+  dataFile.print(",");
+  dataFile.print(b_v);
+  dataFile.print(",");
+  dataFile.print(e_v);
+  dataFile.print(",");
+  dataFile.print(num_a);
+  dataFile.println();
+  dataFile.close();
+  return 1; //returns a 1, Success
 }
 
 void printData() {

    Serial.print("RFM69 initialized");
    Serial.print(", key: ");
    Serial.println(KEY);
  }
  if(debug) {
    DateTime now = rtc.now();
    Serial.print("Current time is: ");
    Serial.println(now.unixtime());
  }
}


        radio.sendACK();
      }
      if (debug) printData(); //Print the data out to the Serial Monitor
      //and write the data to the SD card
      if (writeDataToCard(data_rcv.nodeID, now.unixtime(), data_rcv.sens_val, data_rcv.temp, data_rcv.excite_v, data_rcv.batt_v, data_rcv.num_attempts)) {
        Blink(LED, 100); //Blink the LED on success
      }
    }
    else { //if the data is an unexpected size
      if (debug) Serial.println("Invalid packet received!!");
      if (badPacket(now.unixtime())) { //note that int he log.txt file and blink thrice
        Blink(LED, 50);
        Blink(LED, 50);
        Blink(LED, 50);
      }
    }
  }
  checkSdCard();
}

int writeDataToCard(int id, long utm, int s_v, float t, float e_v, float b_v, int num_a) {
//  CARD_PRESENT = digitalRead(CARD_DETECT); //Check for card insertion
//  if (CARD_PRESENT == 0) { //if card NOT present....Wait and blink until it is
//    if (debug) Serial.println("Card Not Present");
//    while (CARD_PRESENT == 0) {
//      CARD_PRESENT = digitalRead(CARD_DETECT);
//      Blink(LED, 50);
//    }
//    if (!SD.begin(CHIP_SELECT))
//      Blink(LED, 25);
//    if (debug) Serial.println("SD card initialized");
//  }

  //creates filename to store data based on the Node Address
  String address = String(String(NETWORK_ID) + "_" + String(id));
  String fileName = String(address + ".csv");
  char __fileName[fileName.length() + 1];
  fileName.toCharArray(__fileName, sizeof(__fileName));
  //Opens and checks file
  if (!dataFile.open(__fileName, O_RDWR | O_CREAT | O_AT_END)) {
    if (debug) {
      Serial.print("Error opening: ");
      Serial.println(fileName);
