Corrected an error in the LDFA function