https://graphs.pythonprogramminghelp.com/break-all-the-rules-and-chi-square/