Exercise 4 with neural networks backpropagation