Some demo code from ncurses docs