pulled out the ncurses stuff into a separate file