Thank you!
I tried changing the code according to your notes and I get the correct answer only 50%-60% of the times, Is it what you’re getting? if not, can you put the code after the changes here?
btw, you’re right, there’s no need for the R formula in this case.