add control for the distance if nodes