Changed hardcoded ir threshold values to variables

and adjusted the values