update functions.sh