fixed findWordLengths()