distance
                            float penalized_value = neighbor_value - distSquared * 1e-6;

                            if (penalized_value >= max_value)
                            {
                                max_value = penalized_value;
                                min_dist = distSquared;
                            }
                        }
                    }
                }
            }

            return (max_value == value) ? value : 0.0;
        }

        void main()
       