added function count_points_J_H