rewriting app to urwid