Added ncurses UI
Cleaned code