BUG: fix the code I got from Laurent

Before this change, d(a,b) != d(b,a)

TODO: need to check that previous results calculated with this
code were not published with incorrect values.