Added working backprop code