modify bash script to be more simple