change db into static, rename DBconnect, add chi-square