loop through all values of D in range