Some changes in Dijkstra. add ways.