I need help with States and buttons in my code

Hi!
if i got the target you're trying to reach...
You want to switch among five choices, using a button.
I wrote down the following sketch, providing a second pushbutton (startButton), whose aim is to start the acquisition time for data from the other switch (commandButton).
In this way you tell arduino "pay attention i'm sending you the number of the program i want you to run, and i will tell you that number, by the number of clicks i will perform on the commandButton."

here is the sketch:

int startButton=12;
int commandButton=11;
int i=0;
int count;
int program;
int state=0;
int state2=0;
int prevState=0;
int prevState2=0;

long prevDebTime;
long prevDebTime2;
long debDelay=200;

void setup(){
  Serial.begin(9600);
  pinMode(startButton,INPUT);
  digitalWrite(startButton,HIGH);
  pinMode(commandButton, INPUT);
  digitalWrite(commandButton,HIGH);
}

void loop(){
  state=!digitalRead(startButton);
  if((millis()-prevDebTime)>debDelay){
   if (state!=prevState && state==HIGH) {
     if(i==0){
    i=1;
    prevDebTime=millis();
  }
  else if(i==1){
    i=0;
    Serial.println("Program number: ");
    Serial.println(count);
    program=count;
    switch(program){
       case 1:
       //insert program 1 commands
       break;
  
       case 2:
       //insert program 2 commands
       break;
       
       //and so on....
    } 
    count=0;
    prevDebTime=millis();
}
   }

}
if(i==1){
  state2=!digitalRead(commandButton);
  if((millis()-prevDebTime2)>debDelay){
    if(state2!=prevState2 && state2==HIGH){
      count++;
      prevDebTime2=millis();
    }
  }
}
}

you have to fill the switch function with the actions your led matrix is expected to show.
the pushbuttons are already debuonced.

hope this could help you!
And I apologize for my English!...