Unexpected behavior ? what am I missing?

I have discovered what my error is. I feel pretty dumb?.I did not change the variable names (Rn) after I copied and pasted. Changing these variable names corrected the issue.

Ah, now I see it. I totally missed that when scanning through your code. Things like this are why I strongly recommend using "else" in these cases rather than two independent but mutually exclusive "if" clauses. I'm very glad you were able to get to the root of your problem as it's never satisfying to get something working without first understanding why the old version was failing.

  • Ben