Rename according to story
Polished script
fixes chi correction.R