added Li and Leal
fixed error in calling permutation routine
No correction
added generic chi-squared function.
Merge branches 'dev' and 'master'