dded addneighbor function