         flashService = NVFlashService()
         
         // Optional: receive callbacks when flashes come into range or are connected/disconnected
-        flashService!.delegate = self
+        flashService.delegate = self
         
         // Auto connect to closest flash
-        flashService!.autoConnect = true
+        flashService.autoConnect = true
         
         // Uncomment to auto connect to more than one flash
-        // flashService!.autoConnectMaxFlashes = 4
+        // flashService.autoConnectMaxFlashes = 4
         
         // Set a timer to toggle flash every second.
         timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self,

    func applicationDidBecomeActive(application: UIApplication) {
        NSLog("enable")

        flashService!.enable()
    }
    
    // When app is not active, shut down bluetooth to conserve battery life
    func applicationWillResignActive(application: UIApplication) {
        NSLog("disable")

        flashService!.disable()
    }

    // Called every second by timer

        
        // loop through all connected flashes
        // typically just 1, but change autoConnectMaxFlashes above for more
        for flash in flashService.connectedFlashes as [NVFlash] {
            
            // toggle flash
            if (!flash.lit) {
