Almost finished convertNFAtoDFA function