Added word frequency assignment