How can I correctly setup attachInterrupt() in this sketch?

This is a dangerous game, leaving variables uninitialised. It might have worked here but put it inside a function and watch all hell break loose