Noob questions

when it receives an input on pin 4

But you don't ever read pin 4, so it never receives an input on that pin