changed Automaton.print() to Automaton.toString()