 
 
     // strip path and leave filename
-    var binary_name = Process.arguments[0].substringFromLastOcurrenceOf("/")
+    let binary_name = Process.arguments[0].substringFromLastOcurrenceOf("/")
 
     // help message
-    var help_msg = "".join([
+    let help_msg = "".join([
                 "usage: ",
                 "\(binary_name) ",
                 "[-h|--help] [-l|--list] [-m|--mode displayIndex] \n",

        
    }
        
    println(help_msg)
}

func setDisplayMode(var display:CGDirectDisplayID, var mode:CGDisplayMode, var designatedWidth:UInt) -> Void {
    if CGDisplayModeIsUsableForDesktopGUI(mode) {
    
        var config = UnsafeMutablePointer<CGDisplayConfigRef>.alloc(1);
    
        var error = CGBeginDisplayConfiguration(config)
        if error == MyCGError.kCGErrorSuccess.rawValue {
            if nil != config {
                var option:CGConfigureOption = CGConfigureOption(kCGConfigurePermanently)
                CGConfigureDisplayWithDisplayMode(config.memory, display, mode, nil)
                var afterCheck = CGCompleteDisplayConfiguration(config.memory, option)
                if afterCheck != MyCGError.kCGErrorSuccess.rawValue {
                    CGCancelDisplayConfiguration(config.memory)
                }
            } else {
                println("Setting display mode failed")
            }
        }
    } else {
        println("This mode is unavailable for current desktop GUI")
    }
}

// list mode by display id
func listModesByDisplayID(var _displayID:CGDirectDisplayID?) -> [CGDisplayMode]? {
    if let displayID = _displayID {
        if let modeList = CGDisplayCopyAllDisplayModes(displayID, nil) {
            var modes = modeList.takeRetainedValue()

            var modesArray = [CGDisplayMode]()

            var count = CFArrayGetCount(modes)
            for i in 0..<count {
                var modeRaw = CFArrayGetValueAtIndex(modes, i)
                // https://github.com/FUKUZAWA-Tadashi/FHCCommander
                var mode = unsafeBitCast(modeRaw, CGDisplayMode.self)

                var di = displayInfo(displayID, mode)

                modesArray.append(mode)
            }

    return nil
}

func displayModes(let _display:CGDirectDisplayID?, let index:Int, let _modes:[CGDisplayMode]?) -> Void {
    if let display = _display {
        if let modes = _modes {
            print("Supported Modes for Display \(index):")
            
            let nf = NSNumberFormatter()
            nf.paddingPosition = NSNumberFormatterPadPosition.BeforePrefix
