implemented def wordOccurrences