added debugging code to output final states of transducers