pointsDistance = pointsDistance.map(function(c, b) { var d = c.A, centre = "A"; for (var k in c) { var h = c[k]; k != "length" && h < d && (d = h, centre = k)