Using an extra variable sounds like the most robust solution. I actually thought about doing this but wasn't sure on the best way to go about it.

If you point me in the right direction for what I need to do, I'll have a go? :)