 	mhReadIndex = 0;    
 	if (tmReadIndex >= numTmReadings)
 	tmReadIndex = 0;    
-	if (pvReadIndex >= numPvReadings)
-	pvReadIndex = 0;   
         // Calculate the average:
 	gaAverage = gaTotal / numGaReadings;
 	baAverage = baTotal / numBaReadings;

	Serial.println(filename);
  
// Write heading in file
	logFile.println("GPS Time,GPS Date,Satellites,Fix Quality,Latitude,Longitude,GPS Altitude,GPS Speed,GPS Course,Xaccel,Yaccel,Zaccel,Temperature,Average Grade,Grade,Camber,Heading,Drift,BMP Altitude,Brakes,Max Speed,Distance Traveled,Variometer,GyroX,GyroY,GyroZ");
	logFile.flush();
  
// Connect to the GPS at the desired rate, set options

	caAverage = caTotal / numCaReadings;
	mhAverage = mhTotal / numMhReadings;  
	tmAverage = tmTotal / numTmReadings;
        
// Calculate steering angle (-95 to 95, because the pot has 190 degrees of sweep after pulley ratio)
        // Pot centered on steering angle of 0
        steerAngle = (potVal-95);

// Calculate max speed
        if (maxSpeed<(GPS.speed*(1.15078+speedoCal))){
