 
   dataFile = SD.open("PELLETJuly.csv", FILE_WRITE);
   if (dataFile) {
-    Serial.println("File successfully written...");
+    Serial.println(F("File successfully written..."));
     Serial.println(time);
     dataFile.print(time);
     dataFile.print(",");

  }

  if (!SD.begin(CS_pin)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    while (1) ;
  }

  Serial.println("card initialized.");

  dataFile = SD.open("PELLETJuly.csv", FILE_WRITE);
  if (! dataFile) {
    Serial.println("error opening datalog.txt");
    // Wait forever since we cant write data
    while (1) ;
  }

  else {
    dataFile.print(time);
    dataFile.println("Time,Pellet Count,Pellet Drop Delay");
    dataFile.close();
  }


    digitalWrite(MOTOR_INPUT3_PIN, HIGH);
    digitalWrite(MOTOR_INPUT4_PIN, HIGH);
    startTime = millis();
    Serial.print(F("Time Elapsed Check: "));
    Serial.println(timeElapsed);
    timecounter(timeElapsed);
    logData();
    pelletCount ++;
    Serial.println(F("It did work"));
    LEDserial.print("v"); // this is the reset display command
    delay(5); // allow a very short delay for display response
    LEDserial.print(pelletCount);
    lastState = PIState;

  }
  else if (PIState == 1) {
    Serial.println(F("Turning motor..."));
    motor.step(-steps / 2);
    motor.step(steps);
    lastState = PIState;
  }
  
  else if (PIState == 0 & PIState != lastState) {
    Serial.print(F("Time Elapsed Since Last Pellet: "));
    timeElapsed = millis() - startTime;
    Serial.println(timeElapsed);
    lastState = PIState;
