Floyd-Warshall working for W matrix. Need to build D matrix