correct data structures for Dijkstra