simple LDA implementation