 	File logFile;
 
 // Initialize variables
+        // Calculated 
 	double camber = 0; 
 	double grade = 0;
         double averageGrade = 0;
 	double magHeading = 0;
+        double maxSpeed = 0;
+        double tripDistance = 0;
+        boolean brakesOn = false;
+
+        // BMP sensor
+        float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;       
+        float alt=0, vio=0;
 	float temperature = 0;
 	float bmpAltitude = 0;
-        double steerAngle = 0;  
-        double maxSpeed = 0;
+        
+        // Analog inputs
+        int potVal = 0;
+        int buttonState = 0;
+        int steerAngle = 0;  
+ 
+        // Distance       
         float lastLat = 0;
         float lastLon = 0;
         float origLat = 0;
         float origLon = 0;
         float origAlt = 0;
-        double tripDistance = 0;
+        
+        // Calibrate and sync
+	boolean runOnce = false;
+        boolean firstMove = false;   
         double speedoCal = .18;
-        double potVal = 0;
-        int buttonState = 0;
-        boolean brakesOn = false;
-	boolean runOnce = false;
-        boolean firstMove = false;             
+        
+        // IMU      
+        // From http://www.tkjelectronics.com
+        Kalman kalmanX; 
+        Kalman kalmanY;
         double accX, accY, accZ;
         double gyroX, gyroY, gyroZ;
         int tempRaw;
         long timer, timer2;      
         double gyroXangle, gyroYangle; 
         double kalRoll, kalPitch; 
-        float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;       
-        float alt=0, vio=0;
+
+        // Lights
+        Adafruit_NeoPixel pixels = Adafruit_NeoPixel(numPixels, ledPin, NEO_GRB + NEO_KHZ800);
         long previousMillis=0;
+        
+        // Low pass filter variables
         const float accelAlpha = 0.2;
         const float gyroAlpha = 0.2;
         const float magAlpha = 0.3;

	int mhAverage = 0;                // the average
	int tmAverage = 0;                // the average

// Accel calibration for calculating G Force - using simple calibration method       
	int xRawMin = -121.85;
	int xRawMax = 121.85;
	int yRawMin = -119.75;

        double fXm = 0;
        double fYm = 0;
        double fZm = 0;
               
        // Smoothing. Raising numReadings makes smoothing more aggressive. 
	const int numGaReadings = 3;
	const int numBaReadings = 3;
	const int numGdReadings = 3;
