The sqrt is not important: this scaling is done to avoid the trivial solution of all points collapsing on the origin.
I can put it back.