Further changes to D3 Python script