first try at dijkstra