add distance template modified.