Puzzle box coding

I'm trying to create a reverse geocache box to give to a friend before the end of the month before she leaves the state. Most of the code is basically modified from this instructables https://www.instructables.com/id/3D-Printed-Electronic-Puzzle-Box/ I wanted the box to be able to tell if it's been at the location even after power has been removed, so I wanted it to keep track through eprom. I thought I edited the code to work with only one switch and one servo, as I don't need multiple locations, and switches. The reason I wanted the box to remember if it's been at the location, that way she has use of it after it's been to the location, kinda like a lock box. I can do electronics, but never was much of a code person, I can usually edit basic code, but this is by far the most I've tried editing and modifying. Any help, I'm getting multiple was not declared in this scope errors. I'm also sure probably not the only errors, that's just what I've gotten so far. Please, I'm trying to do this in a time crunch before my friend moves out of state.

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal_PCF8574.h>
#include <Keypad.h>
#include <Servo.h>
#include <EEPROM.h>

// Codes
int codeCounter = 0;
char code1[7] = "333333";
char initCode[7] = "000000";
char masterCode[7] = "999999";
char codeEntered[7] = "";

// Locations
static const double LOCATION_1_LAT = 39.710897, LOCATION_1_LON = -82.591948; // Grand Canyon

static const double margin = 0.1; // distance of margin of error in miles

// Servos
Servo servo1;

static const int ServoPin1 = 10;

// LCD
LiquidCrystal_PCF8574 lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display


// Keypad
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {0, 1, 2, 3}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {4, 5, 6, 7}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

// Key switches
static const int KeyPin1 = 15;

// GPS
static const int RXPin = 9, TXPin = 8;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

// The state of door
boolean door1IsOpen = false;
boolean door1IsOpenNow = false;
int door1Open = 180, door1Close = 0;

void setup()
{
  lcd.setBacklight(255);
  lcd.begin(16, 2);

  // Init previous states
  door1IsOpen = (boolean)(EEPROM.read(0));
  door1IsOpenNow = (boolean)(EEPROM.read(1));
  startupDoors();

  // Key switches
  pinMode(KeyPin1, INPUT_PULLUP); // key switch 1

  // Init Readout
  initScreen();
}


void loop()
{
  char key = keypad.getKey();

  if (key != NO_KEY) {
    lcd.print(key);

    // Store the new key in the current entry string
    codeEntered[codeCounter] = key;
    codeCounter++;

    // If we are at 6 characters, see if it is a match
    if (codeCounter == 6)
    {
      int match = keyIsMatch();

      if (match > 0)
      {
        else if (match == 3)// last code/location
        {
          if (door1IsOpenNow)
          {
            closeDoor(match);
          }
          else if (door1IsOpen && !door1IsOpenNow)
          {
            openDoor(match);
          }
          else if (digitalRead(KeyPin1) == LOW)

            // Both keys needs to be turned, both doors open, and in the right location
            openDoor(match);
        }
      }
      else
      {
        lcd.clear();
        lcd.print("Cheater!");

        delay(2000);

        lcd.clear();
        lcd.print("Open hhh");
        lcd.setCursor(0, 1);
        lcd.print("door first");

        delay(2000);
      }
    }
    else
    {
      lcd.clear();
      lcd.print("Keys needed");
    }
  }
  else if (match == 4)
  {
    // lock box
    initBox();
  }
  else if (match == 5)
  {
    // unlock box
    masterUnlock();
  }
}
else
{
  lcd.clear();
  lcd.print("Invalid code");
}

delay(3000);
initScreen();

codeCounter = 0;
}

}

void startupDoors()
{
  lcd.clear();
  lcd.print("Starting...");

  servo1.attach(ServoPin1);
  if (door1IsOpen)
    servo1.write(door1Open);
  else
    servo1.write(door1Close);

  delay(500);
  servo1.detach();
  delay(500);
}

void initBox()
{
  // Set the starting servo positions
  lcd.clear();
  lcd.print("Initialize");

  servo1.attach(ServoPin1);
  servo1.write(door1Close);
  delay(500);
  servo1.detach();

  door1IsOpen = false;
  door1IsOpenNow = false;
  EEPROM.write(0, door1IsOpen);
  EEPROM.write(1, door1IsOpenNow);

  lcd.clear();
}

void masterUnlock()
{
  // Open all doors
  lcd.clear();
  lcd.print("Master Unlock");

  servo1.attach(ServoPin1);
  servo1.write(door1Open);
  delay(500);
  servo1.detach();


  door1IsOpen = true;
  door1IsOpenNow = true;
  EEPROM.write(0, door1IsOpen);
  EEPROM.write(1, door1IsOpenNow);

  lcd.clear();
}

int keyIsMatch()
{
  if (strcmp(codeEntered, code1) == 0)
    return 1;
  if (strcmp(codeEntered, initCode) == 0)
    return 2;
  if (strcmp(codeEntered, masterCode) == 0)
    return 3;

  return 0;
}

bool checkLocation(int locationNum)
{
  // Check the location against the desired number.
  double latitude, longitude;

  if (locationNum == 1)
  {
    latitude = LOCATION_1_LAT;
    longitude = LOCATION_1_LON;
  }
  bool foundLocation = false;
  int timeToCheck = 60;

  ss.begin(GPSBaud);

  // Get the current location
  // Dispatch incoming characters
  do
  {
    if (gps.location.isValid())
    {
      foundLocation = true;

      double distanceToLocation =
        TinyGPSPlus::distanceBetween(
          gps.location.lat(),
          gps.location.lng(),
          latitude,
          longitude);
      distanceToLocation = (distanceToLocation / 1000) * 0.6; // Convert to miles

      lcd.clear();
      if (distanceToLocation < margin)
      {
        lcd.print("Congrats!");
        delay(2000);

        ss.end();
        return true;
      }
      else
      {
        lcd.print(distanceToLocation);
        lcd.print("mi");
        lcd.setCursor(0, 1);
        lcd.print("from destination");
        timeToCheck -= 3; // Speed up
      }
    }

    if (gps.charsProcessed() < 10)
    {
      lcd.clear();
      lcd.print("Checking");
      lcd.setCursor(0, 1);
      lcd.print("Location...");
    }

    timeToCheck--;
    smartDelay(1000);
  }
  while (timeToCheck > 0);

  lcd.clear();

  if (!foundLocation)
  {
    lcd.print("No Signal");
    lcd.setCursor(0, 1);
    lcd.print("Go Outside!");
  }
  else
  {
    lcd.print("Resetting...");
  }

  ss.end();
  return false;
}
lcd.clear();
lcd.print("Door ");
lcd.print(doorNum);
lcd.print(" opened");
}

void closeDoor(int doorNum)
{
  // Open the servo for the matching door

  if (doorNum == 1)
  {
    servo1.attach(ServoPin1);
    servo1.write(door1Close);
    delay(500);
    servo1.detach();

    door1IsOpenNow = false;
    EEPROM.write(3, door1IsOpenNow);
  }

  lcd.clear();
  lcd.print("Door ");
  lcd.print(doorNum);
  lcd.print(" closed");
}

void initScreen()
{
  lcd.clear();
  lcd.print("Enter Code");
  lcd.setCursor(0, 1);
}

Please post the full error messages that you get

I got exit status 1 'startupDoors' was not declared in this scope, and when I disabled startupDoors I got exit status 1 'initScreen' was not declared in this scope.

Check carefully where the closing } for the loop() function is

It helps if each { and } is on its own line and if you Auto format the code in the IDE