Added hashing function for calculation of word frequency vector