Combining IR Remote and Ultrasonic sensor

I am trying to combine a ultrasonic sensor and an IR Remote to create a distance sensor. I want to use the remote so that the user can input a distance of their choice and the ultrasonic sensor will measure and light a red LED if it is out of range and a green LED if it is in range. I would also like to program a button that will then restart the program and ask for a new input. The only issue is I don’t know how to program the IR remote into the already existing code I have. Right now the ultrasonic sensor is automatically set to 100 and works fine by itself. I’ve attached some pictures of the code and my circuit. Just need help completing it.

Please read the advice at the top of Forum, how to attach code and info. That way more Forum members will be interested in answering. Some use smartphones and then added files are very inconvienient. If You can produce a more detailed diagram it would help. Small things sometimes makes a big difference.