D3 chart now working correctly!