Password Library and Creating a Variable Integer

Hi! So messed around with the enum code, but I couldn't get it to work. I keep getting "'mode' was not declared in this scope". I'm also pretty sure that the reason my password code isn't working is because the sketch isn't storing the inputs.

Here's my enum trial code.

#include <Password.h>
#include <LiquidCrystal.h>
#include <Keypad.h>
int pressCnt = 0;


Password password = Password( "1234" );

const byte ROWS = 4;
const byte COLS = 4;

enum MODES
{
  MAINMENUMODE,
  SECURITYMODE,
  COOPMODES
};

char keys[ROWS][COLS] = {
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
  {'*', '0', '#'}
};
byte rowPins[ROWS] = {3, 5, 6, 7};
byte colPins[COLS] = {8, 9, 10};

Keypad myKeypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

LiquidCrystal lcd(A0, A1, A2, A3, A4, A5);

void setup() {
  lcd.begin(16, 2);
  MainMenu();
  Serial.begin(9600);
}

void loop() {
  char myKey = myKeypad.getKey();

  if (myKey == '#') {
    mode = SECURITYMODE;
    password.reset();
    pressCnt = 0;
    SecurityScreen();
  }

  if (mode == SECURITYMODE && myKey == '*'){
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("  Invalid Key  ");
    delay (2000);
    SecurityScreen();
  }
  else if (mode == MAINMENUMODE && myKey == '*')
  {
    MainMenu(); //Replace with coop Door function down the line
  }

  if (mode == SECURITYMODE) {
    if (myKey >= '0' && myKey <= '9') {
      lcd.setCursor(pressCnt, 1);
      lcd.print('*');
      pressCnt++;
    }
  }
  if (pressCnt == 4) {
    password.append(myKey);
    checkPassword();
  }
}

void checkPassword() {
  if (password.evaluate()) {
    Serial.println("Success");

  } else {
    Serial.println("Wrong");
    password.reset();
  }
}

void SecurityScreen() {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(" Enter Password");
}

void MainMenu() {
  lcd.setCursor(0, 0);
  lcd.print("* for Coop");
  lcd.setCursor(0, 1);
  lcd.print("# for Security");
}

I think I should also post the example code from the password library. The code uses a void function to store the password as eKey (at least I think it does). I think I need to include an addEventListener to my code. I tried including it inside my if (securityMode ==true) function, but that didn't work. I also tried putting my if (securityMode ==true) code into the example under the void keypadEvent thing, but nothing seems to work!

//* is to validate password   
//# is to reset password attempt

#include <Password.h> //http://www.arduino.cc/playground/uploads/Code/Password.zip
#include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip

Password password = Password( "1234" );

const byte ROWS = 4; // Four rows
const byte COLS = 4; //  columns
// Define the Keymap
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = { 9,8,7,6 };// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte colPins[COLS] = { 5,4,3,2, };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.


// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){

  Serial.begin(9600);
  keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}

void loop(){
  keypad.getKey();
}

//take care of some special events
void keypadEvent(KeypadEvent eKey){
  switch (keypad.getState()){
    case PRESSED:
	Serial.print("Pressed: ");
	Serial.println(eKey);
	switch (eKey){
	  case '*': checkPassword(); break;
	  case '#': password.reset(); break;
	  default: password.append(eKey);
     }
  }
}

void checkPassword(){
  if (password.evaluate()){
    Serial.println("Success");
    //Add code to run if it works
  }else{
    Serial.println("Wrong");
    //add code to run if it did not work
  }
}

Thanks for all the help!