add_example to calculate distance weights