switched sftd back to c implementation