Thanks to everyone who submitted solutions (Peter, Ian, Akshaya,
Roland, and Joe - you know who you are :)). You provided some great
feedback that I am slowly working through. Each solution seems to
work, it's just a matter of finding which fits best within my program.
There was a lot of other helpful knowledge gems in the submitted code
too, so thanks! :)