Simulating and visualizing finite automata