AFD is working and compute if a chain is accepted or not. Still not a flexible way of creating an AFD because of the way the transition matrix is created but I am working on it.