   }
   
   
+  // turn off trace file output
   public func disableTraceFileSink() {
-  
+    
     traceFilesinkEnabled = false
     
   }
   
   
   
-  
+  // turn on trace file input instead of data from BTLE
+  // specify a filename to read from, and a speed that lines
+  // are read from the file in ms
   public func enableTraceFileSource(filename:NSString, speed:NSInteger=500) -> Bool {
-
+    
+    // only allow a reasonable range of values for speed, not too fast or slow
     if speed < 50 || speed > 1000 {return false}
     
+    // check for file sharing in the bundle
     if let fs : Bool? = NSBundle.mainBundle().infoDictionary?["UIFileSharingEnabled"] as? Bool {
       if fs == true {
         vmlog("file sharing ok!")

              }
            }
            

            
            
          } else if let data = json["data"] as? NSString {
            // CAN msg

            var bus : NSInteger = 0
            if let busX = json["bus"] as? NSInteger {
              bus = busX

          // bool test
          // TODO: maybe keep track of what type each rsp is?
          /*
           if value is NSNumber {
           let nv = value as! NSNumber
           if nv.isEqualToValue(NSNumber(bool: true)) {
           vmlog("it's a bool and it's true")
           } else if nv.isEqualToValue(NSNumber(bool:false)) {
           vmlog("it's a bool and it's true")
           } else {
           vmlog("it's a number")
           }
           } else {
           vmlog("it's a string")
           }
           */
          
          
          latestVehicleMeasurements.setValue(rsp, forKey:name as String)
