add scripts for calculating goodness-of-fit