question regarding input

Or use the internal pullup resistor with pinMode(3, INPUT_PULLUP)

...R