It is late here, but I somewhat can't wrap my head around it, why it is `1 - ...` and not just `power(weights, 2).sum()` and if we are calculating `fact` anyway, do you really need to normalize `weights` to sum up to 1?