Dijks correctly updates costs in priority queue