Corrected test statistic errors and added all desired output