

            var reach = (q.reach - distanceToEnd) * 100 / quanta.length;

            if (reach > longestReach && q.neighbors.length > 0) {
                longestReach = reach;
                longest = i;
                if (reach >= reachThreshold) {
                    break;
                }
            }
        }

        jukeboxData.totalBeats = quanta.length;
        jukeboxData.longestReach = longestReach;
        return longest
    }

    function filterOutBadBranches(type, lastIndex) {
      