This is the perfect example of "I'm a programmer, I solve real world problems". Absolutely beautiful! Thanks for sharing the code as well, will definitely come in handy for when I do a Pokémon challenge with my friends (which happens every now and then).