implement NN method