Got the chisqu function working!