Optimized run.sh script