added nn.cpp and nn.hpp