old dijkstra implementation used to solve week 5 PQ