     NSUserDefaults.standardUserDefaults().synchronize()
 }
 
-// removeUserSession
-//
-// Removes username and password from Keychain and sets session bool to False.
-// Called within Logout button.
+/**
+    removeUserSession
+
+    Removes username and password from Keychain by setting both to "default."
+    Sets session bool to False. Called within Logout button.
+*/
 func removeUserSession() -> Void {
     // Remove Keychain data:
     MyKeychainWrapper.mySetObject("default", forKey: kSecValueData)

    return !emailTest.evaluateWithObject(email)
}

// isInvalidUsername
//
// @param: username - String
// @return: True if username = empty, too long, or too short.
func isInvalidUsername(username: String) -> Bool {
    return (username.isEmpty ||
        username.characters.count > USERNAME_CHAR_MAX ||
        username.characters.count < USERNAME_CHAR_MIN)
}

// isInvalidPassword
//
// @param: password - String
// @return: True if password = empty, too long, or too short.
func isInvalidPassword(password: String) -> Bool {
    return (password.isEmpty ||
        password.characters.count > PASSWORD_CHAR_MAX ||

    NSUserDefaults.standardUserDefaults().synchronize()
}

/**
    getUsernameFromKeychain

    Gets username currently stored in the Keychain. If no user stored, gets
    the default username "default" as String.

    @return: username - String
*/
func getUsernameFromKeychain() -> String {
    return MyKeychainWrapper.myObjectForKey(kSecAttrAccount) as! String
}

/**
    getPasswordFromKeychain

    Gets password currently stored in the Keychain. If no user stored, gets
    the default password "default" as String.

    @return: password - String
*/
func getPasswordFromKeychain() -> String {
    return MyKeychainWrapper.myObjectForKey(kSecValueData) as! String
}
