changed lists of genre and words to dictionaries with index as value