Working towards weighted chi-square