h(next);
                var tile = next.dest.tile;
                return tile;
            } else {
                return seed;
            }
        }

        function selectNextNeighbor(seed) {
            if (seed.q.neighbors.length == 0) {
                return seed;
            } else {
                var next = seed.q.neighbors.shift();
                seed.q.neighbors.push(next);
                var tile = next.dest.tile;
                return tile;
            }
        }

        function sh