Rework code to parse Data for D3