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

        manager.desiredAccuracy = kCLLocationAccuracyBest
        manager.delegate = self
        manager.requestAlwaysAuthorization()
        return manager
    }()
    

        point.speed = location?.speed ?? -Double.infinity
        point.time = location?.timestamp ?? NSDate()
        
        // 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
    }
}

