replaced freqdist.inc(x) with freqdist[x] += 1