can calculate the correct shortest distance for for B to B too