fixed bug where TL input was printing out median one few times.  PR ouput should be complete