Implemented basic dijkstra's