Updated Fermi factor code