I need help with a little code entry pad.

ok, this is what ive got at the moment:

// Project Awesome. Code Entry With Four Buttons
int y = 0; // Set y
int x = 0; // Set x
int ledOne = 13; //Set Red LED
int ledTwo = 12; //Set Green LED
byte buttons[] = {2,3,4,5,6,7,8,9,10}; //Set buttons to array
byte pass[] = {2,3}; // Set password
byte attempt[2]; // Set attempts array
byte state[9]; // Make states array
byte oldstate[9]; // When button is hit, info added here
int time = 0;

void setup(){
  pinMode(ledOne, OUTPUT);
  pinMode(ledTwo, OUTPUT);
  for(x=0; x<9; x++){
    pinMode(buttons[x], INPUT);
  }
  digitalWrite(ledOne, HIGH);
    for(x=0; x<9; x++){
    state[x] = digitalRead(buttons[x]); // Check states of each button
  }
  for(x=0; x<9; x++){
    oldstate[x] = state[x];//Send all data to different array
  }
}


void loop(){
  for(x=0; x<9; x++){
    state[x] = digitalRead(buttons[x]); // Check states of each button
  }
  for(x=0; x<9; x++){
    if(oldstate[x] != state[x]){ //If these new states are different then the old ones
      if(state[x] == HIGH)
      {
        attempt[x] = buttons[x]; //Set attempt (Just first index for now) to buttons pressed
        time = millis();
      }
    }
  }
  for(x=0; x<2; x++){
    if(attempt[0] == pass[0]){
      Correct();
    }
  }
  if ((millis() - time) > 5000){
    for(x=0;x<1;x++){
      attempt[x] = 0;
    }
  }
  if(attempt[0] != pass[0]){
    TimeOut();
  }
  for(x=0;x<9;x++){
    oldstate[x] = state[x];
  }
}

void Correct(){
  digitalWrite(ledOne, LOW);
  digitalWrite(ledTwo, HIGH);
}

void TimeOut(){
  digitalWrite(ledTwo, LOW);
  digitalWrite(ledOne, HIGH);
}