updated ncd.c