Finished LDA algorithm