shell script improvements