Implemented the backpropagation update function.