Chaser Circuit w/ Alternate Modes

Hey, I'm somewhat new to Arduino so bear with me...

I have an LED chaser circuit that utilizes buttons to change specific aspects of it. One button changes the chaser between going from one side to the other to bouncing between the two sides, while the other two change the speed at which the circuit flashes.

The buttons are connected to the 5V output of the board and use that to input into pins, which allows it to detect if they are pressed. The LEDs are each their own circuit.

Currently, both delay buttons work, but not the mode switcher. Can anyone help me on this?

I like to use funny variables in my code, but basically updowns are the status of each button, hammertime is the delay, and shinything is just the LEDs.

int updown1;
int updown2;
int updown3;
int hammertime = 500;
int shinything[] = {2,3,4,5,6};
int x;
int mode;
void setup(){
  for (int i=0; i<5; i=i+1){
    pinMode(shinything[i], OUTPUT);
  }
  pinMode(8,INPUT);
  pinMode(9,INPUT);
  pinMode(10,INPUT);
}

void loop(){
  updown1=digitalRead(8);
  updown2=digitalRead(9);
  updown3=digitalRead(10);
  if(updown1 == 1){
    if(mode == 1){
      mode = 0;
    }
    else{
      mode = 1;
    }
  }
  if(mode == 1){
    while(x){
      updown1=digitalRead(8);   
      updown2=digitalRead(9);
      updown3=digitalRead(10);  
      if(updown2 == 1){
        hammertime = hammertime+100;
      }
      if(updown3 == 1){
        hammertime = hammertime-100;
      }
      if(updown1 == 1){
        break;
      }
      for(int i=4; i>-1; i--){
        digitalWrite(shinything[i], HIGH);
        delay(hammertime);
        digitalWrite(shinything[i], LOW);
      }
      for(int i=0; i<5; i++){
        digitalWrite(shinything[i], HIGH);
        delay(hammertime);
        digitalWrite(shinything[i], LOW);
      }
    }
  }
  if(updown2 == 1){
    hammertime = hammertime+100;
  }
  if(updown3 == 1){
    hammertime = hammertime-100;
  }
    
  for(int i=0; i<5; i++){
    digitalWrite(shinything[i], HIGH);
    delay(hammertime);
    digitalWrite(shinything[i], LOW);
  }
}

Some code examples of mine might prove insightful (?)

/* 
    1 pushbutton, 1 LED
    1 pushbutton switch affecting 1 LED's blink rate
*/ 
//  pbmillis3Speeds_01
//  pb/input is accurate
//
//  works 2016.09.03
//
// if the pb is kept active then
// the speeds get cycled
// 
// 
unsigned long markTime;
unsigned long elapsedTime;
unsigned long lockoutmark;  // pb-related
const unsigned long debounceTime = 250; // debounceTime
const unsigned long blinkSpeed [3] = {50,200,1000};
byte speedchoice;  // blinkSpeed[speedchoice]
boolean lockout;  // if true then PB is not checked
byte pbstate;
const byte pbpin = 2;
boolean ledstate;
const byte ledpin = 13;

void setup ()
{
  pinMode(pbpin,INPUT_PULLUP);  // D2
  pinMode(ledpin,OUTPUT);      // 13 on-board
  digitalWrite(ledpin,LOW);
  speedchoice = 0;
  lockout = false;
  markTime = millis();
}
void loop ()
{
  elapsedTime = millis();
  if(lockout == false)  // ok to read
  {
    pbstate = digitalRead(pbpin);
    if (pbstate == 0)  // pb made active
    {
      lockoutmark = millis();  // record millis when pb went LOW
      speedchoice++;
      lockout = true;
    }
    if(speedchoice > 2)
    {
      speedchoice = 0;
    }
    elapsedTime = millis();
  }
  
  elapsedTime = millis();
  if ((lockout == true) && ((elapsedTime - lockoutmark) >= debounceTime))
  {
    lockout = false; // lockout done, threshold met
  }
  
  elapsedTime = millis();
  if((elapsedTime - markTime) >= blinkSpeed[speedchoice]) //
  {
    markTime = millis();  // new mark
    ledstate = !ledstate;
    if (ledstate == true)
    {
      digitalWrite(ledpin,HIGH);
    }
    else
    {
      digitalWrite(ledpin,LOW);
    }
  }
}

