Fix d2S - add missing square roots
Integrate d2S to the python script