Using sort + group + map to create the list of words and counts