First working version.
The D3 code is bad