stack automaton in other way