Added more to dijkstra method