Added back propagation and weights updating