paper js automata