added chi-sqared test