Finished the analysis script