add 'loop'

now it becomes a automata....