Vectorizing some operations in TRN now