Trying a different tack
It works now. 1000 times faster than python