update distances again