         
         let mode = CGDisplayCopyDisplayMode(displayID)!
         self.modeID = mode.ioDisplayModeID
-
         
         var option:CFDictionary?
-        let subList = ( CGDisplayCopyAllDisplayModes(displayID, option) as! Array )
-            .filter { ($0 as CGDisplayMode).isUsableForDesktopGUI() }
+        let subList = CGDisplayCopyAllDisplayModes(displayID, option)
         
         option = [kCGDisplayShowDuplicateLowResolutionModes:kCFBooleanTrue] as CFDictionary
-        let modeList = ( CGDisplayCopyAllDisplayModes(displayID, option) as! Array )
-            .filter { ($0 as CGDisplayMode).isUsableForDesktopGUI() }
-                
-        self.modes = modeList.filter { !subList.contains($0) }
+        // modes:[CGDisplayMode]
+        let modes = (CGDisplayCopyAllDisplayModes(displayID, option) as! [CGDisplayMode])
+            .filter {
+                !(subList as! Array).contains($0) &&
+                $0.isUsableForDesktopGUI()
+            }
 
         // Array.unique is requires converting to DisplayInfo first
         self.displayInfo = Array(Set(

import IOKit

class DisplayManager {
    let displayID:CGDirectDisplayID, displayInfo:[DisplayInfo], modes:[CGDisplayMode]
    let modeID:Int32

    init(_ displayID:CGDirectDisplayID) {

    
    private func _set(_ di:DisplayInfo) {
        let mode:CGDisplayMode = di.modeRef
        print(mode.width, mode.pixelWidth, di.scale, di.width, mode)

        print("Setting display mode")

