now uses Curses to handle keypress