     
     override func viewDidLoad() {
         super.viewDidLoad()
-
+        let defaults = UserDefaults.standard
         
+        defaults.addObserver(self, forKeyPath: "JaredIsDisabled", options: .new, context: nil)
+        updateTouchBarButton()
+        
+        YoutubeSecret.stringValue = defaults.string(forKey: "YoutubeSecret") ?? "None"
+        TwitterKey.stringValue = defaults.string(forKey: "TwitterKey") ?? "None"
+        TwitterSecret.stringValue = defaults.string(forKey: "TwitterSecret") ?? "None"
+    }
+    
+    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+        if keyPath == "JaredIsDisabled" {
+            updateTouchBarButton()
+        }
+    }
+    deinit {
+        UserDefaults.standard.removeObserver(self, forKeyPath: "JaredIsDisabled")
+    }
+    
+    override func viewDidAppear() {
+        super.viewDidAppear()
+        self.view.window!.title = "Preferences"
+    }
+    
+    func updateTouchBarButton() {
         let defaults = UserDefaults.standard
         if (defaults.bool(forKey: "JaredIsDisabled")) {
             EnableDisableButton.title = "Disable"

        
        if (defaults.bool(forKey: "JaredIsDisabled")) {
            defaults.set(false, forKey: "JaredIsDisabled")
            EnableDisableButton.title = "Enable"
        }
        else {
            defaults.set(true, forKey: "JaredIsDisabled")
            EnableDisableButton.title = "Disable"
        }
        
        print("hello world")
    }
    @IBAction func setButtonPressed(_ sender: AnyObject) {
        defaults.setValue(YoutubeSecret.stringValue, forKey: "YoutubeSecret")

        else {
            EnableDisableButton.title = "Enable"
        }
    }
    
    @IBOutlet weak var EnableDisableButton: NSButtonCell!
