working dijkstra's with new class structure