untraversedTiles.sort((a, b) => { if (heuristicCost[a.row][a.col] < heuristicCost[b.row][b.col]) { return-1; } return 1; });