         }
     }
 
-    @objc func aWindowBecameMain(theNotification: NSNotification)
+    @objc func aWindowBecameMain(_ theNotification: NSNotification)
     {
 		if let window: NSWindow = theNotification.object as? NSWindow
         {
-			if let enigmaController = findEnigmaControllerForWindow(window)
+            if let enigmaController = findEnigmaControllerForWindow(aWindow: window)
             {
 				currentEnigma = enigmaController
             }


    @IBAction func showAbstractEnigma(sender: AnyObject)
    {
        var controller = AbstractEnigmaController()
        abstractEnigmas.append(controller)
        controller.showWindow(sender)
        // TODO: A mechanism to get rid of the controller when we are done


    func applicationDidFinishLaunching(aNotification: NSNotification)
    {
        NotificationCenter.default.addObserver(self,
                                           selector: #selector(AppDelegate.aWindowBecameMain(_:)),
                                               name: NSWindow.didBecomeMainNotification,
                                             object: nil)
    }

    func applicationWillTerminate(aNotification: NSNotification)
