got the clustering working for d3 heatmaps