Dijkstra. Still has a bug. WIP