first automaton coded

it kicks ass