Turning on LED show with button

So here's another newbie exercise I'm struggling with.

I'm currently having issues programming a button to enable/disable an LED light show sketch I uploaded. The light show (which is basically fades 6 LEDS in and out randomly) works great, however, I'm having issues including the button to enable/disable the light show. Below is what I have:

byte led1 = 3; byte led2 = 5; byte led3 = 6; byte led4 = 9; byte led5 = 10; byte led6 = 11; int x = 0; int y = 0; int steps = 1;

//delay is in milliseconds for below int delaytime = 10; //change if needed, delay between increments of PWM //850 milliseconds is on-off/off-on time, in 17 step increments of brightness int delaytime2 = 1000; //change if needed, delay between switching of leds int buttonpin = 2; //On/Off button int buttonState = 0; int buttonPressCount = 0; boolean buttonPressed = false;

void setup (){ pinMode (led1, OUTPUT); pinMode (led2, OUTPUT); pinMode (led3, OUTPUT); pinMode (led4, OUTPUT); pinMode (led5, OUTPUT); pinMode (led6, OUTPUT); pinMode(buttonpin, INPUT_PULLUP);

do { x = x + steps; analogWrite (led1, x); analogWrite (led2, x); delay (delaytime); } while (x != 255); }

void loop() { buttonState = digitalRead(buttonpin); if(buttonState == false) { lightLED(); buttonPressed = true; } else{ buttonPressed = false; } }

void lightLED (){ y = 0; x = 255; delay (delaytime); do{ y = y + steps; x = x - steps; analogWrite (led3, y); analogWrite (led1, x); delay (delaytime); } while (y != 255 && x != 0); delay (delaytime2); y = 0; x = 255; do{ y = y + steps; x = x - steps; analogWrite (led4, y); analogWrite (led2, x); delay (delaytime); } while (y != 255 && x != 0); delay (delaytime2); y = 0; x = 255; do{ y = y + steps; x = x - steps; analogWrite (led5, y); analogWrite (led3, x); delay (delaytime); } while (y != 255 && x != 0); delay (delaytime2); y = 0; x = 255; do{ y = y + steps; x = x - steps; analogWrite (led6, y); analogWrite (led4, x); delay (delaytime); } while (y != 255 && x != 0); delay (delaytime2); y = 0; x = 255; do{ y = y + steps; x = x - steps; analogWrite (led1, y); analogWrite (led5, x); delay (delaytime); } while (y != 255 && x != 0); delay (delaytime2); y = 0; x = 255; do{ y = y + steps; x = x - steps; analogWrite (led2, y); analogWrite (led6, x); delay (delaytime); } while (y != 255 && x != 0); delay (delaytime2); }

The sketch uploads successfully, however, the light show starts automatically and the button that I included on my void loop doesn't seem to do anything. I basically want to program the button to enable/disable the light show once I press it. What am I doing wrong? Thanks guys!

Nvm, I figured it out. I simply had to make an adjustment to my void lightLED loop.