     func handleActivity(activity:CMMotionActivity?)->Void{
         // unwrap the activity and disp
         if let unwrappedActivity = activity {
-            //DispatchQueue.main.async(){}
-            NSLog("Walking: \(unwrappedActivity.walking)\n Still: \(unwrappedActivity.stationary)")
+            //DispatchQueue.main.async(){} // for UI update, just use main queue
+            print("Walking: \(unwrappedActivity.walking)\n Still: \(unwrappedActivity.stationary)")
         }
     }
     

    let pedometer = CMPedometer()
    let motion = CMMotionManager()
    var totalSteps: Float = 0.0
    
    let numberToolbar: UIToolbar = UIToolbar()
    
    override func viewDidLoad() {

    func startActivityMonitoring(){
        // is activity is available
        if CMMotionActivityManager.isActivityAvailable(){
            // update from this queue
            self.activityManager.startActivityUpdates(to: motionQueue, withHandler: self.handleActivity)
        }
        
    }
