Serial.Available is blocking

 pinMode(index, INPUT_PULLUP);

Pins zero and one?
The ones you're using for the serial interface?

I did not see any setup options available to set blocking to non-blocking mode for the serial class.

Me neither.