bug fix: use flattened list of words for freqDist