djikstra algorithm working