Understanding the backpropagation algorithm