bugfix in T_x. Numerical overflow with large numbers of patches due to issue with factorial. Changed to use of lfactorial instead.
Further improved numerical stability by removing large factorials