remove redundant code
add output code to lda.