Putting word cloud code into a function