Added ComputeChi2
Added distorsion function in Template