add the base LDA code