First draft of DiffAlgorithm(ND)