d3 improvement - thanks N3uro :)