Updated scripts for computing averages