  curve.edge = tile.q.neighbors[j];
                addCurveClickHandler(curve);
                highlightCurve(curve, false, false);
                tile.q.neighbors[j].curve = curve;
                branchCount++;
            }
        }
        jukeboxData.branchCount = branchCount;
        return tiles;
    }

    function addCurveClickHandler(curve) {
        curve.click(
            function () {
                if (jukeboxData.selectedCurve) {
                    highlightCurve(jukeboxData.selectedCu