add distance calculate code