Added backpropagation; needs to be tested.