changed convert to return nfa format
compatible with nfa-visualizer