Update LDA code