modify some code in d3 reading