Add comments to d3 logic