Got Dijkstra's algorithm working.