d_ave and clus_coef merged into the same loop