Implemented backpropagation of the error