add distance template modified.
Merge pull request #257 from jasvir99/dirty

add distance template modified.