 }
 
 // return width, height and frequency info for corresponding displayID
-struct DisplayInfo {
+struct DisplayInfo:Hashable & Comparable & Equatable {
     static let MAX_SCALE = 10
     var width, height, scale, frequency:Int
+    var modeID:Int32
+    var modeRef:CGDisplayMode
+    //var colorDepth, resolution:Int
 
     init(displayID:CGDirectDisplayID, mode:CGDisplayMode) {
         width = mode.width
         height = mode.height
-        scale = mode.pixelWidth / mode.width;
+        scale = mode.pixelWidth / mode.width
+        modeID = mode.ioDisplayModeID
+        modeRef = mode
+        //colorDepth = Int( mode.BitsPerSample )
+        //resolution = Int( mode[kCGDisplayResolution] )
         
         frequency = Int( mode.refreshRate )
         if frequency == 0 {

    }
    
    func printForOneDisplay(_ leadingString:String) {
        print(_format(displayInfo[modeIndex], leadingString:leadingString, trailingString:""))
    }
    
    func printFormatForAllModes() {
        var i = 0
        displayInfo.forEach { di in
            let bool = i == modeIndex
            print(_format(di, leadingString: bool ? "\u{001B}[0;33m⮕" : " ", trailingString: bool ? "\u{001B}[0;49m" : ""))
            i += 1
        }
    }
    
    private func _set(_ mi:Int) {
        let mode:CGDisplayMode = modes[mi]

        print("Setting display mode")


        }
    }

    // override a lesser-used operator to simplify display mode checks
    static func == (lhs: Self, rhs: DisplayInfo) -> Bool {
        return rhs == lhs
    }
}

