Rewrote Transent function.  I didn't find any errors in calculation, and the printouts of the substrings all looked fine.