Implementation of the LSDA algorithm