construct nfa can now test input strings