nearest-neighbor uses a vector instead a map, so is not necessary to
merge the results anymore. Improving the legibility
using vector instead of hash maps to avoid merging.