Having issues with the Serial Monitor needing to be opened for my entire code to work

or perhaps

  // Open serial communications and wait for port to open:
  Serial.begin(9600);
delay(500);