fixed dijkstra, added edge cost