update nn.h and nn.cpp