added the smallest distance of words in one window to weight