more cleanup and addition of automata example