add output of distances