got rid of state variables, changed trigger condition for new IR