Added NN functions