         dataFile.print(seperator);
         dataFile.print(tsl.getLuminosity(TSL2591_VISIBLE));
         dataFile.print(seperator);
-        dataFile.print(tsl.calculateLux(full,ir));
+        dataFile.print(tsl.calculateLux(full, ir));
         dataFile.print(seperator);
         dataFile.print(ir);
         dataFile.print(seperator);
-        dataFile.println(((double) accelgyro.getAccelerationZ()/16384), 4);
-
+        dataFile.print(((double) accelgyro.getAccelerationZ() / 16384), 4);
+        dataFile.print(seperator);
+        dataFile.println(myBarometer.calcAltitude(myBarometer.bmp085GetPressure(myBarometer.bmp085ReadUP())));
+
+        //Serial.println(accelgyro.getAccelerationZ());
         // close the file:
         dataFile.close();
 

#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include "I2Cdev.h"
#include "MPU9150.h"
#include <Adafruit_Sensor.h>

  }
  lastButtonState = buttonState;

  // LED is OFF if data is being recorded.
  // This is to avoid light from the LED influencing the light sensor.
  if (isOn == 1) {
    digitalWrite(LED, LOW);
    bool newData = false;
