add _calc_dist method