Converting two-way nondeterministic unary automata into simpler automata