distance vector algo