added word frequency method