             Serial.print("\tCount: ");
             Serial.println(count);
 
-/*
+
             // display real acceleration, adjusted to remove gravity
             mpu.dmpGetQuaternion(&q, fifoBuffer);
             mpu.dmpGetAccel(&aa, fifoBuffer);
             mpu.dmpGetGravity(&gravity, &q);
             mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
-            Serial.print("areal\t");
-            Serial.print(aaReal.x);
-            Serial.print("\t");
-            Serial.print(aaReal.y);
-            Serial.print("\t");
-            Serial.print(aaReal.z);
-            Serial.print("\t");
-
-            Serial.print("Count: ");
-            Serial.println(count);
+//            Serial.print("areal\t");
+//            Serial.print(aaReal.x);
+//            Serial.print("\t");
+//            Serial.print(aaReal.y);
+//            Serial.print("\t");
+//            Serial.print(aaReal.z);
+//            Serial.print("\t");
   
         // Set acceleration values here
-        dx = aaReal.x - tempx;
-        dy = ay - tempy;
-        dz = az - tempz;
+        accelX = aaReal.x;
+        accelY = aaReal.y;
+        accelZ = aaReal.z;
+        dx = abs(accelX) - abs(tempx);
+        dy = abs(accelY) - abs(tempy);
+        dz = abs(accelZ) - abs(tempz);
+        
         dx = (dx/10);               
         int modx = dx%10;
         dx = dx-modx;

          digitalWrite(level, LOW); 
          setRef = true;       
        } else {
          //Test to see if moving here
          
          if(abs(abs(xDeg)-abs(refX)) < 8 && abs(abs(zDeg)-abs(refZ)) < 8) {
            digitalWrite(tilted, LOW);
            digitalWrite(moving, LOW);
            digitalWrite(level, HIGH);

        int modz = dz%10;
        dz = dz-modz;
    
        tempx = accelX;
        tempy = accelY;
        tempz = accelZ;
           
        if(count < calibrateCount) {
          count++;
          if(count%100 < 50) {
