old c4 code with curses