converting code to use TSFOutput