if structure takes too much time

Forgot the pull down resistors!

Rather than do a heap of soldering, invert your logic, and use the built-in pullups.