nearly finished djikstra's