adding dijkstra algorithm