Chi-Squared Goodness of Fit Tessts with Applications