implementation of DFA algorithm
start coding BFS module