Quite frankly...what a cluster! You really have to work on your flow. There's too many places where you expect a value to be during one if/then, and then be there again at another if/then even though you just got done changing it.

Give me a few minutes to work it out...