 }
 
 private class Circle: UIView {
-    override func drawRect(rect: CGRect) {
-        let path = UIBezierPath(ovalInRect: rect)
-        UIColor.blueColor().setFill()
+    override func draw(_ rect: CGRect) {
+        let path = UIBezierPath(ovalIn: rect)
+        UIColor.blue.setFill()
         path.fill()
     }
 }

    public func isConnected() -> Bool {
        debugPrint("Remote Connection Status Asked")
        if let socket = socket {
            return socket.status == SocketIOClientStatus.Connected ? true : false
        } else {
            return false
        }

        }
    }
    
    fileprivate func requestSupport() {
        guard socket?.status == SocketIOClientStatus.connected else {
            debugPrint("Remote Connection Not Connected - Will not transmit request support")
            return
        }
        
        let message = ["vendorid" : "\(vendorId)"]
        
        DispatchQueue.global(qos: .default).async {
            self.socket?.emit("request support", message)
            
            // Dispatch after sending the last request
            // this will make sure that we dont accumilate too many
            // requests on a slow connection
            let q_background = DispatchQueue.global(qos: .background)
            let delayInSeconds:Int64 = 5
            let popTime = DispatchTime.now() + Double(delayInSeconds * 1000000000) / Double(NSEC_PER_SEC)
            
            q_background.asyncAfter(deadline: popTime) { () -> Void in
                self.requestSupport()
            }
        }
    }
    
    fileprivate func transmitScreen() {
        guard socket?.status == SocketIOClientStatus.connected else {
            debugPrint("Remote Connection Not Connected - Will not transmit screenshot")
            return
        }
        
        if let image = captureScreen() {
            let smallerImage = UIImageJPEGRepresentation(image, 0.0)
            let base64String = smallerImage?.base64EncodedString(options: NSData.Base64EncodingOptions(rawValue: 0))
            
            if let base64String = base64String {
                let message = ["vendorid" : "\(vendorId)", "image" : base64String]
                
                DispatchQueue.global(qos: DispatchQoS.QoSClass.default).async {
                    self.socket?.emit("upload image", message)
                    
                    // Dispatch after sending the image
                    // this will make sure that we dont accumilate too many
                    // images on a slow connection
                    let q_queue = DispatchQueue.main
                    let delayInSeconds:Int64 = 1
                    let popTime = DispatchTime.now() + Double(delayInSeconds * 1000000000) / Double(NSEC_PER_SEC)
                    
                    q_queue.asyncAfter(deadline: popTime) { () -> Void in
                        self.transmitScreen()
                    }
                }
