working on back propagation logic