Arduino UNO R3 using two outputs dependent to different inputs

you're explaining how it works, not what is does?

sounds like you don't have a problem i can help you with.