Weighting now works on distance rather than order of closeness.