problem 4 compute word frequency histogram