tweaked the tsd finding code to choose between tsd1 and tsd3 so that tsd3 is chosen if it is longer