Fixed TOM calculation in better threaded routine - next up is
permutation support