Adding Chi-Squared analysis, few other weighted models and fixing some bugs I had introduced