implement first LDA version; WARNING: not tested!