calculate.sh fixed