and

//    blink patterns, 4 LEDs 
/*
  1 pushbutton and 4 LEDs  
  LED blink patterns selected with pushbutton actuation
*/ 
//  
//  pbmillisRoutines_01
//  
//  Working
//  2016.09.05
//
//  pattern remains active if held down
//
unsigned long markTime;
unsigned long elapsedTime;
unsigned long lockoutmark;  // pb-related
const unsigned long debounceTime = 500; // debounceTime
byte pinsArray [4] = {8,9,10,11};
const byte frame [] = {B00000011, B00001100, 
                       B00000101, B00001010,
                       B00000110, B00001001, 
                       B00000000, B11111111,
                       B00000001, B00000010, B00000100, B00001000,
                       B00000000, B00000001, B00000011, B00000111, 
                       B00001111, B00001110, B00001100, B00001000};  
                         
const byte routinePlan [6][2] = {0,1,   // first, last
                                 2,3,   // first, last
                                 4,5,   // first, last
                                 6,7,   // first, last
                                 8,11,  // first, last
                                 12,19};
byte first;
byte last;                       
byte routineIndex = 0;  
byte iteration = 0;
const unsigned long blinkSpeed = 500;
byte pbstate;
boolean lockout;  // if true then PB doesn't get checked
boolean tripped;  // pb hit, prep Update for new pointers etc.
const byte pbpin = 2;
byte index;  // general application, utility
void setup ()
{
  //Serial.begin(9600);
  pinMode(pbpin,INPUT_PULLUP);
  for(index=0; index<4; index ++)
  {
    pinMode(pinsArray[index],OUTPUT);  // 8, 9, 10, 11
    digitalWrite(pinsArray[index],LOW);
  }  
  
  routineIndex = 0;
  lockout = false;
  markTime = millis();
  
  tripped = true;
  Update();
}
void loop ()
{
  elapsedTime = millis();
  
  if(lockout == false)  // ok to read
  {
    pbstate = digitalRead(pbpin);
    if (pbstate == 0)  // pb made active
    {
      lockoutmark = millis();  // record millis when pb went LOW
      routineIndex++;
      lockout = true;
      tripped = true;
      if(routineIndex > 5)  // rollover
      {
        routineIndex = 0;
      }
    }
  }
  
  if(tripped == true)
  {
    Update();   // brings a 'tripped' with it
  }  
  
  elapsedTime = millis();
  if ((lockout == true) && ((elapsedTime - lockoutmark) >= debounceTime))
  {
    lockout = false; // lockout done, threshold met
  }
  
  elapsedTime = millis();
  if((elapsedTime - markTime) >= blinkSpeed) // determine whether Update() is due
  {
    markTime = millis();  // new mark
    Update();
  }
}
void Update ()
{
  if(tripped == true) // if tripped == false then we got here because IT'S TIME
  {
    // new line, new frame
    first = routinePlan[routineIndex][0];
    last = routinePlan[routineIndex][1];
    tripped = false;
    iteration = 0;
  }
  
  if ((iteration + first) > last)
  {
    iteration = 0;
  }
  
  byte bitmask = 1;
  
  for(byte progress = 0; progress < 4; progress++)
  {
    if((frame[iteration + first] & bitmask) == 0)
    {
      digitalWrite(pinsArray[progress],LOW);
    }
    else
    {
      digitalWrite(pinsArray[progress],HIGH);
    }
    bitmask = bitmask * 2;
  }
  iteration++;
  elapsedTime = millis();
}