       //Serial.print(F("RFID NUMBER: "));
       Serial.println(player_rfid);
     }
-    
+
     if (character == 'S' || character == 's') {
       makeFileName();
       datafile = SD.open(filepath, FILE_WRITE);
-#if DEBUG > 0 
+#if DEBUG > 0
       Serial.println(datafile);
 #endif
       file_open = true;
       datafile.println(player_rfid);
       //reset all the pointers and score variables
       current_score = 0;
-      write_marker = -1;
-      read_marker = -1;
-      calc_marker = -1;
+      write_marker = 0;
+      read_marker = 0;
+      calc_marker = 0;
       start_time = millis();
       for (int i=0; i<PINS; i++) {
         last_hit[i] = start_time;
       }
       //start running the hit monitoring
       is_running = true;
-      Timer1.attachInterrupt(piezoCheck); 
-#if DEBUG > 0 
+      Timer1.attachInterrupt(piezoCheck);
+#if DEBUG > 0
       Serial.println(F("RUN"));
 #endif
     }
-      
+
     if (character == 'X' || character == 'x') {
       Timer1.detachInterrupt();
       is_running = false;

RTC_DS1307 RTC;
File datafile;

#define DEBUG 0

#define BAUD 9600
#define RESEND_TIMER 250
#define DEBOUNCE_LIMIT 20
#define SCORE_THRESHOLD 102
#define SPI_CS 53
#define PINS 16
#define BUFFER_LINES 300

unsigned long start_time = 0UL;
boolean report_score = false;
boolean file_open = false;
long current_score = 0UL;
char player_rfid[RFID_DIGITS] = "12345678"; // first 8 chars for folder name
char filepath[FOLDER_BUFFER];

