added calc function to function.sh