D3 javascript code changed