Fixed a bug with my dijkstra's algorithm