ScanForWordCount function updated.