update shell script partB's code