           var nextIndex;
                if (shifted) {
                    if (bounceSeed === null) {
                        bounceSeed = curTile;
                        bounceCount = 0;
                    }
                    if (bounceCount++ % 2 === 1) {
                        return selectNextNeighbor(bounceSeed);
                    } else {
                        return bounceSeed;
                    }
                }
                if (controlled) {
                    return curTile;
   