Backprop algorithm with a hidden layer