Final script for the analysis