add TDFA
merged with demo