some code clean up, new design, handle stopword density