     
     @IBAction func deleteEntry(sender: AnyObject) {
         
+        // A dictionary of attributes for our Keychain Item.
         let attrs : [NSObject : AnyObject] = [
             kSecClass: kSecClassGenericPassword,
             kSecAttrService : "Intertech",
             kSecAttrAccount : "Instructor"
         ]
         
+        // Delete any Keychain Item(s) that match our attributes above.
         SecItemDelete(attrs)
     }
     
     func retrievePassword() -> String? {
+        // A dictionary of attributes for our Keychain Item.
         let attrs : [NSObject:AnyObject] = [
             kSecClass : kSecClassGenericPassword,
             kSecAttrService : "Intertech",
             kSecAttrAccount : "Instructor",
+            // Add the kSecReturnData attribute, when expecting a secret to be returned.
             kSecReturnData : kCFBooleanTrue
         ]
+        
         var passwordData:AnyObject?
+        // Retrieve Keychain Item(s) with SecItemCopyMatching.
+        // The first parameter is the Dictionary of attributes (above),
+        // and the second parameter is a pointer to an object that should
+        // store the returned secret.
         SecItemCopyMatching(attrs, &passwordData)
+        // The returned secret is in an NSData format; convert to a String.
         let password = String(data: (passwordData as? NSData) ?? NSData(), encoding: NSUTF8StringEncoding)
         return password
     }

    
    @IBAction func textFieldSave(sender: AnyObject) {

        let passwordData: NSData = passwordField.text!.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
        
        let attrs : [NSObject : AnyObject] = [
            kSecClass: kSecClassGenericPassword,
            kSecAttrService : "Intertech",
            kSecAttrAccount : "Instructor",
            kSecValueData : passwordData
        ]
        
        SecItemDelete(attrs)
        let resultCode = SecItemAdd(attrs as CFDictionaryRef, nil)
        if resultCode != errSecSuccess {
            print("Unable to Add Password to Keychain.  Error Code: \(resultCode)")
        }

//  Generic Password CRUD (Retrieve single "secret")

import UIKit
// The SecItem API requires the Security framework
// (don't forget to add this in the Target -> General -> Linked Frameworks & Libraries)
import Security

class KeychainPasswordViewController: UIViewController {

    @IBOutlet weak var passwordField: UITextField!
    @IBOutlet weak var keychainField: UITextField!
    
    @IBAction func textFieldLoad(sender: AnyObject) {
        if let password = retrievePassword() {
            keychainField.text = password;
