Modified to use our nice class for distances.
MUCH MUCH better performance. Tracking takes less than 8% of the whole
computation. And seems to work fine :)