         config.setBool(sender.on, forKey: "showPassword")
     }
     
+    /// Store password and notify main view when done is pressed
     @IBAction func handleDonePressed(sender: AnyObject) {
         config.setObject(passwordField.text, forKey: "password")
         
         self.passwordField.resignFirstResponder()
         self.dismissViewControllerAnimated(true, completion: nil)
         
-        println("modal closed: \(passwordField.text)")
-        
         nc.postNotificationName("settingsUpdated", object: config)
-        
     }
     
+    
+    /// Post notification to main view when cancel is pressed
     @IBAction func handleCancelPressed(sender: AnyObject) {
         self.dismissViewControllerAnimated(true, completion: nil)
-        println("modal closed")
+        self.passwordField.resignFirstResponder()
         
+        nc.postNotificationName("settingsNotUpdated", object: config)
     }
     
-    func modalClosed() -> Void {
-    }
-
     
     /// Iterating over the sections in the table view to update the 
     /// appearance by changing font and case to make it look more like the

        return text
    }
    
    func textFieldShouldReturn(textField: UITextField) -> Bool {
        textField.resignFirstResponder()
        return true

        return border
    }
    
    
    /// Helper function to draw the tableview cells the way I want.
    func getLabel() -> UILabel {
        let text = UILabel(
            frame: CGRectMake(18, -4 ,
