Update script.sh

added average calculation