adjusting to match the successful test code
Refactored the deliver_*.pl script as a shell script, which works better.