Improving DFAs to implement some more advanced features