wrote the backprop alg -- have not tested if correct