add NN matrix and update NN implementation using NN