simplify things (and make results deterministic) by sorting candidate words by their distance from the target word; add tests.
it is faster and deterministic