Refactored wordCloud command, made more general