Code for CNM method with the modification of DDA