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

        point.speed = location?.speed ?? -Double.infinity
        point.time = location?.timestamp ?? NSDate()
        
        point.accFrontal = 0
        point.accLateral = 0
    }
}


        manager.desiredAccuracy = kCLLocationAccuracyBest
        manager.delegate = self
        manager.requestAlwaysAuthorization()
        return manager
    }()
    
    lazy var motionManager: CMMotionManager! = {
        let manager = CMMotionManager()
        
        
        return manager
    }()
    
