implementation of simple neural network