update reduce.sh