How would you architect a similar tool from scratch for automatic differentiation and backpropagation?