updating ncclib.cpp