+ added sim_distance function (p30)