backprop complete, gradient tests ok!