             log("Activity Manager is not Available");
         }
     }
-    
-//    func activityTypeToString(activityType:NSString) -> NSString {
-//        var type = "UNKNOWN";
-//        
-//        switch(activityType) {
-//            case data.stationary
-//        }
-//    }
-    
-    
-//    
-//    func sendActivityCallback(activityData : NSObject) {
-//        var activityArray : NSArray;
-//        
-//        if(activityCommandDelegate != nil) {
-//            let activityObj:Dictionary = [
-//                "activityType" : activityData.
-//            ]
-//        } else {
-//            log("Got activity update but do not have a command delegate to send it to")
-//        }
-//    }
-//    
     
     func confidenceToInt(confidence : CMMotionActivityConfidence) -> Int {
         var confidenceMult = 0;

            manager!.startActivityUpdatesToQueue(NSOperationQueue()) { data in
                if let data = data {
                    dispatch_async(dispatch_get_main_queue(), {
                        NSLog("----------------------------------------------------We received an activity update %@", data);
                        if(data.stationary == true) {
                            self.isStationary = true;
                        } else {
                            self.isStationary = false
                        }
                        
                        self.sendActivitiesToCallback(self.activitiesToArray(data));


        self.startUpdating(true);
    }
    
    func setGPSLowPower() {
        log("Setting GPS To Low Power Mode ");
        self.lowPowerMode = true;
        self.startUpdating(true);
    }

    func syncAfterXSeconds() {
        self.setGPSLowPower();
        self.sync();
        log("Stopped Location Updates After \(syncSeconds)");
    }
