added approx scheme to count_neighbors