full backprop implemented