corrected functions.sh