Extending dfa.py