Dijkstra's algorithm is now working