Update distances