Random button presses

Thanks,
That seems to have done the trick, I also increased the millis delay which helped out.
I have been moving things around trying to get better performance and must have deleted it. This was code written by Massimo Banzi for debouncing a button and I made it work for my project.
Here's what I ended up with.

const int button = 2;            // pin button is on
int val = 0;                     // current button state
int old_val = 0;
int buttonstate = 0;
unsigned long previousMillis = 0;

void setup() {
 
  pinMode(button, INPUT_PULLUP);
  Serial.begin(115200);
}
void loop() {
  val = digitalRead(button);
  if ( (millis() - previousMillis) >= 200) {    //state machine for button & debounce
    if ((val == 0) && (old_val == 1)) {
      buttonstate = 1 - buttonstate;
    }
    previousMillis = millis();
    old_val = val;
    Serial.println(buttonstate);
  }
}