Fixed automata

changed transition matrix to matrices