             .append("circle")
             .attr("cx", 3)
             .attr("cy", 3)
-            .attr("r", 3);
+            .attr("r", 3)
         }
         #Create/select <g> elements to hold the different types of graphics
         #and keep them in the correct drawing order
-        pathGroup = d3.svg.select("g.piePaths");
+        pathGroup = d3.svg.select("g.piePaths")
         if (pathGroup.empty() ){
             pathGroup = d3.svg.append("g")
-                       .attr("class", "piePaths");
+                       .attr("class", "piePaths")
         }
         pointerGroup = d3.svg.select("g.pointers")
         if (pointerGroup.empty() ) {
             pointerGroup = d3.svg.append("g")
-                           .attr("class", "pointers");
+                           .attr("class", "pointers")
         }
         labelGroup = d3.svg.select("g.labels")
         if (labelGroup.empty() ) {
             labelGroup = d3.svg.append("g")
-                         .attr("class", "labels");
+                         .attr("class", "labels")
         }
         
         d3.path = pathGroup.selectAll("path.pie")
-            .data(data);
+            .data(data)
 
         d3.path.enter().append("path")
             .attr("class", "pie")
             .attr("fill", (d, i) -> 
-                return d3.color(i);
+                return d3.color(i)
         );
 
 #        this.path.transition()

        labels = labelGroup.selectAll("text")
            .data(data
                .sort((p1,p2) -> 
                    return p1.startAngle - p2.startAngle;
                ) 
            );
        labels.enter()
            .append("text")
            .attr("text-anchor", "middle");
        labels.exit()
            .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;
        
        labels.text((d) ->
            # Set the text *first*, so we can query the size
            # of the label with .getBBox()
            return d.value;
        )
        .each((d, i) ->
            # Move all calculations into the each function.

            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
            }
        )
