need help adding debounce to my code

is this enough for it to function the debounce?

int swiPin [] = {
  5,6,7,8};
boolean currentButtonVal[3];

void setup(){
  for(int x = 0; x<3; x++){
    currentButtonVal[x] = true;
  }
  Serial.begin(9600);
}




boolean debounce(int thisButton) {
  boolean current = digitalRead(swiPin[thisButton]);
  if (currentButtonVal[thisButton] != current) {
    delay(5);
    current = digitalRead(swiPin[thisButton]);
  }
  currentButtonVal[thisButton] = current;  // store new state for your pin
  return current;
}

void loop(){


  Serial.println(debounce(0));
  Serial.println(debounce(1));
  Serial.println(debounce(2));
  Serial.println(debounce(3));


}