new d3 code