Chi square and degrees of freedom