The process couldn't be explained any better. The 'same distance' trick is especially clever. (it should be written in the textbook of game hacking 101, really)
As I was just tweaking around, I had a few trivial discoveries I thought I might share them as well:
1. The more BP the pokemon has...