contined to OOP the d3.
reverted code to get it in a runnable state