Making WordCloud code more efficient