- modified knnW to speed up dict construction