         }
     }
 
-    /// Open a MIDI Input port by name
+    /// Close a MIDI Input port by name
     ///
     /// - Parameter name: Name of port to close.
     ///

    ///
    public func closeOutput(uid outputUid: MIDIUniqueID) {
        let name = destinationName(for: outputUid)
        AKLog("Closing MIDI Input '\(String(describing: inputName))'")
        var result = noErr
        if let endpoint = endpoints[outputUid] {
            result = MIDIPortDisconnectSource(outputPort, endpoint)
            if result == noErr {
                endpoints.removeValue(forKey: outputUid)

                result = MIDIPortDispose(outputPort)
                if result == noErr {
                    AKLog("Disposed \(name)")
                } else {
                    AKLog("Error displosing  MIDI port: \(result)")
                }
                outputPort = 0
                AKLog("Disconnected \(name) and removed it from endpoints and output ports")
            } else {
                AKLog("Error disconnecting MIDI port: \(result)")
            }
        }
    }


        guard let tempPort = MIDIOutputPort(client: client, name: outputPortName) else {
            AKLog("Unable to create MIDIOutputPort")
            return
        }

        outputPort = tempPort
