Updated classes for chi-squared calculation