improved tempest.sh