updated bash script