         point.speed = location?.speed ?? -Double.infinity
         point.time = location?.timestamp ?? NSDate()
         
-        point.accFrontal = 0
-        point.accLateral = 0
+        // if the iphone is facing the Z direction pointing upwards along the Y, in portrait mode
+        var accFrontal = motionManager.accelerometerData?.acceleration.z ?? -Double.infinity
+        var accLateral = motionManager.accelerometerData?.acceleration.x ?? -Double.infinity
+        
+        point.accFrontal = accFrontal
+        point.accLateral = accLateral
     }
 }
 

    func stopRide() {
        locationManager.stopUpdatingLocation()
        locationManager.stopUpdatingHeading()
        
        currentRide?.endDate = NSDate()
        

        
        currentRide?.startDate = NSDate()
        
        motionManager.startAccelerometerUpdates()
        locationManager.startUpdatingHeading()
        locationManager.startUpdatingLocation()
    }
