minor changes in Main and fixes in LDA