Final version of script