Modifying this code

I am looking to use this code…

/** Imports **/

#include <Keypad.h>

/** Keypad **/

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

char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {32,34,36,38};
byte colPins[COLS] = {33,35,37,39};

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

/** Pins **/

int ledPinRed = 50;
int ledPinGreen = 52;
int ledPinBlue = 52;
int lock = 22;

/** Variables **/

String passcode = "147A";
String debugMode = "ADBC";

String currentCode = "";
String tempCode = "";

String debug = "N";
String auth = "N";

int currentCodeCount = 0;
int tempInt = 0;



void setup() 
{
  pinMode(ledPinRed, OUTPUT);
  pinMode(ledPinGreen, OUTPUT);
  pinMode(ledPinBlue, OUTPUT);
  pinMode(lock, OUTPUT);
  
  Serial.begin(9600);
}

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

  if(key != NO_KEY)
  {
    if(key == '*' && debug == "N")
    {
      flashGreenBlue(1000);
      codeReset();
      
      Serial.println("Cleared!");
    }
    else
    {
        currentCode = currentCode + key;
        currentCodeCount += 1;
        flashBlue(100);
      
        Serial.println(currentCode);
    }
    
    if(debug == "N")
    {
      if(currentCode == passcode)
      {
        doorOpen();
        codeReset();
      }
      else if(currentCode == debugMode)
      {
        analogWrite(ledPinRed, 127);
        digitalWrite(ledPinGreen, HIGH);
        codeReset();
        debug = "Y";
      }
      else if(currentCodeCount == 4)
      {
        flashRed(4000);
        Serial.println("Access Denied");
        codeReset();
      }
    }
    else
    {
      if(auth == "N")
      {
        if(currentCode == passcode)
        {
          digitalWrite(ledPinRed, LOW);
          flashGreen(1000);
          auth = "Y";
          codeReset();
        }
        else if(currentCodeCount == 4)
        {
          digitalWrite(ledPinGreen, LOW);
          flashRed(1000);
          auth = "N";
          debug = "N"; 
          codeReset();
        }
      }
      else
      {
        if(key == '*')
        {
          digitalWrite(ledPinBlue, HIGH);
          
          while(tempInt < 4)
          {
            char key = kpd.getKey();
  
            if(key != NO_KEY)
            {
              tempCode = tempCode + key;
              tempInt += 1;
              flashBlue(100);
            }
          }
          
          digitalWrite(ledPinBlue, LOW);
        
          flashGreen(100);
          delay(100);
          flashGreen(100);
        
          setPasscode();
        }
        else if(key == '1')
        {
          digitalWrite(ledPinGreen, HIGH);
          digitalWrite(lock, HIGH);
        }
        else if(key == '2')
        {
          digitalWrite(lock, LOW);
          digitalWrite(ledPinGreen, LOW);
        }
        else if(key == '#')
        {
          codeReset();
          flashRed(500);
          auth = "N";
          debug = "N";
        }
      }
    }
  }
}

/** Keypad Controls **/

void codeReset()
{
  currentCode = "";
  currentCodeCount = 0;
}

void setPasscode()
{
  passcode = tempCode;
  tempCode = "";
  tempInt = 0;
}

/** Motor Controls **/

void doorOpen()
{
  digitalWrite(ledPinGreen, HIGH);
  digitalWrite(lock, HIGH);
  Serial.println("Open");
  delay(6500);
  digitalWrite(ledPinGreen, LOW);
  digitalWrite(lock, LOW);
  Serial.println("Locked");
}
 
/** LED Control **/ 

void flashRed(int delayCount)
{
  digitalWrite(ledPinRed, HIGH);
  delay(delayCount);
  digitalWrite(ledPinRed, LOW);
}

void flashGreen(int delayCount)
{
  digitalWrite(ledPinGreen, HIGH);
  delay(delayCount);
  digitalWrite(ledPinGreen, LOW);
}

void flashBlue(int delayCount)
{
  digitalWrite(ledPinBlue, HIGH);
  delay(delayCount);
  digitalWrite(ledPinBlue, LOW);
}

void flashGreenBlue(int delayCount)
{
  digitalWrite(ledPinGreen, HIGH);
  digitalWrite(ledPinBlue, HIGH);
  delay(delayCount);
  digitalWrite(ledPinGreen, LOW);
  digitalWrite(ledPinBlue, LOW);
}

but i want to have (2) keypads.
how would i go about using multiple keypads. i have the mega so i have the pins to use 7 more i just dont know how the code would know which keypad was talking.

Are the two keypads going to do the same thing in two locations or separate items?

keypad 1 will controll a door *opendoor() function like the code states now and the second keypad will run this function plus another. so i needto be able to control each keypad seperatly…

they will be located in seperate places attached to the same arduino one on inside of the door one on the outside

sorry its hard to explain

Check out http://arduino.cc/playground/Code/Keypad first item in FAQ secion.