         labels = labelGroup.selectAll("text")
             .data(data
                 .sort((p1,p2) -> 
-                    return p1.startAngle - p2.startAngle;
+                    return p1.startAngle - p2.startAngle
                 ) 
-            );
+            )
         labels.enter()
             .append("text")
-            .attr("text-anchor", "middle");
+            .attr("text-anchor", "middle")
         labels.exit()
-            .remove();
+            .remove()
         
         labelLayout = d3.geom.quadtree()
             .extent([[-that.width,-that.height], [that.width, that.height] ])
-            .x((d) -> return d.x;)
-            .y((d) -> return d.y;)
-            ([]); #create an empty quadtree to hold label positions
-        maxLabelWidth = 0;
-        maxLabelHeight = 0;
+            .x((d) -> return d.x)
+            .y((d) -> return d.y)
+            ([]) #create an empty quadtree to hold label positions
+        maxLabelWidth = 0
+        maxLabelHeight = 0
         
         labels.text((d) ->
             # Set the text *first*, so we can query the size
             # of the label with .getBBox()
-            return d.value;
+            return d.value
         )
         .each((d, i) ->
             # Move all calculations into the each function.

            # so can be accessed later when drawing the line
            
            # calculate the position of the center marker
            a = (d.startAngle + d.endAngle) / 2 ;
            
            #trig functions adjusted to use the angle relative
            #to the "12 o'clock" vector:
            d.cx = Math.sin(a) * (that.radius - 75);
            d.cy = -Math.cos(a) * (that.radius - 75);
            
            # calculate the default position for the label,
            #   so that the middle of the label is centered in the arc
            bbox = d3.getBBox();
            #bbox.width and bbox.height will 
            #describe the size of the label text
            labelRadius = that.radius - 20;
            d.x =  Math.sin(a) * (labelRadius);
            d.l = d.x - bbox.width / 2 - 2;
            d.r = d.x + bbox.width / 2 + 2;
            d.y = -Math.cos(a) * (that.radius - 20);
            d.b = d.oy = d.y + 5;
            d.t = d.y - bbox.height - 5 ;
            
            # check whether the default position 
            #   overlaps any other labels
            conflicts = [];
            labelLayout.visit((node, x1, y1, x2, y2) -> 
                #recurse down the tree, adding any overlapping 
                #node is the node in the quadtree, 

            if (conflicts.length) {
                console.log(d, " conflicts with ", conflicts);  
                rightEdge = d3.max(conflicts, (d2) ->
                    return d2.r
                )

                d.l = rightEdge
                d.x = d.l + bbox.width / 2 + 5
                d.r = d.l + bbox.width + 10
            }
            else console.log("no conflicts for ", d)
            
            # add this label to the quadtree, so it will show up as a conflict
            #   for future labels.  
            labelLayout.add( d )
            maxLabelWidth = Math.max(maxLabelWidth, bbox.width+10)
            maxLabelHeight = Math.max(maxLabelHeight, bbox.height+10)
        )
        #.transition()//we can use transitions now!
        .attr("x", (d) ->
                    return d.x
                )
                .attr("y", (d) ->
                    return d.y
                );


        pointers = pointerGroup.selectAll("path.pointer")
            .data(data)
        pointers.enter()
            .append("path")
            .attr("class", "pointer")
            .style("fill", "none")
            .style("stroke", "black")
            .attr("marker-end", "url(#circ)")
        pointers.exit().remove()
        
        pointers.transition().attr("d", (d) ->
            if (d.cx > d.l) {
                return "M" + (d.l+2) + "," + d.b + "L" + (d.r-2) + "," + d.b + " " + d.cx + "," + d.cy
            } else {
                return "M" + (d.r-2) + "," + d.b + "L" + (d.l+2) + "," + d.b + " " + d.cx + "," + d.cy
            }
        )
