Rewrote setup.sh to use functions